Mathwords logoMathwords

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 nn-th Catalan number CnC_n is defined as 1n+1(2nn)\frac{1}{n+1}\binom{2n}{n} for n0n \geq 0. Equivalently, CnC_n satisfies the recurrence C0=1C_0 = 1 and Cn+1=i=0nCiCniC_{n+1} = \sum_{i=0}^{n} C_i \, C_{n-i} for n0n \geq 0.

Key Formula

Cn=1n+1(2nn)=(2n)!(n+1)!n!C_n = \frac{1}{n+1}\binom{2n}{n} = \frac{(2n)!}{(n+1)!\, n!}
Where:
  • CnC_n = The $n$-th Catalan number ($n \geq 0$)
  • nn = A non-negative integer index
  • (2nn)\binom{2n}{n} = 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 n+1n+1, which always yields an integer. Many counting problems reduce to Catalan numbers: the number of valid arrangements of nn pairs of parentheses, the number of distinct binary trees with nn internal nodes, the number of paths on an n×nn \times n grid that stay below the diagonal, and the number of ways to triangulate a convex polygon with n+2n+2 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 C4C_4.
n=4n = 4
Apply the formula: Substitute n=4n = 4 into the closed-form expression.
C4=15(84)=158!4!4!C_4 = \frac{1}{5}\binom{8}{4} = \frac{1}{5} \cdot \frac{8!}{4!\,4!}
Compute: Evaluate the binomial coefficient and divide.
(84)=70,C4=705=14\binom{8}{4} = 70, \quad C_4 = \frac{70}{5} = 14
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 1n+1\frac{1}{n+1} factor and reporting the central binomial coefficient (2nn)\binom{2n}{n} as the Catalan number.
Correction: The Catalan number is always (2nn)\binom{2n}{n} divided by n+1n+1. Without this factor you get a much larger number that overcounts by including invalid configurations.