Home › Pascal's Triangle › Lesson 12

Catalan Numbers, Reflection and the Ballot Problem

Lesson 12 of 14

Key idea of this section

Cₙ = C(2n, n) − C(2n, n + 1) = C(2n, n)/(n + 1) = C(2n + 1, n)/(2n + 1)
P(A strictly ahead throughout | a votes for A, b for B, a > b) = (a − b)/(a + b)

Dyck paths and the reflection principle

A Dyck path of semilength n is a sequence of n up-steps (+1) and n down-steps (−1) whose partial sums are all nonnegative. Let Cₙ be their number.

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

Proof. Among all C(2n, n) paths from height 0 to height 0, call a path bad if it reaches height −1. Reflect the portion of a bad path after its first visit to −1 in the line y = −1. This produces a path from 0 to −2, i.e. with n − 1 ups and n + 1 downs, and the map is a bijection onto all such paths (every path ending at −2 visits −1, and reflecting after the first visit inverts the map). Hence the number of bad paths is C(2n, n + 1), and C(2n, n) − C(2n, n + 1) = C(2n, n)(1 − n/(n + 1)) = C(2n, n)/(n + 1). ∎

The reflection argument is traditionally credited to Désiré André (1887), though André's own published argument was a different bijection.

The ballot theorem

Theorem 12.2 (Whitworth 1878; Bertrand 1887). If candidate A receives a votes and 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. Encode a count as a lattice path with up-steps for A. A good path starts with an up-step and stays strictly above 0 afterwards; it is a path from (1, 1) to (a + b, a − b) avoiding the axis. There are C(a + b − 1, a − 1) paths from (1, 1) to (a + b, a − b) in total. Those touching the axis are, by reflecting their initial segment up to the first touch, in bijection with paths from (1, −1) to (a + b, a − b), which have a ups and b − 1 downs: there are C(a + b − 1, a) of them. Hence the number of good paths is C(a + b − 1, a − 1) − C(a + b − 1, a) = C(a + b, a)(a/(a + b) − b/(a + b)), and dividing by C(a + b, a) gives the claim. ∎

Prepending an extra vote for A converts "never behind" into "strictly ahead": the number of paths from (0, 0) to (a, b) with unit east and north steps that never go above the diagonal (a ≥ b) is the ballot number

((a − b + 1)/(a + 1)) C(a + b, b)        (a = b = n:  Cₙ;   a = 8, b = 5:  (4/9) · 1287 = 572)

The cycle lemma

Lemma 12.3 (Dvoretzky–Motzkin, 1947). Let s be a sequence of a terms +1 and b terms −1 with a > b. Exactly a − b of the a + b cyclic rotations of s have all partial sums positive (counting rotations by their starting position).

Proof sketch. Call a starting position good if the rotation beginning there has all partial sums positive. A +1 immediately followed cyclically by a −1 can be deleted without changing which of the remaining starting positions are good, and neither deleted position is good (the −1 position starts with a negative sum, and the +1 position reaches 0 after two steps). After b such deletions only a − b terms +1 remain, all of them good. ∎

Applied to sequences of n + 1 ups and n downs (all rotations distinct because gcd(2n + 1, n) = 1), each rotation class of size 2n + 1 contains exactly one good sequence, and a good sequence is an up-step followed by a Dyck path. Hence Cₙ = C(2n + 1, n)/(2n + 1), a second proof of Theorem 12.1. More generally the cycle lemma gives the Fuss–Catalan numbers C(mn + 1, n)/(mn + 1) counting m-ary trees with n internal nodes.

Generating function and asymptotics

Decomposing a nonempty Dyck path at its first return to 0 gives Cₙ₊₁ = ∑k=0n Cₖ Cₙ₋ₖ, so C(x) = ∑ Cₙ xⁿ satisfies C(x) = 1 + x C(x)². Solving and choosing the branch regular at 0, C(x) = (1 − √(1 − 4x))/(2x). Newton's series for (1 − 4x)1/2 recovers Cₙ = C(2n, n)/(n + 1), and the central asymptotics of Lesson 13 give

Cₙ ~ 4ⁿ / (√π n3/2)

The sequence begins 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796. Stanley's monograph Catalan Numbers (2015) lists over two hundred families of objects counted by Cₙ, including triangulations of a convex (n + 2)-gon, binary trees with n internal nodes, noncrossing partitions of [n] and 231-avoiding permutations.

Parity

Proposition 12.4. v₂(Cₙ) = s₂(n + 1) − 1. In particular Cₙ is odd if and only if n = 2ᵐ − 1. Proof. v₂(Cₙ) = v₂ C(2n, n) − v₂(n + 1) = s₂(n) − v₂(n + 1) by Corollary 8.3. If n ends in exactly j binary ones, then v₂(n + 1) = j and adding 1 replaces these j ones by a single one, so s₂(n + 1) = s₂(n) − j + 1. Hence v₂(Cₙ) = s₂(n + 1) − 1, which vanishes exactly when n + 1 is a power of 2. ∎

Exercise

  • (a)
    Compute C₁₀.
  • (b)
    With a = 7 and b = 4, find the probability that A is strictly ahead throughout.
  • (c)
    Find v₂(C₃₀) and decide whether C₃₁ is odd.
Show solution

Answers: (a) C(20, 10)/11 = 184756/11 = 16796. (b) (7 − 4)/(7 + 4) = 3/11. (c) v₂(C₃₀) = s₂(31) − 1 = 5 − 1 = 4; C₃₁ is odd since 32 is a power of 2.

V.3.1