Combinatorics – Number of Random Walks Starting and Ending at the Origin

combinatoricsrandom walk

In an infinite two-dimensional square-shaped grid, we define four directions, north, south, east, west. We thus have $4^n$ random walks of length $n$. If we end where we started, for every north step we have a south one, and similarly for east and west. Supposing $k$ north-south and $n/2 -k$ east-west steps, we find that the number of possible walks is $$\sum_{k=0}^{n/2}\frac{n!}{k!^2(n/2-k!)!^2}={n\choose n/2}\sum_{k=0}^{n/2}{n/2\choose k}^2={n\choose n/2}^2$$ a beautiful result that hints a cleaner interpretation. How can we see this directly from the grid?

Best Answer

Since $n$ must be even in order for the walk to be closed, I’ll write $n=2m$. Let $n_N,n_S,n_E$, and $n_W$ be the number of steps north, south, east, and west, respectively. Then $n_N=n_S$ and $n_E=n_W$, so $n_N+n_E=n_S+n_W=m$ and $n_N+n_W=n_S+n_E=m$.

Note also that if we choose $n_N,n_S,n_E$, and $n_W$ so that $n_N+n_E=n_S+n_W=m$ and $n_N+n_W=n_S+n_E=m$, then automatically $n_N=n_S$ and $n_E=n_W$.

Now imagine charting an $n$-step walk by starting with a strip of $n$ squares and labelling each square N, S, E, or W for steps north, south, easy, and west, respectively. However, we’ll do it in a slightly odd way. First choose any $m$ squares and mark them $\nearrow$. These will be the $m$ steps that go either north or east. Then choose any $m$ squares and mark them $\nwarrow$; these will be the $m$ steps that go either north or west. Clearly this procedure can be carried out in $\binom{2m}m^2$ ways. Now go through the strip and change the markings according the following rules:

  • a square marked with both $\nearrow$ and $\nwarrow$ is marked N.
  • a square marked only with $\nearrow$ is marked E.
  • a square marked only with $\nwarrow$ is marked W.
  • an unmarked square is marked S.

It follows from the remark in the second paragraph that we’ve laid out a chart for a path that returns to the origin, and it’s not hard to see that every $n$-step path that returns to the origin has a chart that can be produced in this way. There are $\binom{2m}m^2$ charts produced in this way, so there are $\binom{2m}m^2$ $n$-step paths that return to the origin.

Related Question