This is the exact question:
You are given black-box which returns a random number between 0 and 1(uniform distribution).You keep generating random numbers X1,X2,X3 and so on and store the sum of all those random numbers. You stop as soon as the sum exceeds 1.What is the expected number of random variables used in the process?
How I went about solving this is to find the probability that N random variables are required and S = event that sum exceeds 1.
For N=1, P(S) = 0.
For N=2, P(S) = 1/2 ( X1 + X2 > 1, when (X1,X2) lies above the line X1 + X2 = 1 where 0 < X1,X2 < 1. Area of triangle fulfilling the criteria is 1/2 )
For N=3, P(S) = 1/2 * 5/6 ( X1 + X2 + X3 > 1. This holds when X1 + X2 > 1 - X3 and integrating over all values of X3 gave the probability to be 5/6 which is multiplied with 1/2 because X1 + X2 < 1)
This seems to be a rather lengthy way to approach this problem. Is there a shorter more intuitive method?