1. ## 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?

2. ## 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

what do you think equals?

Notice that this essentially boils down to what do you think is equal to?

3. ## 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.

4. ## Re: Simple Bernoulli question

Originally Posted by noetsi
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. ## Re: Simple Bernoulli question

Originally Posted by noetsi
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?

7. ## 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

8. ## Re: Simple Bernoulli question

Originally Posted by noetsi
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.

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

noetsi (10-13-2014)

10. ## 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.

11. ## Re: Simple Bernoulli question

That little fact is, of course, only valid for continuous distributions though.

12. ## 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.

13. ## 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.

14. ## 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.

15. ## Re: Simple Bernoulli question

Originally Posted by noetsi
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".

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

noetsi (10-13-2014)

17. ## 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.

 Tweet

#### Posting Permissions

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