Take a random number between 0 and 1, add another random number between 0 and 1, and then add a random number between 0 and 1 until and more than 1. An interesting question: How many times does it take to increase or exceed
What about 1? The answer is E.
To prove this, let's first look at a simpler question: How likely is the sum of the two real numbers between 0 and 1? It is easy to think that the point (x, y) Satisfying X + Y <1 occupies half of the Square (0, 1) x (0, 1, therefore, the probability that the sum of the two real numbers is less than 1 is 1/2. Similarly, the probability of the sum of three numbers less than 1 is 1/6, which is a cubic pyramid captured in the Unit Cube by plane x + y + z = 1. This 1/6 can be obtained through simple integral points by using the similarity relationship between the cross section and the bottom surface:
Round (0 .. 1) (x ^ 2) * 1/2 dx = 1/6
The probability that the sum of the four random numbers between 0 and 1 is less than 1 is equal to the "volume" in the corner of the four-dimensional cube. Its "bottom" is a three-dimensional body with a volume of 1/6, on the fourth dimension, you can obtain its "volume" by adding points"
Round (0 .. 1) (x ^ 3) * 1/6 dx = 1/24
So far, the probability that the sum of n random numbers does not exceed 1 is 1/n! In turn, the probability that the sum of N numbers is greater than 1 is 1-1/n! So the probability that the number of n just exceeds 1 is
(1-1/N !) -(1-1/(n-1 )!) = (N-1)/n!
Therefore, to make the sum greater than 1, we need to accumulate the expected number of times
Σ (n = 2 .. ∞) N * (n-1)/n! = Σ (n = 1 .. ∞) n/n! = E
Http://www.matrix67.com/blog/archives/3507