4Random Walks
The One‐Dimensional Random Walk
A random walk is a walk in which the direction and/or the size of the steps are randomly chosen. Typically, there are Probability Distribution Functions (PDFs) associated with the direction, size, and timing of the steps. In two or three dimensions the random walk is sometimes called Brownian motion, named after the botanist, Robert Brown. Brown described seemingly random motion of small particles in water.1 In this chapter we'll tie together the idea of a random walk, which is another example of how the sum of experiments with a very simple PDF start looking normal, with the physical concept of diffusion, and a deeper look into what (frequentist) probability is.
Imagine that you're standing on a big ruler; it extends for miles in both directions. You are at position zero. In front of you are markings for +1 foot, +2 feet, +3 feet, etc. Behind you are markings for −1 foot, −2 feet, etc. Every ten seconds you flip a coin. If the coin lands on a head you take a step forward (in the + direction). If the coin lands on a tail you take a step backward (in the − direction). Each step moves you exactly one foot in your chosen direction. We are interested in where you could expect to be after many such coin flips.
If you were to keep a list of your coin flips, the list would look something like:
- Head. Take 1 step forward
- Tail. Take 1 step backward
- Head. Take 1 step forward
- Head. Take 1 step forward
- Head. Take 1 step forward
- Tail. Take 1 ...
Get Probably Not, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.