Generating Functions: 2018 Prof. Yuh-Dauh Lyuu, National Taiwan University
Generating Functions: 2018 Prof. Yuh-Dauh Lyuu, National Taiwan University
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 464
Young men should prove theorems,
old men should write books.
— Godfrey Harold Hardy (1877–1947),
A Mathematician’s Apology (1940)
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 465
Generating Functions
• Let a0 , a1 , a2 , . . . be a sequence of real numbers.
• The function
∞
f (x) = a0 + a1 x + a2 x2 + · · · = ai xi
i=0
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 466
Convergence Issues
• We treat
f (x) = a0 + a1 x + a2 x2 + · · ·
as a formal power series.
• Convergence is not an issue unless
– We substitute a numerical value for x or
– a0 + a1 x + a2 x2 + · · · represents some function rather
than being an asymptotic series of some function.
• These issues will arise but will not lead to problems.a
a N.G.
de Bruijn (1958), Asymptotic Methods in Analysis; George E.
Andrews (1971), Number Theory.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 467
Examples
(1 + x)n is the generating function for sequence
n n n
, ,..., , 0, 0, . . . .
0 1 n
• Because
n
n n i
(1 + x) = x.
i=0
i
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 468
Examples (continued)
(1 − xn+1 )/(1 − x) is the generating function for the sequence
n+1
1, 1, . . . , 1, 0, 0, . . . .
• Because
(1 − xn+1 )/(1 − x) = 1 + x + x2 + · · · + xn .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 469
Examples (continued)
1/(1 − x) is the generating function for
1, 1, 1, . . . .
• Because
1/(1 − x) = 1 + x + x2 + x3 + · · · .
1, a, a2 , . . . .
• Because
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 470
Examples (continued)
−(1/x) ln(1 − x) is the generating function fora
1 1 1
1, , , , . . . .
2 3 4
• Because
1 2 1 3 1 4
− ln(1 − x) = x + x + x + x + · · · .
2 3 4
a Corrected by Mr. Tony Yun-Chih Chen (B03902074) on May 7, 2015.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 471
Examples (continued)
Lemma 65 If f (x) is the generating function for
a0 , a1 , a2 , . . . ,
a1 , 2a2 , 3a3 , . . . .
•
∞ ∞
d
f (x) = ai xi = iai xi−1 .
i=0
dx i=1
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 472
Examples (continued)
1/(1 − x)2 is the generating function for
1, 2, 3, 4, . . . .
1 × 1, 2 × 1, 3 × 1, . . . = 1, 2, 3, . . . ,
as desired.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 473
Examples (continued)
∞
Lemma 66 If f (x) = i=0 ai xi is the generating function
for
a0 , a1 , a2 , . . . ,
∞ i
then xf (x) = i=1 a i−1 x is the generating function for
0, a0 , a1 , a2 , . . . .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 474
Examples (continued)
(x + 1)/(1 − x)3 is the generating function for the square
numbers
12 , 22 , 32 , 42 , . . . .
• Because
x+1 d x
=
(1 − x)3 dx (1 − x)2
∞
d i
= ix from p. 473 and p. 474
dx i=1
∞
= i2 xi−1 .
i=1
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 475
Examples (continued)
Lemma 67 If f (x) is the generating function for
a0 , a1 , a2 , . . .
b0 , b1 , b2 , . . . ,
a0 + b 0 , a1 + b 1 , a2 + b 2 , . . . .
• This is because
∞
f (x) + g(x) = (ai + bi ) xi .
i=0
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 476
Examples (concluded)
As an application,
1 x+1
x +
(1 − x)2 (1 − x)3
is the generating function for the sequence
{ n + n2 }n=0,1,2,...
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 477
Binomial Coefficients Revisited (P. 31)
n n−1 n−1
= + .
r r r−1
n
n
• (1 + x) is the generating function for { r }r=0,1,...,n
(p. 468).
• (1 + x)n−1 is the generating function for
n−1
{ r }r=0,1,...,n−1 .
• x(1 + x)n−1 is the generating function for
n−1
n−1
n−1
0, 0 , 1 , . . . , n−1 .
• Finally, (1 + x)n = (1 + x)n−1 + x(1 + x)n−1 .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 478
From Generating Function to Sequence
∞ i
Lemma 68 Let f (x) = i=0 a i x be the generating function
for { ai }i=0,1,... . Then
1 d f (x)
i
ai = i , i = 0, 1, 2, . . . .
i! dx x=0
• By the Taylor expansion.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 479
Convolution and Generating Functions
• Let f (x) = ∞ i
i=0 ai x be the generating function for
a0 , a1 , a2 , . . . .
∞
• Let g(x) = i=0 bi xi be the generating function for
b0 , b1 , b2 , . . . .
• Then f (x) g(x) is the generating function for
h0 , h1 , h2 , . . ., where
i
hi = ak bi−k (61)
k=0
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 480
Augustin Louis Cauchy (1789–1857)
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 481
An Example
• Let f (x) = a0 + a1 x + a2 x2 and g(x) = b0 + b1 x + b2 x2 .
• Then
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 482
2n
n n
2
Identity n
= k=0 k
for n ∈ Z+ (P. 61)
2n
2n 2n
(1 + x)2n = xi = · · · + xn + · · · ,
i=0
i n
n 2
2
n
[ (1 + x)n ] = xi
i=0
i
2n
i
n n
= xi
i=0 k=0
k i−k
n
n n
= ···+ xn + · · ·
k n−k
k=0
n 2
n
= ···+ xn + · · · .
k
k=0
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 483
Vandermonde’s Convolution Revisited (P. 49)
n
r+s r s
= , n ∈ N. (62)
n k n−k
k=0
r
r
k
• (1 + x) = k≥0 k x .
s
s
k
• (1 + x) = k≥0 k x .
n r s
• (1 + x)r (1 + x)s = n≥0 k=0 k n−k xn .
r s r+s
r+s
n
• But (1 + x) (1 + x) = (1 + x) = n≥0 n x .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 484
Reciprocal of a Generating Function
∞
Theorem 69 Every generating function f (x) = i=0 ai xi
with a0 = 0 has a unique generating function g(x) such that
f (x) g(x) = 1.
• Let
∞
Δ
g(x) = bi xi ,
i=0
∞
Δ
h(x) = f (x) g(x) = hi xi .
i=0
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 485
The Proof (concluded)
• By Eq. (61) on p. 480,
i
hi = ak bi−k .
k=0
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 486
The Summation Operator
∞
• Let f (x) = i=0 ai xi be the generating function for
a0 , a1 , a2 , . . . .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 487
1 + 2 + · · · + n = n(n + 1)/2 Revisited (p. 37)
2
∞
• We have g(x) = x/(1 − x) = i=1 ixi (p. 475).
• By the summation operator, f (x) = x/(1 − x)3 is the
generating function for { 0 + 1 + 2 + · · · + i }i=0,1,2,... .
∞
• g (x) = 1/(1 − x) + (2x)/(1 − x) = i=1 ixi−1 + 2f (x)
2 3
∞
as 1/(1 − x) = i=1 ixi−1 (p. 473).
2
∞ 2 i−1
• Alternatively, g (x) = i=1 i x .
• Combine the above two equations to obtain
∞ ∞
∞
i(i + 1) i
2 i−1 i−1
f (x) = i x − ix /2 = x.
i=1 i=1 i=0
2
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 488
Generalized Binomial Coefficients
• For n ∈ R, define
n Δ n(n − 1) · · · (n − i + 1)
= , (63)
i i!
where i ∈ Z+ .
• For n ∈ R+ ,
−n (−n)(−n − 1) · · · (−n − i + 1)
=
i i!
n+i−1
= (−1)i . (64)
i
n
• The convention is that 0 = 1.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 489
Generalized Binomial Coefficients (concluded)
• In particular, by Eq. (64) on p. 489,
−1 1 + i − 1
= (−1)i = (−1)i , (65)
i i
−2 i 2+i−1
= (−1) = (−1)i (i + 1). (66)
i i
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 490
n
The Generating Function for { i }i=0,1,2,...
For n ∈ R, the Maclaurin series expansion for (1 + x)n is
(n)(n − 1) 2
(1 + x)n = 1 + nx + x
2!
n(n − 1)(n − 2) 3
+ x + ···
3!
∞
n i
= x, (67)
i=0
i
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 491
−n
The Generating Function for { i }i=0,1,2,...
For n ∈ R+ , the Maclaurin series expansion for (1 + x)−n is
−n (−n)(−n − 1) 2
(1 + x) = 1 + (−n) x + x
2!
(−n)(−n − 1)(−n − 2) 3
+ x + ···
3!
∞
n+i−1 i
= (−1)i x (68)
i=0
i
∞
−n i
= x, (69)
i=0
i
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 492
n+i−1
The Generating Function for { i }i=0,1,2,...
For n ∈ Z+ ,
∞
n+i−1
(1 − x)−n = (−1)i (−x)i
i=0
i
∞
n+i−1 i
= x (70)
i=0
i
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 493
The Generating Function for {(−1)i (i + 1)}i=0,1,2,...
• (1 + x)−2 = 1/(1 + x)2 is the generating function for
−2
{ i }i=0,1,2,... by Eq. (69) on p. 492.
• But by Eq. (66) on p. 490,
−2
= (−1)i (i + 1).
i
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 494
The Proof (continued)
• The convolutiona of {(−1)i }i=0,1,2,... and
{(−1)i }i=0,1,2,... is
i
i
(−1)k (−1)i−k = (−1)i = (−1)i (i + 1).
k=0 k=0
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 495
The Proof (concluded)
• By Eq. (65) on p. 490, The generating function for
i
(−1) i=0,1,2,... is
1
.
1+x
• So 1/(1 + x)2 is the generating function for our sequence.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 496
Integer Solutions of a Linear Equation Revisited (P. 85)
n+r−1
There are r integer solutions to
x1 + x2 + · · · + xn = r, xi ≥ 0.
• Note that
f (x) = (x0 + x1 + x2 + · · · + xr )n
= xx1 +x2 +···+xn .
0≤x1 ,x2 ,...,xn ≤r
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 497
The Proof (continued)
• For example, for n = 4 and r = 3,
(x0 + x1 + · · · )(x0 + x1 + x2 + · · · )( x0 + · · · )( x0 + · · · )
= · · · + x3 + · · · .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 498
The Proof (continued)
• Now,
n
1 − xr+1
f (x) =
1−x
= (1 − xr+1 )n (1 − x)−n
r
n + i − 1
= (1 − xr+1 )n xi by Eq. (70) on p. 493
i=0
i
r
n + i − 1
= xi + xr+1 (· · · ).
i=0
i
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 499
The Proof (concluded)
• The coefficient of xr is
n+r−1
,
r
as desired.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 500
An Example
14
• There are 10 = 1001 nonnegative integer solutions to
x1 + x2 + x3 + x4 + x5 = 10.
• Now,
(1 − x11 )5 (1 − x)−5
= 1 + 5x + 15x2 + 35x3 + 70x4 + 126x5 + 210x6
+330x7 + 495x8 + 715x9 + 1001x10 + · · · .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 501
A Simplified Proof
• For each variable xi , the exponents of the series
1 + x + x2 + · · · represents the possible values for that
variable: 0, 1, 2, . . . .
• The desired number is the coefficient of xr in
(1 + x + x2 + · · · )n .
• Now,
∞
n+i−1
(1 + x + x2 + · · · )n = (1 − x)−n = xi
i=0
i
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 502
Integer Solutions of a Linear Equation with Upper Bounds
Revisited (P. 445)
• The number of integer solutions of
x1 + x2 + · · · + xn = r,
(1 + x + x2 + · · · + xb−1 )n .
(x0 + x1 + x2 )(x0 + x1 + x2 )( x0 + x1 + x2 )
= · · · + x3 + · · · .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 503
An Example
• What is the number of positive integers x, where
x ≤ 999, whose sum of the digits equals 20?
• As
(1 + x + x2 + · · · + x9 )3
= (· · · ) + 36x20 + (· · · ),
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 504
Compositions of Positive Integers Revisited (P. 102)
• A composition for m is a sum of positive integers whose
order is relevant and which sum to m.
• Next we use the generating function to reprove the fact
that the number of compositions for m is 2m−1 .
• First, x/(1 − x) = x + x2 + x3 + · · · .
• A summand in a composition can be 1 or 2 or 3 or . . ..
• So the coefficient of xm in [ x/(1 − x) ]i is the number of
compositions with i summands for m.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 505
Compositions of Positive Integers Revisited
(continued)
• The generating function for the number of compositions
is therefore
∞ i
x
.
i=1
1−x
• Now,
∞ i ∞ i
x x x
=
i=1
1−x 1 − x i=0 1−x
x 1
= x
1 − x 1 − 1−x
x
= .
1 − 2x
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 506
Compositions of Positive Integers Revisited
(concluded)
• Observe that
x 2
= x 1 + (2x) + (2x) + · · ·
1 − 2x
= x + 2x2 + 22 x3 + · · ·
∞
= 2i−1 xi .
i=1
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 507
Partition of Integers
• We ask for the number of partitions of m ∈ Z+ into
positive integers where the order of summands is
irrelevant.
– Let p(m) denote the number of partitions of m.
– The number of partitions of m = 3 is p(3) = 3 as
3, 2 + 1, 1 + 1 + 1.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 508
Partition of Integers (concluded)
• The desired number p(m) is the coefficient of xm in
(1 + x + x2 + · · · )(1 + x2 + x4 + · · · )
(1 + x3 + x6 + · · · ) · · · (1 + xm + x2m + · · · )
1 1 1 1
= · · · . (71)
1−x 1−x 1−x2 3 1−x m
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 509
An Example
• Note that
1
(1 − x)(1 − x2 )(1 − x3 )(1 − x4 )(1 − x5 )
= 1 + x + 2x2 + 3x3 + 5x4 + 7x5 + · · · .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 510
Comments on Calculation
• In Eq. (71) on p. 509, we were asked to calculate the
coefficient of xn of
1 1 1 1
··· .
1 − x 1 − x2 1 − x3 1 − xn
• But it is a product of infinite power series!
• The trick is to calculate only
[ 1 + x + x2 + · · · + xn ]
[ 1 + x2 + x4 + · · · + x2n/2 ]
[ 1 + x3 + x6 + · · · + x3n/3 ]
· · · [ 1 + xn ].
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 511
Application: Number of Groupings
• How many ways are there for m identical objects to
form groups?a
• Well, it is the same as the number of partitions of m
into positive integers, i.e., p(m) (p. 508).
– Each partition of m, say
m = m1 + m2 + · · · ,
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 512
Weighted Integer Solutions of a Linear Equation
• What is the number of integer solutions to
where xi ≥ 0?
• For example, the number of solutions for n = 5 is 7:
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 513
Weighted Integer Solutions of a Linear Equation
(concluded)
• This problem is the partition-of-integers problem in
disguise.
– Every solution (x1 , x2 , . . . , xn ) implies a partition of
n in which there are xi i’s, and vice versa.
• The desired number is again p(n), the coefficient of xn in
1 1 1 1
···
1 − x 1 − x2 1 − x3 1 − xn
from Eq. (71) on p. 509.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 514
No Summands Appear More Than Twice
• What is the number of partitions of m ∈ Z+ into positive
integers where no summands appear more than twice?
• The desired number is the coefficient of xm in
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 515
Partition of Integers into Distinct Summandsa
• We ask for the number of partitions of m ∈ Z+ into
distinct positive integers.
– Let p# (m) denote the number of such partitions of
m.
– The number of such partitions of m = 3 is p# (3) = 2:
3, 2 + 1.
• The desired number p# (m) is the coefficient of xm in
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 516
Partition of Integers into Distinct Summands
(concluded)
• There are no known closed-form formulas for p# (m).
• Can we compute p# (m) in o(m3 ) steps?a
• What is a good upper bound on p# (m)?b
• How fast can we compute all the actual solutions?
a Inthe word model.
b Thanks to a lively discussion on November 29, 2004.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 517
An Example
• Note that
2 3 4 5 6
(1 + x) 1 + x 1+x 1+x 1+x 1+x
= 1 + x + x2 + 2x3 + 2x4 + 3x5 + 4x6 + · · · .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 518
Partition of Integers into Odd Summandsa
• What is the number of partitions of m ∈ Z+ into odd
positive integers?
– The number of such partitions of m = 3 is 2: 3,
1 + 1 + 1.
• The desired number is the coefficient of xm in
2 3 6 5 10
1 + x + x + ··· 1 + x + x + ··· 1+x +x + ··· ··· .
a Euler (1748).
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 519
The Proof (concluded)
• But,
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 520
Partition of Integers into Even Summands
• How about the number of partitions of m ∈ Z+ into
even positive integers?
• The desired number is the coefficient of xm in
1 + x2 + x4 + · · ·
1 + x4 + x8 + · · ·
6 12 2m/2 4m/2
1 + x + x + ··· ··· 1 + x +x + ··· .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 521
Partition of Integers into Even Numbers of Each Summand
• We ask for the number of partitions of m ∈ Z+ into
positive integer summands.
• Furthermore, each summand appears an even number of
times.
• The desired number remains the coefficient of xm in
2 4 4 8
1 + x + x + ···1 + x + x + ···
6 12 2m/2 4m/2
1 + x + x + ··· ··· 1 + x +x + ··· .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 522
Partition of Integers into Distinct Summands with
Upper Bounds
• We ask for the number of partitions of m ∈ Z+ into
distinct positive integers at most n.
• The desired number is the coefficient of xm in
2
(1 + x) 1 + x 1 + x · · · (1 + xn )
3
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 523
An Example
• Note that
2 3 4 5 6
(1 + x) 1 + x 1+x 1+x 1+x 1+x
= 1 + x + x2 + 2x3 + 2x4 + 3x5 + 4x6 + 4x7 + · · · + x21 .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 524
Partition of Integers into Positive Summands
≡ 0 mod k
• The desired number is the coefficient of xm in
2
2 4
1+ x+ x + ··· 1+ x + x + ··· ···
1 + xk−1 + x2(k−1) + · · ·
1 + xk+1 + x2(k+1) + · · · · · · .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 525
The Proof (continued)
• Now, the desired number is the coefficient of xm in
1 1 1 1
· · · ···
1 − x 1 − x2 1 − xk−1 1 − xk+1
∞ ik
i=1 (1 − x )
= ∞ i
i=1 (1 − x )
∞
1 − xik
=
i=1
1 − xi
∞
i 2i (k−1)i
= 1 + x + x + ··· + x
i=1
2 k−1 2 4 2(k−1)
= 1 + x + x + ··· + x 1 + x + x + ··· + x ··· .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 526
The Proof (concluded)
• The count is the same as that of partitions into positive
integers where every summand appears ≤ k − 1 times.
• This generalizes results on p. 515 and p. 519.a
• With k = 2, we have an alternative proof of Euler’s
theorem (p. 520).b
a An alternative proof uses the principle of inclusion and exclusion.
b Observation by Mr. Ansel Lin (B93902003) on November 29, 2004.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 527
Partition of Integers vs. Integer Solution of Linear Equations
• These two issues are often related in subtle ways.
• To wit, what is the number of partitions of m ∈ N+ into
n nonnegative integers where the order of summands is
relevant?a
• Each nonnegative integer solution of
x1 + x2 + · · · + xn = m
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 528
Partition of Integers as Linear Equations
• What is the number of integer solutions of
x1 + x2 + · · · + xn = n,
where 0 ≤ x1 ≤ x2 ≤ · · · ≤ xn ?
• A solution corresponds to a partition of n into positive
integers (the order of summands is irrelevanta ).
– (0, 0, 0, 1, 2, 3) ⇐⇒ 6 = 1 + 2 + 3.
a Because of the constraints 0 ≤ x1 ≤ x2 ≤ · · · ≤ xn .
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 529
Partition of Integers as Linear Equations (continued)
• From Eq (71) on p. 509, the number equals the
coefficient p(n) of xn in
1
2 n
.
(1 − x)(1 − x ) · · · (1 − x )
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 530
Partition of Integers as Linear Equations (continued)
• In general, what is the number of integer solutions of
x1 + x2 + · · · + xn = m, (74)
where 0 ≤ x1 ≤ x2 ≤ · · · ≤ xn ?
• Each solution corresponds to a partition of integer m
into n nonnegative integers (equivalently, at most n
positive integers)!a
a Professor Andrews, private communications, October 2001.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 531
Partition of Integers as Linear Equations (continued)
• For example, with m = 6 and n = 5,
(0, 0, 1, 2, 3) ⇐⇒ 6 = 1 + 2 + 3.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 532
The Ferrers Graph
9=4+4+1
x1 x2 x3 x4 x5 x6
9=0+0+2+2+2+3
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 533
Partition of Integers as Linear Equations (continued)
• For instance,
1 2 3 4 5
= 1 + x + 2x + 3x + 4x + 5x
(1 − x)(1 − x2 )(1 − x3 )
+ 7x6 + 8x7 + 10x8 + 12x9 + 14x10 + 16x11 + 19x12 + · · · .
0 + 0 + 6, 0 + 1 + 5,
0 + 2 + 4, 0 + 3 + 3,
1 + 1 + 4, 1 + 2 + 3, 2 + 2 + 2.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 534
Partition of Integers as Linear Equations (continued)
• What is the number of integer solutions to
where xi ≥ 0?a
• Well, it is the same partition-of-integers problem
considered at Eq. (74) on p. 531.
– As on p. 514, each solution corresponds to a partition
m into x1 1s, x2 2s, etc.
a See p. 513 when n = m.
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 535
Partition of Integers as Linear Equations (continued)
• The desired number is therefore the coefficient of xm in
1 1 1 1
··· (77)
1−x 1−x 1−x
2 3 1−x n
(recall p. 532).
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 536
Partition of Integers as Linear Equations (concluded)
• Furthermore, p(m) = pn (m) for all n > m.
– Recall that p(m) is the number of partitions of m
(p. 508).
– Recall that pn (m) equals the number of partitions of
m into positive summands at most n (p. 536).
c
2018 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 537