1D Random Walk

Let us consider a Bernoulli trial. In this, we will consider a bunch of particles at the origin. We will sample a random variable from [-1, +1] and then change the position of each particle. The feeling is that on an average, the particles will have a zero mean because the random variable drawn has zero mean. Let's see what the final distribution of the locations will be.

As can be seen, the distribution of the distances tends towards that of a bell-shaped curve. In fact this curve is the normal distribution. The fact that for large times, the distribution tends towards the normal distribution, is a consequence of the Central Limit Theorem. In this particular case, if the step sizes have a finite variance, then the eventual distribution tends towards the normal distribution. Let us now sample from a uniform distribution.

Let us now see how the mean and variance scales with time.

Let's also check whether we can sample the random step using some other distribution.

The above plot clearly elucidates a very important property of the Central Limit Theorem. The variance seems to grow linearly with time.

We see that the variance still grows linearly. Quite remarkable. Any distribution which has a finite variance will yield such a result. This result also depends on the variance of the distribution from which the sample is picked. As a matter of fact, the function can be used to sample a uniform variable. Can you tell why specifically $\pm\sqrt{3}$ is employed as the lower and upper limit of the uniform distribution to achieve the linearly trend $\sim N$? What happens when you choose different upper and lower limits?

Yet another observation can be done when the distribution of step sizes does not have a finite mean. What should be the form of the uniform distribution so that the variance shows then $\sim N$ behaviour? Note that when the variance of the distribution is not 1, then the scaling between the variance and N for the distribution of the locations is still linear but with a different slope.