Estimate e with a Sum of Random Draws

Select two numbers at random from the open unit interval (0,1) and add them. If the sum is 1 or larger, stop. Otherwise select a third number from (0,1) and add it to the first two. Again, if the sum is at least 1 stop, else continue. Let N be the number of summands required to reach or exceed 1. What is E(N), the expectation of N? Surprisingly E(N)=e (for an explanation follow the link below). Consequently the mean of many observations of N provides an estimate of e. This app implements that observation and illustrates it with some graphics.

To begin, select the number of iterations for the experiment using the slider bar below. Each iteration consists of selecting summands until the sum is at least 1 and recording N. Obviously more repetitions will generally provide a better estimate of e - but don't get greedy.

On the tab below this one at left, is an illustration of each iteration. Each vertical bar in the graph represents one iteration of the experiment; the lengths of colored components of the bar are the individual summands in order of selection from bottom to top. On the final tab is an animation which illustrates the mean of the number of summands, the values of N, converging to an estimate of e as the number of repetitions increases.