Discrete Mathematics
Discrete Mathematics
Functions
1
The partial sums of a sequence (an) are the summations:
s0 = a0,
s1 = a0 + a1,
s2 = a0 + a1 + a2,
...
sn = a0 + a1 + · · · + an,
...
1 2 n−1 n 1 2 n−2 n
There are hn−1 ways in the first type and hn−2 ways in the second type. Thus
hn = hn−1 + hn−2, n ≥ 2.
Therefore the sequence (hn; n ≥ 0) is the Fibonacci sequence (fn; n ≥ 0) with
f0 = 0 deleted, i.e.,
hn = fn+1, n ≥ 0.
Example 1.6. Determine the number bn of ways to perfectly cover a 1-by-n
board by dominoes and monominoes.
5
bn = bn−1 + bn−2, b0 = b1 = 1, b2 = 2.
Theorem 1.2. The Fibonacci number fn can be written as
bX2 cµ
n−1
¶
n−k−1
fn = , n ≥ 0.
k
k=0
To prove the theorem, it suffices to show that the sequence (gn) satisfies the
Fibonacci recurrence relation with the same initial values. In fact, g0 = 0,
6
¡0¢
g1 = 0 = 1, and for n ≥ 0,
Xn µ ¶ X n−1 µ ¶
n−k n−k−1
gn+1 + gn = +
k k
k=0 k=0
³n´ X n µ ¶ X n µ ¶
n−k n−k
= + +
0 k k−1
k=1 k=1
³n´ X n ·µ ¶ µ ¶¸
n−k n−k
= + +
0 k k−1
k=1
³n´ X n µ ¶
n−k+1
= + (By the Pascal formula)
0 k
k=1
µ ¶ X n µ ¶ µ ¶
n+1 n−k+1 0
= + +
0 k n+1
k=1
n+1 µ
X ¶
(n + 2) − k − 1
= = gn+2.
k
k=0
8
and (bn) be solutions of (5). Then
an + bn = [α1(n)an−1 + α2(n)an−2 + · · · + αk (n)an−k ]
+[α1(n)bn−1 + α2(n)bn−2 + · · · + αk (n)bn−k ]
= α1(n)(an−1 + bn−1) + α2(n)(an−2 + bn−2) +
· · · + αk (n)(an−k + bn−k ), n ≥ k.
For scalars c,
can = c[α1(n)an−1 + α2(n)an−2 + · · · + αk (n)an−k ]
= α1(n)can−1 + α2(n)can−2 + · · · + αk (n)can−k , n ≥ k.
This means that Hk is closed under the addition and scalar multiplication of
sequences.
To show that Hk is k-dimensional, consider the projection π : S∞ → Rk ,
defined by
π(x0, x1, x2, . . .) = (x0, x1, . . . , xk−1).
We shall see that the restriction π|Hk : Hk → Rk is a linear isomorphism. For
each (a0, a1, . . . , ak−1) ∈ Rk , define an inductively by
an = α1(n)an−1 + α2(n)an−2 + · · · + αk (n)an−k , n ≥ k.
Obviously, we have π(a0, a1, a2, . . .) = (a0, a1, . . . , ak−1). This means that π|Hk
is surjective. Now let (un) ∈ Hk be such that π(u0, u1, u2, . . .) = (0, 0, . . . , 0),
i.e.,
u0 = u1 = · · · = uk−1 = 0.
Applying the recurrence relation (5) for n = k, we have uk = 0. Again applying
(5) for n = k + 1, we obtain uk+1 = 0. Continuing to apply (5), we have un = 0
for n ≥ k. Thus (un) is the zero sequence. This means that π is injective. We
have finished the proof that π|Hk is a linear isomorphism from Hk onto Rk . So
dim Hk = k.
(b) For each solution (vn) of (4), we claim that the sequence hn := vn − un
(n ≥ 0) is a solution of (5). So
vn = un + hn, n ≥ 0.
9
In fact, since (un) and (vn) are solutions of (4), applying the recurrence relation
(4), we have
hn = [α1(n)vn−1 + α2(n)vn−2 + · · · + αk (n)vn−k + βn]
−[α1(n)un−1 + α2(n)un−2 + · · · + αk (n)un−k + βn]
= α1(n)(vn−1 − un−1) + α2(n)(vn−2 − un−2) + · · · + αk (n)(vn−k − un−k )
= α1(n)hn−1 + α2(n)hn−2 + · · · + αk (n)hn−k , n ≥ k.
This means that (hn) is a solution of (5). Conversely, for any solution (hn) of
(5), we have
un + hn = [α1(n)un−1 + α2(n)un−2 + · · · + αk (n)un−k + βn]
+[α1(n)hn−1 + α2(n)hn−2 + · · · + αk (n)hn−k ]
= α1(n)(un−1 + hn−1) + α2(n)(un−2 + hn−2)
+ · · · + αk (n)(un−k + hn−k ) + βn
for n ≥ k. This means that the sequence (un + hn) is a solution of (4).
10
We claim that Wk (m+1) = 0. It is enough to show that for the same coefficients
c1, c2, . . . , ck above, the linear relation
k
X
cj um+k,j = c1um+k,1 + c2ui,2 + · · · + ck um+k,k = 0
j=1
11
are linearly dependent because the columns are part of the sequences (un,1),
(un,2), . . ., (un,k ) respectively. It follows from linear algebra that the determinant
of the matrix is zero, i.e., the Wronskian Wk (n) = 0 for all n ≥ 0.
Conversely, if Wk (n) = 0 for all n ≥ 0, in particular, Wk (0) = 0, then there
are constants c1, c2, . . . , ck , not all zero, such that
k
X
cj ui,j = c1ui,1 + c2ui,2 + · · · + ck ui,k = 0, i = 0, 1, . . . , k − 1.
j=1
P
We claim that kj=1 cj un,j = 0 for all n by induction. Assume it is true for
n ≤ m − 1. Applying the recurrence relation (5) to the sequences (um,1), (um,2),
. . ., (um,k ), we have
k
X k
X k
X
cj um,j = cj αi(k)um−i,j
j=1 j=1 i=1
k
X k
X
= αi(k) cj um−i,j = 0.
i=1 j=1
This means that the sequences (un,1), (un,2), . . ., (un,k ) are linearly dependent.
14
Solution. The characteristic equation of the recurrence relation is
x3 − 2x2 − x + 2 = 0.
Factorizing the equation, we have
(x − 2)(x + 1)(x − 1) = 0.
There are three roots x = 1, −1, 2. By Theorem 3.1, we have the general solution
xn = c1(−1)n + c2 + c32n.
Applying the initial conditions,
c1 +c2 +c3 = 1
c −c2 +2c3 = 2
1
c1 +c2 +4c3 = 0
Solving the linear system we have c1 = 2, c2 = −2/3, c3 = −1/3. Thus
2 1
xn = 2 − (−1)n − 2n.
3 3
Theorem 3.2. (a) Let q be a root with multiplicity m of the characteristic
equation (9) associated with the kth order homogeneous linear recurrence
relation (8) with constant coefficients. Then the m sequences
xn = q n , nq n, ..., nm−1q n
are linearly independent solutions of the recurrence relation (8).
(b) Let q1, q2, . . . , qs be distinct nonzero roots with the multiplicities
m1 , m2 , ..., ms
respectively for the characteristic equation (9). Then the sequences
xn = q1n, nq1n, ..., nm1−1q1n;
q2n, nq2n, ..., nm2−1q2n;
... ... ...
qsn, nqsn, ..., nms−1qsn; n≥0
are linearly independent solutions of the homogeneous linear recurrence re-
lation (8). Their linear combinations form the general solution of the re-
currence relation (8).
15
Proof. The falling factorial polynomial of degree i is the polynomial
[t]i := t(t − 1) · · · (t − i + 1).
Let q be a root of the characteristic polynomial
P (t) = α0tk + α1tk−1 + · · · + αk−1t + αk = (t − q)mQ(t)
with multiplicity m. Then q is a root of the ith derivative P (i)(t) of P (t), where
0 ≤ i ≤ m−1. We claim that xn = [n]iq n is a solution of the recurrence relation
for each i = 0, 1, . . . , m − 1. In fact,
LHS of (8) = α0[n]iq n + α1[n − 1]iq n−1 + · · · + αk [n − k]iq n−k
¯
di ¯¯ i
¡ n n−1 n−k
¢
= q α t + α t + · · · + α t
dti ¯t=q
0 1 k
¯
i¯
i d ¯
¡ k k−1
¢ n−k
= q · i¯ α0t + α1t + · · · + αk−1t + αk t
dt t=q
¯
i¯
d
= q i · i ¯¯ (t − q)mR(t), where R(t) = Q(t)tn−k .
dt t=q
Applying the Leibniz rule,
i µ ¶µ j ¯
X ¶µ ¯ ¶
i i d ¯¯ d ¯¯
i−j
LHS of (8) = q (t − q)m R(t)
j dtj ¯
j=0 t=q dti−j ¯ t=q
i µ ¶ ¯ µ ¯ ¶
X i ¯ di−j ¯¯
= qi [m]j (t − q)m−j ¯¯ R(t) = 0.
j=0
j t=q dti−j ¯t=q
17
to the right, we obtain
s
X
cj,mωjn = ε(n) → 0 (n → ∞).
j=r
• If q 6= α, then xn = Aq n.
• If q = α, then xn = Anq n.
P
(b) Let βn = ki=0 bini be a polynomial function of n with degree k.
• If α 6= 1, then (14) has a particular solution of the form
x n = A 0 + A 1 n + A2 n 2 + · · · + A k n k ,
19
where the coefficients A0, A1, . . ., Ak are recursively determined as
bk
Ak = ,
1−α
Xk µ ¶
1 j
Ai = bi + α (−1)j−i Aj , 0 ≤ i ≤ k − 1.
1−α j=i+1
i
Then
k
X k
X j µ ¶
X k
X
j j i j−i
Aj n = α Aj n (−1) + bj n j .
j=0 j=0 i=0
i j=0
k
X k
X k
X µ ¶ Xk
j
Ai n i = α ni (−1)j−i Aj + bi n i .
i=0 i=0 j=i
i i=0
X k Xk µ ¶
Ai − bi − α j
(−1)j−i Aj ni = 0.
i=0 j=i
i
20
The coefficients A0, A1, . . . , Ak are determined recursively as
bk
Ak = ,
1−α
k
X µ ¶
1 j
Ai = bi + α (−1)j−i Aj , 0 ≤ i ≤ k − 1.
1−α j=i+1
i
21
Example 5.2. Solve the equation
½
xn = 3xn−1 − 4n, n ≥ 1
x0 = 2.
Solution. Note that xn = 3nc is the general solution of the corresponding
homogeneous linear recurrence relation. Let xn = An + B be a particular
solution. Then
An + B = 3[A(n − 1) + B] − 4n
Comparing the coefficients of n0 and n, it follows that A = 2 and B = 3. Thus
the general solution is given by
xn = 2n + 3 + 3nc.
The initial condition x0 = 2 implies that c = −1. Therefore the solution is
xn = −3n + 2n + 3.
Theorem 5.2. Given a nonhomogeneous linear recurrence relation of the
second order
xn = α1xn−1 + α2xn−2 + cq n. (15)
Let q1 and q2 be solutions of its characteristic equation
x2 − α1x − α2 = 0.
Then (15) has a particular solution of the following forms, where A is a
constant to be determined.
(a) If q 6= q1, q 6= q2, then xn = Aq n.
(b) If q = q1, q1 6= q2, then xn = Anq n.
(c) If q = q1 = q2, then xn = An2q n.
Proof. The homogeneous linear recurrence relation corresponding to (15) is
xn = α1xn−1 + α2xn−2, n ≥ 2. (16)
We may assume q 6= 0. Otherwise (15) is homogeneous.
22
(a) Put xn = Aq n into (15); we have
Aq n = α1Aq n−1 + α2Aq n−2 + cq n.
Then
A(q 2 − a1q − a2) = cq 2.
Since q is not a root of the characteristic equation x2 = α1x + α2, that is,
q 2 − α1q − α2 6= 0, the coefficient A is determined as
cq 2
A= 2 .
q − α1q − α2
(b) Since q = q1 6= q2, then xn = q n is a solution of (16) but xn = nq n is not,
that is,
q 2 − α1q − α2 = 0 and nq n 6= α1(n − 1)q n−1 + α2(n − 2)q n−2.
It follows that
nq 2 − α1(n − 1)q − α2(n − 2) = n(q 2 − α1q − α2) + α1q + 2α2
= α1q + 2α2 6= 0.
Put xn = Anq n into (15); we have
Anq n = α1A(n − 1)q n−1 + α2A(n − 2)q n−2 + cq n.
Then £ ¤
A nq 2 − α1(n − 1)q − α2(n − 2) = cq 2.
Since α1q + 2α2 6= 0, the coefficient A is determined as
cq 2
A= .
α1q + 2α2
(c) Since q = q1 = q2, then both xn = q n and xn = nq n are solutions of (16),
but xn = n2q n is not. It then follows that
q 2 − α1q − α2 = 0, α1q + 2α2 = 0, and
n2q 2 − α1(n − 1)2q − α2(n − 2)2 = n2(q 2 − α1q − α2) + 2n(α1q + 2α2) − α1q −
= −α1q − 4α2 6= 0.
23
Put xn = An2q n into (15); we have
£ ¤
Aq n−2 n2q 2 − α1(n − 1)2q − α2(n − 2)2 = cq n.
The coefficient A is determined as
cq 2
A=− .
α1q + 4α2
24
(a) If α1 + α2 6= 1, then (17) has a particular solution of the form
x n = A0 + A 1 n + · · · + Ak n k ,
where A0, A1, . . ., Ak are constants to be determined. If k ≤ 2, then a
particular solution has the form
x n = A0 + A1 n + A 2 n 2 .
25
Since α1 + α2 6= 1, the coefficients A0, A1, . . ., Ak are determined as
bk
Ak = ,
1 − α1 − α2
k
X µ ¶³ ´
1 bi + j
Ai = (−1)j−i
α1 + 2 α2 Aj ,
j−i
1 − α1 − α2 j=i+1
i
where 0 ≤ i ≤ k − 1.
(b) The recurrence relation (17) becomes
xn = α1xn−1 + (1 − α1)xn−2 + βn, n ≥ 2.
Set yn = xn − xn−1 for n ≥ 1; the recurrence (17) reduces to a first order
recurrence relation.
Example 5.4. Solve the following recurrence relation
xn = 6xn−1 − 9xn−2 + 8n2 − 24n
x = 5
0
x1 = 5.
Solution. Put xn = A0 + A1n + A2n2 into the recurrence relation; we obtain
A0+A1n+A2n2 = 6[A0+A1(n−1)+A2(n−1)2]−9[A0+A1(n−2)+A2(n−2)2]+8n2−
Collecting the coefficients of n2, n, and the constant, we have
(4A2 − 8)n2 + (4A1 − 24A2 + 24)n + (4A0 − 12A1 + 30A2) = 0.
We conclude that A2 = 2, A1 = 6, and A0 = 3. So xn = 2n2 + 6n + 3 is a
particular solution. Then the general solution of the recurrence is
xn = 2n2 + 6n + 3 + 3nc1 + 3nnc2.
Applying the initial condition x0 = x1 = 5, we have c1 = 2, c2 = −4. The
sequence is finally obtained as
xn = 2n2 + 6n + 3 + 2 × 3n − 4n × 3n.
26
6 Generating functions
27
Example 6.3. For any real number α, the generating function for the infinite
sequence of binomial coefficients
³α´ ³α´ ³α´ ³α´
, , , ..., , ...
0 1 2 n
is the function ∞ ³ ´
X α n
x = (1 + x)α .
n=0
n
Example 6.4. Let k be a positive integer and let
a0 , a 1 , a 2 , . . . , a n , . . .
be the infinite sequence whose general term an is the number of nonnegative
integral solutions of the equation
x1 + x2 + · · · + xk = n.
Then the generating function of the sequence (an) is
X∞ X X∞ X
A(x) =
1 x =n
xi1+···+ik
n=0 i1 +···+ik =n n=0 i1 +···+ik =n
∞
X ∞
X 1
= x i1
··· x ik =
i1 =0 ik =0
(1 − x)k
∞
X µ ¶ ∞ µ
X ¶
−k n+k−1
= (−1)n xn = xn .
n=0
n n=0
n
Example 6.5. Let an be the number of integral solutions of the equation
x1 + x2 + x3 + x4 = n,
where 0 ≤ x1 ≤ 3, 0 ≤ x2 ≤ 2, x3 ≥ 2, and 3 ≤ x4 ≤ 5. The generating
function of the sequence (an) is
¡ 2 3
¢¡ 2
¢¡ 2 3
¢¡ 3 4 5
¢
A(x) = 1 + x + x + x 1 + x + x x + x + · · · x + x + x
5
¡ 2 3
¢¡ ¢
2 2
x 1+x+x +x 1+x+x
= .
1−x
28
Example 6.6. Determine the generating function for the number of n-combinations
of apples, bananas, oranges, and pears where in each n-combination the num-
ber of apples is even, the number of bananas is odd, the number of oranges is
between 0 and 4, and the number of pears is at least two.
The required generating function is
Ã∞ !à ∞ !à 4 !à ∞ !
X X X X
2i 2i+1 i
A(x) = x x x xi
i=0 i=0 i=0 i=2
3 5
x (1 − x )
= .
(1 − x2)2(1 − x)2
Example 6.7. Determine the number an of bags with n pieces of fruit (apples,
bananas, oranges, and pears) such that the number of apples is even, the number
bananas is a multiple of 5, the number oranges is at most 4, and the number of
pears is either one or zero.
The generating function of the sequence (an) is
Ã∞ !à ∞ !à 4 !à 1 !
X X X X
A(x) = x2i x5i xi xi
i=0 i=0 i=0 i=0
(1 + x + x2 + x + x4)(1 + x)
3
=
(1 − x2)(1 − x5)
(1 + x)(1 − x5)/(1 − x)
=
(1 + x)(1 − x)(1 − x5)
X∞ µ ¶
1 n −2 n
= = (−1) x
(1 − x)2 n=0 n
X∞ µ ¶ X∞
n+1
= xn = (n + 1)xn.
n=0
n n=0
Thus an = n + 1.
Example 6.8. Find a formula for the number an,k of integer solutions (i1, i2, . . . , ik )
of the equation
x1 + x2 + · · · + xk = n
such that i1, i2, . . . , ik are nonnegative odd numbers.
29
The generating function of the sequence (an) is
̰ ! ̰ !
X X xk
A(x) = x2i+1 · · · x2i+1 =
i=0 i=0
(1 − x2)k
X∞ µ ¶ X∞ µ ¶
i + k − 1 i + k − 1
= xk x2i = x2i+k
i i
i=0 ³ i=0
P∞ j+r−1 ´ 2j
j=r j−r x for k = 2r
=
P∞ ³ j+r ´ 2j+1
j=r j−r x for k = 2r + 1.
¡ s+r−1 ¢ ¡ s+r ¢
We then conclude that a2s,2r = s−r , a2s+1,2r+1 = s−r , and an,k = 0
otherwise. We may combine the three cases into
³ n k ´
b 2 c+d 2 e−1 if n − k = even,
b n2 c−b k2 c
an,k =
0 if n − k = odd.
Example 6.9. Let an denote the number of nonnegative integral solutions of
the equation
2x1 + 3x2 + 4x3 + 5x4 = n.
Then the generating function of the sequence (an) is
X∞
X
A(x) = 1 xn
n=0 i,j,k,l≥0
2i+3j+4k+5l=0
Ã∞ ! ∞ Ã
∞
!Ã ∞ !
X X X X
2i 3j 4k
= x x x x5l
i=0 j=0 k=0 l=0
1
= .
(1 − x2)(1 − x3)(1 − x4)(1 − x5)
Theorem 6.1. Let sn be the number of nonnegative integral solutions of
the equation
a1x1 + a2x2 + · · · + ak xk = n.
30
Then the generating function of the sequence (sn) is
1
A(x) = .
(1 − xa1 )(1 − xa2 ) · · · (1 − xak )
Since
∞ µ
X ¶ ∞ µ
X ¶
1 −n k n + k − 1 k
= (−x) = x , |x| < 1;
(1 − x)n k k
k=0 k=0
then
∞ µ
X ¶ ∞ µ
X ¶
1 −n k n + k − 1 k k 1
= (−ax) = a x , |x| < .
(1 − ax)n k k |a|
k=0 k=0
31
P∞ n
Let A(x) = n=0 an x . Applying the recurrence relation, we have
∞
X
A(x) = a0 + a1x + (5an−1 − 6an−2) xn
n=2
= a0 + a1x − 5xa0 + 5xA(x) − 6x2A(x).
Applying the initial values and collecting the coefficient functions of A(x), we
further have ¡ ¢
2
1 − 5x + 6x A(x) = 1 − 7x.
Thus the function g(x) is solved as
1 − 7x
A(x) = .
1 − 5x + 6x2
Observing that 1 − 5x + 6x2 = (1 − 2x)(1 − 3x) and applying partial fraction,
1 − 7x A B
= + .
1 − 5x + 6x2 1 − 2x 1 − 3x
The constants A and B can be determined by
A(1 − 3x) + B(1 − 2x) = 1 − 7x.
Then ½
A +B = 1
−3A −2B = −7
Thus A = 5, B = −4. Hence
1 − 7x 5 4
A(x) = = − .
1 − 5x + 6x2 1 − 2x 1 − 3x
Since ∞ ∞
1 X 1 X
n n
= 2 x and = 3nxn
1 − 2x n=0 1 − 3x n=0
We obtain the sequence
an = 5 × 2n − 4 × 3n, n ≥ 0.
32
Theorem 7.1. Let (an; n ≥ 0) be a sequence satisfying the homogeneous
linear recurrence relation of order k with constant coefficients, i.e.,
an = α1an−1 + α2an−2 + · · · + αk an−k , (18)
P∞ n
where αk 6= 0, n ≥ k. Then its generating function A(x) = n=0 an x is a
rational function of the form
P (x)
A(x) = , (19)
Q(x)
where Q(x) is a polynomial of degree k with a nonzero constant term and
P (x) is a polynomial of degree strictly less than k.
Conversely, given such polynomials P (x) and Q(x), there exists a unique
sequence (an) satisfying the linear homogeneous recurrence relation (18),
and its generating function is the rational function in (19).
Proof. The generating function A(x) of the sequence (an) can be written as
k−1 ∞ k−1 ∞
à k !
X X X X X
A(x) = ai x i + an x n = ai x i + αian−i xn
i=0 n=k i=0 n=k i=1
k−1
X Xk ∞
X k−1
X k
X ∞
X
= ai x i + αi an−ixn = ai x i + αi anxn+i
i=0 i=1 n=k i=0 i=1 n=k−i
k−1
X ∞
X k−1
X ∞
X k−i−1
X
= aixi + αk xk anxn + αixi an x n − aj x j
i=0 n=0 i=1 n=0 j=0
k−1
X k
X k−1
X k−i−1
X
i i i
= aix + A(x) αix − αix aj x j
i=0 i=1 i=1 j=0
k
X k−1
X k−1
X l
X
i i l
= A(x) αix + ai x − x αial−i.
i=1 i=0 l=1 i=1
33
Then
à k
! k−1 k−1 l
X X X X
A(x) 1 − αixi = ai x i − xl αial−i
i=1 i=0 l=1 i=1
k−1
à i
!
X X
= a0 + al − αial−i xl .
l=1 i=1
Thus
k−1
à l
!
X X
P (x) = a0 + al − αial−i xl ,
l=1 i=1
k
X
Q(x) = 1 − αixi.
i=1
The polynomial Q(x) can be viewed as an infinite series with αi = 0 for i > k.
Thus à n !
X∞ X∞ X X k
n n
anx − αian−i x = bi x i .
n=0 n=0 i=1 i=0
n
Equating the coefficients of x , we have the recurrence relation
k
X
an = αian−i, n ≥ k.
i=1
34
Proposition 7.2 (Partial Fractions). (a) If P (x) is a polynomial of degree
less than k, then
P (x) A1 A2 Ak
= + + · · · + ,
(1 − ax)k 1 − ax (1 − ax)2 (1 − ax)k
where A1, A2, . . . , Ak are constants to be determined.
(b) If P (x) is a polynomial of degree less than p + q + r, then
P (x) A1(x) A2(x) A3(x)
= + + ,
(1 − ax)p(1 − bx)q (1 − cx)r (1 − ax)p (1 − bx)q (1 − cx)r
where A1(x), A2(x), and A3(x) are polynomials of degree q + r, p + r, and
p + q, respectively.
8 A geometry example
vn+2
vn+3 v3
v1 v2
Figure 1: vk+2 is the third vertex of the triangle with the side v1 vn+3
36
where
· µ ¶ µ ¶. ¸
1 1 1
an = (−1)n − 1 ··· −n+1 n! · 2n · 2n
2 2 2
(−1)(−3)(−5) · · · (−2 n − 1 + 1) n
= (−1)n · ·2
n!
1 · 3 · 5 · · · (2 n − 1 − 1) n
= − ·2
n!
(2(n − 1))!
= −2 · .
n!(n − 1)!
Then
∞
X
√ (2(n − 1))!
1 − 4x = 1 − 2 xn
n=1
n!(n − 1)!
X∞
(2n)!
= 1−2 xn+1.
n=0
n!(n + 1)!
We conclude that
√
1− 1 − 4x
F (x) =
2x
∞
X (2n)!
= xn
n=0
n!(n + 1)!
X∞ µ ¶
1 2n
= xn .
n=0
n+1 n
The ordinary generating function method is a powerful algebraic tool for finding
unknown sequences, especially when the sequences are certain binomial coeffi-
cients or the order is immaterial. However, when the sequences are not binomial
type or the order is material in defining the sequences, we may need to consider
a different type of generating functions. For example, the sequence an = n! is
the counting of the number of permutations of n distinct objects; its ordinary
generating function
X∞ X∞
n
an x = n!xn
n=0 n=0
cannot be easily figure out as a closed known expression. However, the generating
function ∞ ∞
X an n X n 1
x = x =
n=0
n! n=0
1−x
is obvious.
38
The exponential generating function of a sequence (an; n ≥ 0) is the
infinite series ∞
X an n
E(x) = x .
n=0
n!
Example 9.1. The exponential generating function of the sequence
P (n, 0), P (n, 1), . . . , P (n, n), 0, . . .
is given by
n
X P (n, k)
E(x) = xk
k!
k=0
n ³
X n´
= xk
k
k=0
= (1 + x)n.
Example 9.2. The exponential generating function of the constant sequence
(an = 1; n ≥ 0) is
X∞
xn
E(x) = = ex.
n=0
n!
The exponential generating function of the geometric sequence (an = an; n ≥ 0)
is ∞
X an x n
E(x) = = eax.
n=0
n!
Theorem 9.1. Let M = {n1α1, n2α2, . . . , nk αk } be a multiset over the set
S = {α1, α2, . . . , αk } with n1 many α1’s, n2 many α2’s, . . ., nk many αk ’s.
Let an be the number of n-permutations of the multiset M . Then the expo-
nential generating function of the sequence (an; n ≥ 0) is given by
Ãn !Ã n ! Ãn !
Xx1 i Xx 2 i Xxk i
E(x) = ··· . (20)
i=0
i! i=0
i! i=0
i!
39
Proof. Note that an = 0 for n > n1 + · · · + nk . Thus E(x) is a polynomial. The
right side of (20) can be expanded to the form
n1 ,n2 ,...,nk n1 +n2 +···+nk
X xi1+i2+···+ik X xn X n!
= .
i1 ,i2 ,...,ik
i !i
=0 1 2
! · · · i k ! n=0
n! i1 +i2 +···+ik =n
i1!i2! · · · ik !
0≤i1 ≤n1 ,...,0≤ik ≤nk
40
number of times. The exponential generating function of the sequence (an) is
Ã∞ !à ∞ !2
X x 2n Xx n
E(x) =
n=0
(2n)! n=0
n!
ex + e−x 2x 1 ¡ 3x ¢
= e = e + ex
Ã2∞ 2
∞
!
1 X n n
3 x X x n
= +
2 n=0 n! n=0
n!
∞
1X n xn
= (3 + 1) · .
2 n=0 n!
Thus the sequence is given by
3n + 1
an = , n ≥ 0.
2
Example 9.4. Determine the number an of n digit (under base 10) numbers
with each digit odd where the digit 1 and 3 occur an even number of times.
Assume a0 = 1. The number an equals the number of n-permutations of the
multiset M = {∞1, ∞3, ∞5, ∞7, ∞9}, in which 1 and 3 occur an even number
of times. The exponential generating function of the sequence an is
Ã∞ !2 à ∞ !3
X x2n X xn
E(x) =
n=0
(2n)! n=0
n!
µ x ¶2
e + e−x
= e3x
2
1 ¡ 5x ¢
= e + 2e3x + ex
4Ã !
∞ ∞ ∞
1 X5 x n n X3 x n n Xx n
= + +
4 n=0 n! n=0
n! n=0
n!
X ∞ µ n ¶
5 + 2 × 3n + 1 xn
= .
n=0
4 n!
Thus
5n + 2 × 3n + 1
an = , n ≥ 0.
4
41
Example 9.5. Determine the number of ways to color the squares of a 1-by-n
board with the colors, red, blue, and white, where the number of red squares is
even and there is at least one blue square.
The exponential generating function for the sequence is
Ã∞ !à ∞ !à ∞ !
X x2i X xi X xi
E(x) =
i=0
(2i)! i=0
i! i=1
i!
ex + e−x x x
= e (e − 1)
2
1 ¡ 3x ¢
= e − e2x + ex − 1
2
∞
1 X 3n − 2n + 1 xn
= − + ·
2 n=0 2 n!
Thus
3n − 2n + 1
an = , n≥1
2
and
a0 = 0.
10 Combinatorial interpretations
42
(c) The number of ways of placing n indistinguishable balls into m distin-
guishable boxes with at least sk balls in the kth box is the coefficient of
xn in the expression
Ym
sk
¡ 2
¢ xs1+···+sm
x 1 + x + x + ··· = .
(1 − x)m
k=1
44
There are 5 sub-multisets of M having cardinality 4.
45