+ Reply to Thread
Results 1 to 14 of 14

Thread: Simple Bernoulli question

  1. #1
    Fortran must die
    Points: 58,790, Level: 100
    Level completed: 0%, Points required for next Level: 0
    noetsi's Avatar
    Posts
    6,532
    Thanks
    692
    Thanked 915 Times in 874 Posts

    Simple Bernoulli question




    I am sort of baffled by this. The point is to simulate how often students will be right when guessing on a multiple choice tests with 5 responses. It is treated as a Bernoulli test with a probability of success equal to .2 [I understand this}. What I don't understand is this statement:

    We can simulate the correctness of the student for each question by generating
    an independent uniform random number. If this number is less than .2, we say that the
    student guessed correctly; otherwise, we say that the student guessed incorrectly.
    I don't understand why it would be less than .2 rather than less then or equal to [the SAS program they run for the simulation sets right equal to less than .2 and wrong equal to > than .2 - I don't know what would happen if the random number generates a result of exactly .2].

    This is the code they run [sas] although I don't think the code is really pertinant to the question.

    DATA NULL6;
    SEED = 12883;
    DO QUESTION = 1 TO 100;
    U = UNIFORM(SEED);
    IF U < .2 THEN CORRECT = 1;
    ELSE CORRECT = 0;
    PUT CORRECT U;
    END;
    RUN;
    QUIT;

    It is on page 25

    http://www.stats.uwo.ca/faculty/brau...sasnotes13.pdf

    If you had a 99 percent chance of being correct would you set the formula to less than .99?
    "Very few theories have been abandoned because they were found to be invalid on the basis of empirical evidence...." Spanos, 1995

  2. #2
    Devorador de queso
    Points: 95,540, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,930
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Simple Bernoulli question

    The uniform distribution is a continuous distribution. Can I ask you what you think the difference is in the probabilities you're talking about?

    And by this I mean if we let U \sim Unif(0,1)

    what do you think P(U \leq .2) - P(U < .2) equals?

    Notice that this essentially boils down to what do you think P(U = .2) is equal to?
    I don't have emotions and sometimes that makes me very sad.

  3. #3
    Fortran must die
    Points: 58,790, Level: 100
    Level completed: 0%, Points required for next Level: 0
    noetsi's Avatar
    Posts
    6,532
    Thanks
    692
    Thanked 915 Times in 874 Posts

    Re: Simple Bernoulli question

    I would think it means the probability of exactly .2 but even if that is right I don't understand why they do it the way they are. It would seem to me they exclude the probability of exactly .2. That is it seems they are analyzing 0-.19 and .21 and above but not exactly .2.
    "Very few theories have been abandoned because they were found to be invalid on the basis of empirical evidence...." Spanos, 1995

  4. #4
    Points: 1,470, Level: 21
    Level completed: 70%, Points required for next Level: 30

    Posts
    50
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Re: Simple Bernoulli question

    Quote Originally Posted by noetsi View Post
    I don't know what would happen if the random number generates a result of exactly .2
    CORRECT would equal 0 if U is equal to or greater than .2
    That's the implication of the ELSE statement.

    Art

  5. The Following User Says Thank You to ArtK For This Useful Post:

    noetsi (10-13-2014)

  6. #5
    Devorador de queso
    Points: 95,540, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,930
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Simple Bernoulli question

    Quote Originally Posted by noetsi View Post
    I would think it means the probability of exactly .2
    Yeah that's exactly the question I asked you but I'm asking you what you think this value is equal to. It's a probability so it has to be equal to some number. What number do you think it equals?
    I don't have emotions and sometimes that makes me very sad.

  7. #6
    Fortran must die
    Points: 58,790, Level: 100
    Level completed: 0%, Points required for next Level: 0
    noetsi's Avatar
    Posts
    6,532
    Thanks
    692
    Thanked 915 Times in 874 Posts

    Re: Simple Bernoulli question

    I missed the ELSE statement in the code.

    Embarrasingly Dason I would think that number would be 0 in a continuous distribution because I think the probability of any specific number in a continuous distribution would be that. But I am sure I am wrong
    "Very few theories have been abandoned because they were found to be invalid on the basis of empirical evidence...." Spanos, 1995

  8. #7
    Devorador de queso
    Points: 95,540, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,930
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Simple Bernoulli question

    Quote Originally Posted by noetsi View Post
    Embarrasingly Dason I would think that number would be 0 in a continuous distribution because I think the probability of any specific number in a continuous distribution would be that. But I am sure I am wrong
    That's exactly right. Which means that P(U < .2) is the same as P(U <= .2). So it doesn't matter (in theory) which you use in code.
    I don't have emotions and sometimes that makes me very sad.

  9. The Following User Says Thank You to Dason For This Useful Post:

    noetsi (10-13-2014)

  10. #8
    Fortran must die
    Points: 58,790, Level: 100
    Level completed: 0%, Points required for next Level: 0
    noetsi's Avatar
    Posts
    6,532
    Thanks
    692
    Thanked 915 Times in 874 Posts

    Re: Simple Bernoulli question

    Thanks. I never knew that. Someday I will not be so surprised so often here.

    Although I understand the theory, it just seems intuitively wrong for< and <= to have the same exact results. Probably because I do querries all the time with discrete data where they are never the same.
    "Very few theories have been abandoned because they were found to be invalid on the basis of empirical evidence...." Spanos, 1995

  11. #9
    Devorador de queso
    Points: 95,540, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,930
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Simple Bernoulli question

    That little fact is, of course, only valid for continuous distributions though.
    I don't have emotions and sometimes that makes me very sad.

  12. #10
    Fortran must die
    Points: 58,790, Level: 100
    Level completed: 0%, Points required for next Level: 0
    noetsi's Avatar
    Posts
    6,532
    Thanks
    692
    Thanked 915 Times in 874 Posts

    Re: Simple Bernoulli question

    In practice data, even if the system is continuous in theory, is always going to be measured discretely I would think. Because there is a specific level of measurement (say degrees for temperature) that will be used.
    "Very few theories have been abandoned because they were found to be invalid on the basis of empirical evidence...." Spanos, 1995

  13. #11
    Devorador de queso
    Points: 95,540, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,930
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Simple Bernoulli question

    Yeah but you're simulating so the argument you're making is irrelevant to the discussion. Now if you argued that a computer can't actually generate an outcome from a continuous distribution because there really are only a (large) finite number of outcomes a computer can generate. So in practice there is a very very small difference between coding U < .2 and U <= .2 but it doesn't make a difference realistically.
    I don't have emotions and sometimes that makes me very sad.

  14. #12
    Fortran must die
    Points: 58,790, Level: 100
    Level completed: 0%, Points required for next Level: 0
    noetsi's Avatar
    Posts
    6,532
    Thanks
    692
    Thanked 915 Times in 874 Posts

    Re: Simple Bernoulli question

    A good point about the simulation (which is actually where this comes from, I am finally getting around to learn how to do that).

    I still don't truly understand why a computer can not generate truly random numbers (commonly they are referred to as pseudorandom). But I have read in many sources they can not, perhaps because the starting point is never truly random.
    "Very few theories have been abandoned because they were found to be invalid on the basis of empirical evidence...." Spanos, 1995

  15. #13
    Devorador de queso
    Points: 95,540, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,930
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Simple Bernoulli question

    Quote Originally Posted by noetsi View Post
    I still don't truly understand why a computer can not generate truly random numbers (commonly they are referred to as pseudorandom). But I have read in many sources they can not, perhaps because the starting point is never truly random.
    How would you propose that a computer, an object that can only follow directions, generate a random number? You can't tell it "go left or right - just choose one" ... you need to tell it "go left" or you tell it "go right". It can't really truly be random. What we can do is create algorithms that give output that look and act random but are really following a specific set of instructions.

    That isn't the issue I was talking about though. I was saying that we can't actually generate a *continuous* random variable with a computer because it's impossible for a computer in finite time to do that. Instead we basically use a very fine discrete approximation to the continuous output and for any practical purpose that tends to be "good enough".
    I don't have emotions and sometimes that makes me very sad.

  16. The Following User Says Thank You to Dason For This Useful Post:

    noetsi (10-13-2014)

  17. #14
    Fortran must die
    Points: 58,790, Level: 100
    Level completed: 0%, Points required for next Level: 0
    noetsi's Avatar
    Posts
    6,532
    Thanks
    692
    Thanked 915 Times in 874 Posts

    Re: Simple Bernoulli question


    I understand that was not what you were talking about. But that explains why a computer can not chose randomly. Although it raises a question if human beings can and how. If we knew how, assuming humans actually can, than we could do the same things for computers

    Which is really like asking to people make decisions through, possibly very complex, algorithms. Or do we think some other way.
    "Very few theories have been abandoned because they were found to be invalid on the basis of empirical evidence...." Spanos, 1995

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats