generating function for the Catalan numbers
This article derives the formula
∑Cnxn=1-√1-4x2x |
for the generating function for the Catalan numbers, given in the parent (http://planetmath.org/CatalanNumbers) article, in two different ways.
A Dyck path is a lattice path
in the Euclidean plane
from (0,0) to (2n,0) whose steps are either (1,1) or (1,-1), i.e. either upwards diagonals or downwards diagonals, and which never goes below the x-axis. Here are two Dyck paths:
If you rotate a Dyck path counterclockwise by 45∘ and then reflect it in the line x=y, the result is a lattice path from (0,0) to (n,n) that never goes above the diagonal. One can also think of such a path as a path from (1,0) to (n+1,n) that never touches or crosses the diagonal. As the article on ballot numbers (http://planetmath.org/LatticePathsAndBallotNumbers) explains, these paths are counted by the Catalan numbers, and thus the number of Dyck paths of length 2n (or Dyck paths of semilength n) is equal to Cn, the nth Catalan number.
Note that any Dyck path has a unique decomposition as follows. Every Dyck path returns to the x-axis at some point (possibly at its end). Split the path at the first such point. Then the original path consists of an up step (the first step of the path), an arbitrary (perhaps empty) Dyck path, a down step returning to the x-axis, and then another arbitrary (perhaps empty) Dyck path.
Considering the first example above, this decomposition looks like this:
So a Dyck path is either empty, or consists of an up/down and two arbitrary Dyck paths. If one thinks about the lengths of the paths involved, it is clear that in terms of the generating function, we have
C(x)=1+xC(x)2
since a nonempty Dyck path of semilength n consists of two Dyck paths the sum of whose semilengths is n-1 together with the unique Dyck path of semilength 1 (the up-down steps).
Solving this quadratic equation, we get
C(x)=1±√1-4x2x
and we must decide between the plus and minus sign. However, note that C(x) is a formal power series with only nonnegative powers of x, and the expansion of √1-4x starts with the constant term |