Application Center - Maplesoft

App Preview:

Sum of Uniformed Random Variables

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

 

 

 

 

 

Image 

 

 

 Sum of Uniformed Random Variables 

 

The following was implemented in Maple by Marcus Davidsson (2009)

davidsson_marcus@hotmail.com and is based upon
 

 

 

 

 

 

 

 

Imagine that you are playing a game that for each "round" you are given a uniformed distributed random variable

between 0 and 1. After each round you are forced to sum all the outcomes from the previous rounds.

The game ends when such sum has become equal to or larger than one. The question now becomes:  

How many times on average can you play such a game before you are forced to end the game ? 

 

 

 

 

 

 

We can start by running a simple simulation of such game as follows: 

 

 

 

 

                                                                                            
                                                                                              Start Simulation 

 

                                Embedded component 

 

 

 

 

 

 

 

We can see that the most frequent number of rounds before the games end seems to be around 2 and 3. 

 

 

 

 

 

We can now plot the outcomes of each game and run a simulation for the expected number of rounds

before game is over as follows: 

 

 

 

 

                                                                                         
                                                                                 Embedded component
 

              

                                   Embedded component                  

 

 

 

 

 

 

We can see that the expected value seem to settle down around approximately 2.6 

 

 

 

 

We can confirm such finding by doing some further simulation as follows: 

 

                                                            

 

 

 

                                                                                           Embedded component 

 

 

                                            Embedded component 

 

 

 

 

 

What is interesting to note is that the expected number of rounds before game over converges to the Euler

constant e when n is large. The Euler constant is given by:   

 

 

 

 

e = 2.7182818284590452354 (1)
 

 

 

 

 

A further discussion can be found here:  http://mathforum.org/library/drmath/view/66592.html