Random Walks on a 2D Lattice

An Unconstrained Random Walk on a Lattice
An Unconstrained Random Walk on a Lattice

I tried to visualize the random data collected from a Geiger Counter turned hardware-random-number-generator by plotting random walks with two different constrains on a 2D lattice of points.  One walk was left to freely meander and the other was instructed to not backtrack on itself once it had taken a step (self-avoiding).

As there are four degrees of freedom in this system, two bits were all that is necessary to specify the direction of the next step.  Pairs of bits were picked from the file of random binary and the walk was directed as such:
00 – Up
01 – Down
10 – Left
11 – Right
The code used to generate these plots can be found on my GitHub:
Unconstrained Random Walk
The walk was directed simply by the binary pairs.  No other constrains were placed upon the system.
fsp3 100,000 random meandering steps4 sub plotWhite triangles indicate the starting points, 1500 steps.

Self-Avoiding Random Walk
A condition of “self-avoidance” was placed upon the walk.  This simply means that the walk is not allowed to immediately back track upon itself.  The only obvious emergent property that aroused from this constraint was the absence of “spikes” as a result of an immediate back track.  The self avoiding random walks are more sprawling as would be expected.

The pairs of plots below were generated from the same string of random binary, the only difference being the condition of self avoidance placed on the walk in the right plot.
sarwSame data, different paths, 3000 steps
self avoiding

Note the absence of “spikes” in the rightmost walk.

Close ups of random walks with upwards of 200,000 steps.  
sarw1 sarw1


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s