Catalan Number — Definition, Formula & Examples
A Catalan number is a member of the sequence 1, 1, 2, 5, 14, 42, 132, ... that counts the number of ways to perform various combinatorial tasks, such as correctly matching parentheses or triangulating a polygon.
The -th Catalan number is defined as for . Equivalently, satisfies the recurrence and for .
Key Formula
Where:
- = The $n$-th Catalan number ($n \geq 0$)
- = A non-negative integer index
- = The central binomial coefficient, equal to $\frac{(2n)!}{n!\, n!}$
How It Works
You can compute Catalan numbers directly from the closed-form formula or build them up iteratively using the recurrence. The closed-form involves a single binomial coefficient divided by , which always yields an integer. Many counting problems reduce to Catalan numbers: the number of valid arrangements of pairs of parentheses, the number of distinct binary trees with internal nodes, the number of paths on an grid that stay below the diagonal, and the number of ways to triangulate a convex polygon with sides.
Worked Example
Problem: How many distinct ways can you arrange 4 pairs of parentheses so that every opening parenthesis is properly closed?
Identify n: With 4 pairs of parentheses, we need .
Apply the formula: Substitute into the closed-form expression.
Compute: Evaluate the binomial coefficient and divide.
Answer: There are 14 valid arrangements of 4 pairs of parentheses.
Visualization
Why It Matters
Catalan numbers appear across discrete mathematics, computer science, and algorithm design. They count binary search tree structures (relevant to data structure analysis), parse trees in compiler theory, and lattice path configurations in probability. Any course in combinatorics or algorithms will encounter them repeatedly.
Common Mistakes
Mistake: Forgetting the factor and reporting the central binomial coefficient as the Catalan number.
Correction: The Catalan number is always divided by . Without this factor you get a much larger number that overcounts by including invalid configurations.
