Thought Toys · Chance · Exhibit 130

The walk that always comes home — until it can fly.

A walker stands on a grid and steps at random for ever. No memory, no destination, no preference. Will it ever stand on its starting square again? On a line, and on a flat grid, the answer is not probably. It is certainly — probability exactly one. Give it one more dimension to wander in and certainty collapses to about one chance in three.

One walker, stepping at random — and how often a walk ever gets home ● where it started   — share of walks home by step n   — the ceiling for this many dimensions

dimensions walks that got home ceiling, given for ever walks finished

your turn — drag how many dimensions from 2 to 3 and watch the cyan curve stop climbing

What you're seeing

The walker above has no plan. At each step it picks one of its neighbouring squares at random — two of them on a line, four on a flat grid, six in the air — and goes there. Its starting square is ringed in amber. Nothing pulls it home and nothing pushes it away.

The chart below keeps score over many such walks. Each finished walk answers one question: did you ever stand on the start again? The cyan curve is the share that did. Every extra step is another chance, so the curve can only climb. The question is what it climbs to.

On a line and on a flat grid it climbs to one. Not to ninety-nine per cent, to one. Give the walks longer and the share home gets closer; give them for ever and coming home is certain.

But watch the pace, because this is the part that usually gets oversold. In one dimension the share still out after n steps shrinks like one over the square root of n. After ten thousand steps, eight walks in a thousand are still wandering. Certain is not the same word as soon.

Now drag the dimensions slider to 3. The curve lifts off, bends, and stops — flat against a grey line at about 34%. That is not impatience. About a third of the walks come home and the other two thirds never do — and the third that make it are quick about it. Half are home by step four, nine in ten inside a hundred. Give them a hundred thousand steps instead of three thousand and the ceiling does not move, because almost everyone who was ever coming back has already arrived.

Here is why the third direction breaks it. Add up the time a walk expects to spend standing on its start, over all steps, and you get either a finite number or an infinite one. On a line and on a grid that sum is infinite, so the walker keeps coming back. In the air it is finite: about 1.52 visits, counting the one it begins with. A walk that expects to stand there 1.52 times cannot be sure of standing there twice.

The more directions, the lonelier it gets: 34% in three, 19% in four, 14% in five. There is more room to be lost in and no more reason to come back.

What this is and isn't

This is a walk on a perfect endless lattice, with fair, independent, memoryless steps. Those words are load-bearing, and the first one most of all. Tilt the coin to 55/45 and even a walk on a line is no longer certain to return: it comes home nine times in ten, which is not the same as always.

It says nothing about a walk with a wall, an edge, or a home that moves. And the figure on screen is a tally of finished walks, not a formula drawn as a curve. You are watching a sample agree with a theorem, which is why it wobbles.

The rule, exactly. A simple random walk on the lattice ℤd steps to one of the 2d neighbours with equal probability. Let u be the expected number of times it stands on the origin, counting step zero. Each visit is a fresh independent chance to return, so the number of visits is geometric: P(ever returns) = 1 − 1/u Pólya (1921) showed u is infinite for d = 1 and 2, and finite from d = 3 on. In three dimensions Watson's integral gives u = 1.5163860592, hence P = 0.3405373296. One dimension is exact and needs no simulation at all: the chance of not having returned within 2n steps is C(2n,n)/4n ≈ 1/√(πn).
Checked before this page was written (improve/verify/130-polya-recurrence.js):

Also in Chance: The central limit theorem →

All 16 in Chance
  1. 05The Galton board
  2. 06The Monty Hall problem
  3. 115Play the best machine and you never find the best machine
  4. 119A bet worth infinity that nobody will pay $20 for
  5. 124Shuffle seven times and stop
  6. 13Buffon's needle
  7. 130The walk that always comes home — you are here
  8. 14The central limit theorem
  9. 30Markov chains
  10. 31Averages that never settle
  11. 35The birthday paradox
  12. 38The drunkard's walk
  13. 42The coupon collector's problem
  14. 52Genetic drift
  15. 63The gaps are chaos. The count is law.
  16. 76Every bet here has an edge. Some sizes still go broke.

Thought Toys · exhibit 130 · built 11 September 2026