Random Walks

This simulation aims to show the connection between unbiased random walks and normal distribution. It also showcases the relationship between Standard deviation, Mean squared displacement and number of steps. An animal which has equal probability of moving towards the left or towards the right, is said to execute an unbiased random walk.



Mean is expected to be around 0, standard deviation around √N and MSD around N





Simulation takes a couple of seconds to complete. Please wait

Press "restart" for changes to take effect



Relationship with Normal distribution

The probability of an entity reaching a particular point can be modelled as a binomial distribution. Due to the Central Limit Theorem - as the sample size increases, the distribution becomes more similar to a normal distribution.

Another way to look at it is via Pascal's triangle. The N-th row of Pascal's triangle (where N is the number of steps) has N elements. The entry at a particular point on Pascal's triangle shows the number of steps one can take to reach it (from the top of the triangle). Hence more animals end up at the middle than at the extremes. As we descend Pascal's triangle, The relative magnitudes of the elements bear more resemblance to a normal distribution.

This simulation is a codified form of Galton board, check it out here.


Parameters and their Formulae

1) Mean: since an animal is equally likely to go left or right, the mean position of an animal is expected to be zero.
2) Mean Squared Displacement: MSD is the mean of the square of displacements. It is calculated to be Na2, where 'a' is the displacement in one step (a = 1 in our case) and 'N' is the number of steps. Hence MSD = N.
3) Standard Deviation: is given by √(MSD - Mean2). Evaluates to √N in our case

The more animals we consider, the greater agreement we find between our measured and expected parameters.


Developed by ChanRT | Fork me at GitHub