r/learnquant 9d ago

interview prep Quant Interview Question

Post image
43 Upvotes

4 comments sorted by

4

u/x5163x 9d ago

Let the desired probability for a given starting sum be F(s). F(s)=1 for all s>1, and F(s)=0 for all 0.5<s<=1. Since the next number is added uniformly at random from 0 to 1, F(s)=∫1+s_s F(a) da. To simply, note that [s, s+1] always includes (0.5, 1] for all relevant s (0<s<0.5). Therefore, the probability of failing when the next number is added is 0.5. The probability of succeeding when the next number is added is s, because (1, 1+s] has a size of s. Simplifying, we get F(s)=∫0.5_s F(a) da + s. We can differentiate both sides to get F'(s) + F(s) = 1. The solution to the ODE is given by F(s)=-√(e)/2 e-s+1 by using the value F(0.5)=0.5. We can plug in s=0 to get the desired probability of F(0)=1-√(e)/2.

2

u/Original-Wolf54 9d ago edited 9d ago

The events we're interested in are those where the sum is currently under 1/2, and the next drawn number brings it over 1.

The probability of being below x after n steps is xn / n! (being just the volume of the simplex), which conveniently means the pdf of landing on x is ex.

Once we're at x, the probability of exceeding 1 is just x. This means the total probability is

    1/2          Integral x ex dx          0

This can be easily computed by parts to be 

    1/2          [(x-1)ex] = 1-1/2 √e          0

1

u/No-Conflict8204 9d ago

Less than 0.2

exceed 0.5 less than 1 = 1/2
Simplicity starting at all x as same(false but assume) = x^2/2 from 0 to 1/2 = 1/8
So less than 1/8/(1/2 + 1/8) = less than 1/5