Math 2.0

Combinatorics Proof

Proof that Dyck words are counted by Catalan numbers, by first return decomposition

Builds on Dyck wordCatalan numbersRule of sumRule of productBijection principleStrong induction

Proof

We show that the counts satisfy the Catalan recursion, and conclude by strong induction.

  1. For a natural number mm, let WmW_m be the set of Dyck words of semilength mm, and let dm=∣Wm∣d_m = |W_m|. These words have length 2m2m over two letters, so WmW_m is finite.
  2. For a word pp, let h(p)h(p) be its number of letters UU minus its number of letters DD. A word ww is a Dyck word exactly when h(w)=0h(w) = 0 and h(p)≥0h(p) \ge 0 for every prefix pp of ww.
  3. The only word of length 00 is the empty word, and it is a Dyck word. So d0=1d_0 = 1.
  4. Fix a natural number nn, and let w∈Wn+1w \in W_{n+1}. Write w≤tw_{\le t} for the prefix of ww of length tt. The set of t≥1t \ge 1 with h(w≤t)=0h(w_{\le t}) = 0 contains 2n+22n + 2, so it has a least element t0t_0.
  5. The first letter of ww is UU, since h(w≤1)≥0h(w_{\le 1}) \ge 0. For 1≤t<t01 \le t < t_0 we have h(w≤t)≥1h(w_{\le t}) \ge 1, by step 2 and the choice of t0t_0.
  6. Each letter changes hh by 11 or −1-1. Since h(w≤t0−1)≥1h(w_{\le t_0 - 1}) \ge 1 and h(w≤t0)=0h(w_{\le t_0}) = 0, letter t0t_0 is DD and h(w≤t0−1)=1h(w_{\le t_0 - 1}) = 1.
  7. So w=U w1 D w2w = U\, w_1\, D\, w_2, where w1w_1 consists of the letters 22 to t0−1t_0 - 1 and w2w_2 of the letters after t0t_0.
  8. The word w1w_1 is a Dyck word. Its prefixes qq satisfy h(q)=h(Uq)−1≥0h(q) = h(Uq) - 1 \ge 0 by step 5, and h(w1)=h(w≤t0−1)−1=0h(w_1) = h(w_{\le t_0 - 1}) - 1 = 0 by step 6.
  9. The word w2w_2 is a Dyck word. Its prefixes qq satisfy h(q)=h(Uw1Dq)≥0h(q) = h(U w_1 D q) \ge 0, because h(Uw1D)=0h(U w_1 D) = 0. Likewise h(w2)=h(w)=0h(w_2) = h(w) = 0.
  10. If w1w_1 has semilength ii, then w2w_2 has semilength n−in - i, because ww has n+1n + 1 letters UU. So 0≤i≤n0 \le i \le n.
  11. Conversely, let 0≤i≤n0 \le i \le n, w1∈Wiw_1 \in W_i and w2∈Wn−iw_2 \in W_{n-i}, and let w=U w1 D w2w = U\, w_1\, D\, w_2. Its prefixes have hh equal to 00, 1+h(q)1 + h(q) for a prefix qq of w1w_1, or h(q)h(q) for a prefix qq of w2w_2.
  12. All of these are at least 00, and h(w)=0h(w) = 0. So w∈Wn+1w \in W_{n+1}.
  13. In this ww, the prefixes of lengths 11 to 2i+12i + 1 have h≥1h \ge 1, and the prefix of length 2i+22i + 2 has h=0h = 0. So t0=2i+2t_0 = 2i + 2, and step 7 recovers w1w_1 and w2w_2.
  14. Hence w↦(w1,w2)w \mapsto (w_1, w_2) is a bijection from Wn+1W_{n+1} onto the disjoint union over 0≤i≤n0 \le i \le n of the sets Wi×Wn−iW_i \times W_{n-i}.
  15. By the bijection principle, the rule of sum and the rule of product, dn+1=∑i=0ndi dn−id_{n+1} = \sum_{i=0}^{n} d_i\, d_{n-i}.
  16. The Catalan numbers satisfy C0=1C_0 = 1 and Cn+1=∑i=0nCi Cn−iC_{n+1} = \sum_{i=0}^{n} C_i\, C_{n-i}. We show dm=Cmd_m = C_m for all mm by strong induction on mm.
  17. For m=0m = 0, d0=1=C0d_0 = 1 = C_0 by step 3. For m=n+1m = n + 1, assume di=Cid_i = C_i for all i≤ni \le n. Then step 15 gives dn+1=∑i=0nCi Cn−i=Cn+1d_{n+1} = \sum_{i=0}^{n} C_i\, C_{n-i} = C_{n+1}.
  18. Hence the number of Dyck words of semilength nn is CnC_n for every natural number nn.

Idea

A nonempty Dyck word returns to level 00 for a first time. Cutting it there writes it uniquely as Uw1Dw2U w_1 D w_2 with two shorter Dyck words. So the counts obey the same recursion and start value as the Catalan numbers.

Reading path

To understand this page from the ground up, read these 52 pages in order. The foundations come first. The path takes the proofs Proof that a composition of injections is injective, Proof that a function is bijective iff it has a two-sided inverse, Proof of the rule of product, Proof of strong induction from ordinary induction, Proof that a composition of surjections is surjective, Proof of the rule of sum, Proof of the bijection principle.

  1. Cardinality of a finite set definition
  2. Catalan numbers definition
  3. Definition by recursion concept
  4. Dyck word definition
  5. Element definition
  6. Mathematical induction concept
  7. Natural numbers object
  8. Peano axioms concept
  9. Proposition concept
  10. Set definition
  11. Successor function definition
  12. Conjunction definition
  13. Implication definition
  14. Predicate definition
  15. Empty set object
  16. Ordered pair definition
  17. Intersection definition
  18. Addition of natural numbers definition
  19. Existential quantifier definition
  20. The successor function is injective statement
  21. Universal quantifier definition
  22. Zero is not a successor statement
  23. Cartesian product definition
  24. Disjoint sets definition
  25. Subset definition
  26. Order on the natural numbers definition
  27. Uniqueness quantifier definition
  28. Binary relation definition
  29. Proof of strong induction from ordinary induction proof
  30. Function definition
  31. Strong induction statement
  32. Codomain definition
  33. Function composition definition
  34. Identity function definition
  35. Injective function definition
  36. Surjective function definition
  37. Left inverse definition
  38. Right inverse definition
  39. Proof that a composition of injections is injective proof
  40. Proof that a composition of surjections is surjective proof
  41. Bijective function definition
  42. Composition of injections is injective statement
  43. Composition of surjections is surjective statement
  44. Proof of the rule of sum proof
  45. Proof that a function is bijective iff it has a two-sided inverse proof
  46. Rule of sum statement
  47. Bijective iff it has a two-sided inverse statement
  48. Proof of the rule of product proof
  49. Proof of the bijection principle proof
  50. Rule of product statement
  51. Bijection principle statement
  52. Proof that Dyck words are counted by Catalan numbers, by first return decomposition proof

Where this leads

5 pages build on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Catalan_number, Proof of the formula, Fifth proof
About this page
TagCXC72Q81V9
URIm2://CXC72Q81V9
Kindproof
WritingW0 stub
MSC05A15
ProvesDyck words are counted by Catalan numbers
UsesDyck word, Catalan numbers, Rule of sum, Rule of product, Bijection principle, Strong induction
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.