Home › Combinatorics › Lesson 9

Catalan Numbers and Lattice Paths

Lesson 9 of 13

Key idea of this section

Cₙ = C(2n, n)/(n + 1) = C(2n, n) − C(2n, n + 1)
C(x) = 1 + x C(x)²,   C(x) = (1 − √(1 − 4x))/(2x)

Dyck paths and the reflection principle

A Dyck path of semilength n is a lattice path from (0, 0) to (2n, 0) with steps U = (1, 1) and D = (1, −1) that never goes below the x-axis. Let Cₙ be the number of them.

Theorem 9.1. Cₙ = C(2n, n) − C(2n, n + 1) = C(2n, n)/(n + 1).

Proof (André's reflection principle, 1887). There are C(2n, n) paths with n up-steps and n down-steps. A bad path touches the line y = −1; reflect the part of the path after its first such touch in that line. This produces a path from (0, 0) to (2n, −2), that is, one with n − 1 up-steps and n + 1 down-steps; conversely every such path must cross y = −1 and reflecting after its first touch recovers a bad path. So there are C(2n, n + 1) bad paths, and C(2n, n) − C(2n, n + 1) = C(2n, n)[1 − n/(n + 1)] = C(2n, n)/(n + 1). ∎

The same argument shows that the number of lattice paths from (0, 0) to (a, b), with unit east and north steps and a ≥ b, that never rise above the line y = x is C(a + b, b) − C(a + b, b − 1) = ((a − b + 1)/(a + 1)) C(a + b, b).

The recursive decomposition

A nonempty Dyck path decomposes uniquely by its first return to the axis as U P D Q, where P and Q are Dyck paths, of semilengths k and n − 1 − k. Hence C₀ = 1 and Cₙ = ∑ₖ CₖCₙ₋₁₋ₖ, so the OGF satisfies C(x) = 1 + xC(x)². Solving the quadratic and choosing the root that is a power series gives C(x) = (1 − √(1 − 4x))/(2x). Expanding √(1 − 4x) by the binomial series recovers Theorem 9.1 independently, since [xⁿ⁺¹] √(1 − 4x) = C(1/2, n + 1)(−4)ⁿ⁺¹ = −2Cₙ.

The values are C₀, …, C₁₂ = 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012. From Stirling's formula, Cₙ ~ 4ⁿ/(n3/2√π); the factor n−3/2 is the fingerprint of the square-root singularity of C(x) at x = 1/4.

A family of interpretations

Each of the following is counted by Cₙ, by a bijection with Dyck paths or by the same recursive decomposition: binary trees with n internal nodes; plane (ordered) trees with n + 1 vertices; full parenthesizations of a product of n + 1 factors; triangulations of a convex (n + 2)-gon (fix a side; the triangle on it splits the polygon in two); noncrossing partitions of [n]; permutations of [n] avoiding any fixed pattern of length 3 (Knuth for 231, Simion–Schmidt in general); and standard Young tableaux of shape (n, n). Stanley's monograph Catalan Numbers (2015) lists 214 such families.

The last of these is an instance of the hook length formula of Frame, Robinson and Thrall (1954): the number of standard Young tableaux of shape λ ⊢ n is n!/∏ h(c), the product over cells c of the hook length h(c), which is the number of cells to the right of c in its row, below c in its column, and c itself. For λ = (n, n) the hooks in the first row are n + 1, n, …, 2 and in the second row n, n − 1, …, 1, giving (2n)!/((n + 1)! n!) = Cₙ.

The ballot problem and the cycle lemma

Theorem 9.2 (Bertrand's ballot theorem, 1887). If candidate A receives a votes and candidate B receives b < a votes, and the ballots are counted in uniformly random order, the probability that A is strictly ahead throughout the count is (a − b)/(a + b).

Proof (cycle lemma of Dvoretzky and Motzkin, 1947). Write each ballot sequence as a word in +1 (for A) and −1 (for B) with sum a − b = m > 0. Among the a + b cyclic rotations of any such word, exactly m have all partial sums positive. Indeed, cancel adjacent pairs (+1, −1), cyclically, until only m copies of +1 remain; a rotation has positive partial sums exactly when it starts at one of the original positions of those m surviving +1's. Since rotation partitions the a + b positions into classes in which the fraction of good starting points is m/(a + b), the probability is (a − b)/(a + b). ∎

Applying the cycle lemma to words with n + 1 copies of +1 and n copies of −1 gives a third proof of Cₙ = C(2n + 1, n)/(2n + 1), which equals C(2n, n)/(n + 1).

Exercise

  • (a)
    Compute C₇ from the formula.
  • (b)
    How many east–north lattice paths from (0, 0) to (6, 4) never rise above y = x?
  • (c)
    In an election A receives 9 votes and B receives 6. What is the probability that A is strictly ahead throughout the count?
Show solution

Answers: (a) C(14, 7)/8 = 3432/8 = 429. (b) (3/7) · C(10, 4) = (3/7) · 210 = 90. (c) (9 − 6)/15 = 1/5.

V.3.1