Lattice paths, the reflection principle and Catalan numbers
COMB · Chapter 413 min readAsked at Jane Street, Optiver, SIG, Citadel
Assumes Binomial identities, and proving them by counting twice.
After this lesson you should be able to
- Count monotone lattice paths, with and without a barrier.
- Use the reflection principle to count paths that touch a level.
- Recognise the Catalan family and the ballot problem behind it.
A surprising number of interview problems are the same object in different clothing: a sequence of up and down steps, counted subject to a constraint. Once you see a question as a lattice path, the reflection principle counts the constrained cases in one line — and the same argument reappears in random walks and in barrier option pricing.
Definition 4.1
Monotone lattice paths
Lattice path, — A path taking only right and up steps is determined entirely by which of its steps go up, so counting paths is choosing a subset. Every grid-walking question reduces to this, and constraints like "avoid this square" are handled by subtracting the paths that pass through it.
Derivation 4.2
The reflection principle
To count paths from to that touch a forbidden line, reflect the start across the line.
Take the first touch, and reflect everything before it.
This is a bijection: reflecting twice returns the original path, and every path from must cross the line.
Equation 4.3
The ballot problem
Candidate A finishes with votes and B with . Counting the votes in random order, this is the chance A leads throughout.
- The final margin.
- The total number of votes.
Why the answer is so simple. A formula this clean is usually a bijection in disguise, and it is: the reflection argument pairs every path that ties at some point with a path that starts the other way, so the surviving paths are exactly the ones whose first step is A and which never return to zero. The margin over the total is the residue left when those pairs cancel. It is worth recognising the shape — an answer that depends only on the endpoints, not on the route — because the same phenomenon makes gambler’s ruin and hitting probabilities so tractable.
Equation 4.4
Catalan numbers
Paths of ups and downs that never go below zero — and, by bijection, a great many other things.
- 1, 1, 2, 5, 14, 42, 132 — worth recognising on sight.
- The paths that do dip below, counted by reflection.
| Object | The bijection |
|---|---|
| Balanced bracket sequences of length | Open is up, close is down; never going negative is never closing too early |
| Binary trees with internal nodes | Read a traversal as the path |
| Triangulations of a convex -gon | Recursive split on one edge |
| Ways to parenthesise factors | Same recursion |
| Monotone paths below the diagonal of an grid | The definition itself |
| Stack-sortable permutations of items | Push is up, pop is down |
The rest of this lesson is in Premium
You have read the opening. 12 more sections follow, including 6 worked examples and 3 quick checks.
Nothing is charged for 7 days, and you can cancel before then. Or read Arithmetic that survives a clock in full, free.