Random walk

A very small particle, only slightly larger in size than a molecule of air, is allowed to fall freely under gravity. Its trajectory is recorded using a digital camera. The horizontal (x) position of the particle is located for each of 8000 frames and stored as a set of picture element values (pixels) relative to the x-position in the first frame. A theoretical analysis of this problem suggests that the average x-position of the particle over long periods of time is zero. However, the probability of finding the particle at a particular x-position should follow a normal (Gaussian) distribution centred on x = 0, with a variance which increases linearly with time (the frame number). Thus the standard deviation should increase as the square root of the time. This example is a one-dimensional version of a random walk process, sometimes called the “Drunkard’s Walk”.

To simulate this process,

  • Open a blank spreadsheet.
  • Fill column A with 8000 rows of random numbers in the interval -1 to 1. Use the Tools/Data Analysis/Random Number Generation dialogue box.
  • In cell B1 enter the value 0 (the initial position of the particle).
  • In cell B2 enter the formula =B1+A1. Copy this formula into cells B3:B8000. Thus column B contains the positions of the particle at successive intervals of time.
  • Plot the x-position of the particle (column B) against the row number (time). This will show the random walk.
  • Calculate the standard deviations of the first 800, 1600, 2400 (etc until 8000) cells. Plot this against the square root of the time (square roots of the numbers 800, 1600, 2400 etc). Add a trend line with equation and R2. How well is the theoretical prediction borne out by your data? (Remember the prediction is only a statistical one and yours is a sample of 1. Look at the graphs of your neighbours. If they have used a different seed in the random number generation they will have a different set of plots. Perhaps the sample formed from the data of several of your neighbours’ results is better).

Another way to treat the data is to consider the data of x-positions as 320independent trials of 25 random steps, or 80 trials of 100 steps and so on.

  • Find the standard deviation of cells B1:B25, B26:B50, B51:B75 etc. till you have 8 samples (of non-overlapping data). Find the average of these eight standard deviations.
  • Repeat this for time intervals of 100, 225, 400, 625 and 900.
  • Calculate the average of the eight standard deviations and the standard deviation of these eight data points.
  • Plot the average standard deviations against the square root of the time intervals (25, 100, 225, 400, 625, and 900). Add a trend line with equation and R2.
  • You should calculate the uncertainty on each point and add the error bars to the plot. How well is the theoretical prediction borne out by this sample of data?