A drunkard was under a streetlight searching on his hands and knees for something. A passerby saw his plight and offered to help.Because of their erratic behavior, drunkards are used as examples of random and nearly random processes. We have the random walk of a drunkard wandering aimlessly in a park. We also have the mostly directed walk, called a drunkard's walk, of a more sober drunkard walking back home after a few rounds at the local tavern. A random walk is quite easy to program. You decide on distributions for the step size and direction, and you randomly choose each step from these distributions. Usually, a two dimensional random walk is just programmed as a uniform distribution of x increment and y increment in a plane. Some C code for a two dimensional random walk is here, and the following figure shows an example.
"What are you looking for?" he asked.
"My car keys," was the reply.
After helping in the search for a few minutes and finding nothing, the passerby asked, "About where did you drop them?"
The drunkard pointed towards a car in the distance.
"Then, why are you looking here!" exclaimed the passerby.
"Because the light's better," the drunkard replied.
A two dimensional random walk using data from the author's program. Plot via Gnumeric |
A particular type of Lévy flight using data from the author's program. Plot via Gnumeric |
Self avoiding walk on a square lattice. Image by Claudio Rocchini, via Wikimedia Commons |