Library/Combinatorics/Catalan numbers

Catalan numbers

Overview
Important

Catalan numbers are a sequence of natural numbers that appear in many counting problems, often involving recursive structures. The nnth Catalan number, usually written as CnC_n, counts things like the number of ways to correctly match nn pairs of parentheses, the number of ways to split a polygon with n+2n+2 sides into triangles, or the number of non-crossing handshakes among 2n2n people sitting around a table.

Important properties

  • The first few Catalan numbers are: C0=1C_0 = 1, C1=1C_1 = 1, C2=2C_2 = 2, C3=5C_3 = 5, C4=14C_4 = 14, C5=42C_5 = 42.

  • Catalan numbers can be defined recursively: C0=1C_0 = 1, and for n1n \geq 1, Cn=k=0n1CkCn1kC_n = \sum_{k=0}^{n-1} C_k C_{n-1-k}.

  • Catalan numbers have a closed formula: Cn=1n+1(2nn)C_n = \frac{1}{n+1} \binom{2n}{n}.

  • They count many different combinatorial objects, such as valid bracket sequences, rooted binary trees, and non-crossing partitions.