Kolton Ndoj

Catalan numbers

One sequence counts brackets, staircases, ways to cut a polygon into triangles, and dozens of other things.

Cn=1n+1(2nn)=1,1,2,5,14,42,…C_n=\frac{1}{n+1}\binom{2n}{n}=1,1,2,5,14,42,\dots

What the symbols mean

nn
number of pairs of brackets, steps, or ...
(2nn)\binom{2n}{n}
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

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.

Related

Play with it live →

Math · Combinatorics · Stretch