The Walk Lab

Toss a coin n times, adding +1 for heads and −1 for tails. Forward, the distribution takes shape — not because the middle paths are likelier, but because there are more of them. Backward, name where the walk ended and watch path space collapse to the paths still consistent with it.

Companion to Practice 2: the lattice is §3, the reverse step is §7.

Act I · the forward processCounts pile up, and that is the distribution

Every node is a position after t steps; its label is the number of distinct paths that reach it. Node size is that count as a share of its own column. The bars on the right share the same k axis — so the distribution is literally the column of counts, turned on its side.

Lattice · path counts N(t,k)P(S_t = k)

Random walk lattice with path counts, and the distribution it produces

Every path is equally likely. All of them have probability 1/2ⁿ, so ranking paths by probability gives one enormous tie. What differs between endpoints is only how many paths land there.

Act II · the observationNaming the endpoint rules paths out

Now observe where the walk finished. The paths that survive are shown in colour, by the direction of each step; everything ruled out fades. Node labels switch to paths through here that still reach your endpoint.

Consistent paths, given the endpointnothing observed

The same lattice with paths inconsistent with the observed endpoint faded out

step +1 step −1 click an endpoint on the right edge, or use the buttons

Endpoints ranked by how many paths reach themties are exact

RankEnd at kPathsProbability

Act III · the reverse processRunning it backwards is counting

Of the paths that end where you said, what fraction took +1 last? Nothing has to be learned or approximated — count them. Apply the answer repeatedly and you have sampled a path backwards out of a single number.

The reverse step

The consistent paths