scott_wu's quiz

Revision en1, by rng_58, 2017-06-14 22:48:43
x = 0;

while(x < 1){
    y = x;
    x += rand(); // returns a real number between 0 and 1, uniformly at random
}

What is the expected value of y?

It's not very hard, but the result is surprising.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English rng_58 2017-06-14 22:48:43 238 Initial revision (published)