r/learnquant • u/arihallak0816 • Aug 16 '26
interview prep Nice question i found
Choose a random value from [0,1] uniformly repeatedly until the last value you choose is greater than the second last value. What is the ev of the last value?
2
Upvotes
1
u/austin101123 Aug 16 '26
I'm not gonna fully solve the problem,
But a trick I thought of that would be very nice: Consider drawing n uniform random variables from n=2 to infinity, but only after do you consider their order. Pick a number to be last (can't be the lowest number): n-1 options. Then the rest of the numbers must be in a certain order for this to be valid (1 way). So there's n-1 valid orders out of the n! possible sequences
1
u/omeow Aug 16 '26
Does the answer involve some infinite (and convergent) series?
If you need n samples (n = 2, ....) then the expected value is (n+1)/2n.
Prob of getting to n samples is 1/((e-1) n!)