Catalan numbers
One sequence counts brackets, staircases, ways to cut a polygon into triangles, and dozens of other things.
What the symbols mean
- number of pairs of brackets, steps, or ...
- ways to arrange n up-steps and n down-steps
Why it works — the picture
Walk n steps right and n steps up on a grid, never going above the diagonal. For n = 3 there are 5 such paths. Count all arrangements, choose(6,3) = 20, then divide to remove the paths that cross the diagonal: the reflection trick shows exactly a fraction n/(n+1) of arrangements are bad. Matched brackets are the same walks: ( is right, ) is up, never closing more than you opened.
Try it yourself
- List all 5 valid arrangements of 3 pairs of brackets.
- Cut a hexagon into triangles using non-crossing diagonals: there are 14 ways.
- Compute C_4 from the formula.
Where it’s used in real life
Counting valid expressions in computer parsing and the different ways a program can group operations.
The story behind it
Named after the Belgian mathematician Eugene Catalan, who studied them in the 1830s; Euler had met them earlier counting polygon triangulations.