Closed Form for a 2D Random Walk Probability Distribution
At a glance
- 1. Specify the walk
Assume each step independently moves one unit north, south, east, or west, each with probability one quarter.
- 2. Check reachability
A point (x, y) is reachable after n steps only if its Manhattan distance is at most n and the parities agree.
- 3. Count paths
Choose how many steps are horizontal, then count their directions and the directions of the remaining vertical steps.
- 4. Divide by all paths
Multiply the path count by 4 to the power negative n to get the probability.
A “2D random walk” can describe several different processes. Here, use the standard simple symmetric random walk on the square lattice: at each step, move one unit north, south, east, or west, with probability for each direction. The steps are independent.
This model has a closed-form probability at every location after any fixed number of steps. The expression is a finite sum because the walk can use different numbers of horizontal and vertical steps to reach the same point.
The probability after n steps
Let be the position after steps, starting at . To reach , suppose exactly of the steps are horizontal. The other steps are vertical.
For the horizontal steps, the number east minus the number west must equal . Thus the number east is , and the number of ways to choose the horizontal directions is
Likewise, the number of north steps must be , giving
ways to choose the vertical directions. There are ways to choose which step times are horizontal. Every complete sequence of directions has probability . Therefore,
The restrictions make each binomial coefficient meaningful. In particular, the number of horizontal steps must be at least , and the number of vertical steps must be at least . The parity conditions ensure that the horizontal and vertical steps can produce displacements and , respectively. When , the vertical parity condition follows from the horizontal one.
An equivalent quick reachability test is
If either condition fails, the probability is zero. If they hold, the sum above gives the probability.
Worked example: return to the origin after four steps
Find the probability of being at after steps. The horizontal step count must be even, so the possible values are .
- If , all four steps are vertical. There are ways to take two north and two south steps.
- If , choose the two horizontal times in ways. The horizontal directions can be ordered in ways, and so can the vertical directions. This gives paths.
- If , all four steps are horizontal, with ways to balance east and west.
There are successful direction sequences, out of equally likely sequences. Hence
Another point: (1,1) after two steps
Here, one step must be horizontal and one vertical, so is the only term. There are choices for which step is horizontal, and both directions are then forced: east and north. Thus
The two possible paths are east-then-north and north-then-east.
Common mistakes
Using the wrong step model. The formula above assumes exactly one cardinal direction is chosen at each step. In another common model, the horizontal and vertical coordinates each independently move by or on every tick. That walk moves diagonally on the square lattice, so it has a different distribution; its coordinates are independent, and each coordinate has a binomial distribution after shifting and rescaling.
Treating the coordinates as independent in the cardinal-direction model. At a fixed step count, a move allocated to the horizontal coordinate is not also a vertical move. The horizontal and vertical displacements are therefore not independent, even though the direction choices at different times are independent.
Ignoring parity. A walk cannot reach a point merely because its Manhattan distance is at most . Each step changes the parity of , so the parity of the endpoint must match the parity of .
Forgetting to count step positions. Counting only the possible horizontal and vertical direction sequences misses the choices of which times are horizontal. The factor accounts for those choices.
References
- Probability and Random Processes, Geoffrey Grimmett and David Stirzaker
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.