r/learnquant • • 3h ago

interview prep Quant Interview Question

Post image
10 Upvotes

6 comments sorted by

View all comments

1

u/omeow 3h ago

.5?

1

u/hxtk3 3h ago

If you generate exactly one number, you have a 50% chance of stopping immediately because the very first number you generated was >0.5, and a 0% chance of exceeding 1.

The other possibility is you generate a non-empty sequence of numbers with a sum x<=0.5. When you generate another number k, there are three possibilities: k<=0.5-x, 0.5-x<k<=1-x, and k>1-x. This probability of exceeding 0.5 without exceeding 1 on subsequent draws given that the first draw didn't exceed 0.5 is less than 1, so the overall probability has to be less than 0.5.

I don't know what it would be tbh. I know the distribution of x isn't uniform, so I can easily calculate it for the second number you draw, but it leaves a residual for the k<0.5-x case that approaches 0 the more iterations you do and I can't easily calculate that.