50 Combinatorics of Compositions and Words
may be empty words.) By construction, w
isaDyckwordoflength2k,and
since the number of 1sand2s balance at position 2k +2,thewordw
is also a
Dyck word, and it has length 2(n −k −1). This representation is unique, and
we can therefore count the Dyck words according to this decomposition to get
the following recurrence relation, where d
n
counts the Dyck words of length
2n:
d
n
=
n−1
k=0
d
k
d
n−k−1
for n ≥ 1.
Adjusting for the fact that the convolution sum has upper index n −1 instead
of n we get
D(x) − 1=xD(x)
2
⇒ D(x)=
1 −
√
1 − 4x
2x
.
To extract the coefficients [x
n
]D(x), we make use of the following well-known
identity (see Equation (A.2))
√
1+t =
m≥0
1/2
m
t
m
=1+
m≥1
(−1)
m−1
(2m − 2)!
2
2m−1
m!(m − 1)!
t
m
.
Thus,
D(x)=−
1
2x
m≥1
(−1)
m−1
(2m − 2)!
2
2m−1
m!(m − 1)!
(−4x)
m
=
m≥1
1
m
2m − 2
m − 1
x
m−1
=
m≥0
1
m +1
2m
m
x
m
. (2.10)
This implies that d
m
is given by the m-th Catalan number
1
m+1
2m
m
.The
Catalan sequence
7
1, 1, 2, 5, 14, 132, 429, 1430, 4862, 16796,... which occurs as
sequence A000108 in [180] counts an enormous number of different combina-
torial structures (see Stanley [182, Page 219 and Exercise 6.19] ).Itwasfirst
described in the 18th century by Leonard Euler
8
, who was interested in the
number of different ways of dividing a polygon into triangles. The sequence is
named after Eug`ene Charles Catalan
9
, who also worked on the problem and
discovered the connection to parenthesized expressions.
Any Dyck word can be visualized by a Dyck path, a lattice path in the plane
integer lattice Z×Z consisting of up-steps (1, 1) and down-steps (1, −1) which
never passes below the x-axis. From the definition of Dyck words it is obvious
that a Dyck word on {1, 2} of length 2n can be represented as a Dyck path
where a 1 represents an up-step and a 2 represents a down-step. For example,
the Dyck path for the Dyck word 112122 is given in Figure 2.1.
7
http://mathworld.wolfram.com/CatalanNumber.html
8
http://turnbull.mcs.st-and.ac.uk/ history/Mathematicians/Euler.html
9
http://turnbull.mcs.st-and.ac.uk/ history/Mathematicians/Catalan.html
© 2010 by Taylor and Francis Group, LLC