R=Random(0,1)
If R=0
SAY “P(R=0)=1/2”
Elseif
SAY “P(R=0)=1/2″:
SAY “P(R=0)=1/2”
Endif
The next doesn’t:
R=Random(0,1)
If R=0
SAY “P(R=0)=1/3”
Elseif
SAY “P(R=0)=1/3″:
SAY “P(R=0)=1/3”
Endif
Run it many times and you will clearly see, that the first program will be right, since it will be about the same number of cases when R will be 0 and the other cases when R will be 1.
The next program works well:
R=Random(0,1) If R=0 SAY “P(R=0)=1/2” Elseif SAY “P(R=0)=1/2″: SAY “P(R=0)=1/2” Endif
The next doesn’t:
R=Random(0,1) If R=0 SAY “P(R=0)=1/3” Elseif SAY “P(R=0)=1/3″: SAY “P(R=0)=1/3” Endif
Run it many times and you will clearly see, that the first program will be right, since it will be about the same number of cases when R will be 0 and the other cases when R will be 1.
Just what the first program keep saying.