Kernel: Python 3 (Anaconda 2022)
The Random Walk
The first cell loads two external modules
In [1]:
Now we create a single random walk
In [6]:
Out[6]:
More walks on one page
In [13]:
Out[13]:
To investigate the average distance & displacement, we create a number of subloops. We end with two lists of the averages of many loops of different lengths
In [4]:
Out[4]:
The average displacement remains at zero, as expected. However, the average distance from the origin increases. This appears to be a square-root relationship.
In [5]:
Out[5]:
In [0]:
In [0]:
In [0]: