On the 20th of December 2018, I uploaded a post titled Random Walks in which I looked at random walks within a grids of fixed size. For example, consider a 4 x 4 grid of points where the walk starts at (0, 0) and finishes at (4, 4). Movement can be vertical (up or down) or horizontal (left or right) but is confined to the grid. Diagonal movement in one step is not possible. See Figure 1.
![]() |
Figure 1 |
I created a program (permalink) to simulate 1000 random walks and calculate the median of the number of steps required to travel from (0, 0) to (4, 4). It turned out to be about 60 steps. In this post, I looked at other 2-D grid sizes and also random walks in 3 dimensions with varying grid sizes (permalink). See Figure 2.
![]() |
Figure 2 |
This present post was inspired by a Cliff Pickover tweet. See Figure 3.
![]() |
Figure 3 |
I created a SageMath program (permalink) to simulate a 2-D random walk starting at the origin and concluding at the origin (if it is ever reached). Movement can be up or down one step and\or left or right one step, so diagonal movement is possible. See Figure 4.
![]() |
Figure 4 |
I set a step limit of 100,000 and quite often the walk had not returned to the origin by then. See Figure 5.
![]() |
Figure 5 |
At other times, it would return to the origin within the limit imposed. See Figure 6 and Figure 7.
![]() |
Figure 6 |
![]() |
Figure 7 |
Often the walk will end after a few dozen steps or less and these shorter walks are by far the most common. See Figure 8.
![]() |
Figure 8 |
This was just an introductory look at 2-D random walks upon an infinite grid and there's much more to explore. As an example, Figure 9 shows another tweet from Cliff Pickover regarding SAW (Self Avoiding Walks).
![]() |
Figure 9 |
No comments:
Post a Comment