You are on page 1of 100

-

M&Brooks/Cole
of Wadsworth.

,A Division

.\dvmced
lnc.

B?pks &z?oi!yare

1~ 19x6 by Wadsworth.
lnc,. Belmont. California
94002. All rights reserved. No art of this
rm or by an>
book may be reproduced.
stored in a retrieval system. or transcribed,
in any f@!
means
-electronic.
mechanical.
photocopying.
recording,
or otherwise-without
the
prier wrltten permission
of the publisher,
Wadsworth
& BrooksXole
Advanced
Books
S Software. Monterey,
California 93940. a division of Wadsworth.
Inc.
Printed

in the Llnited

States of America

10 9 s 7 6 5 4 3 2
Library or Congrcss

---7

Stanley. Richard
Enumeratlve

Catalogiog-in-Publication

Data

P.. [date]
combinatorics

lncludes lndcxes.
1, Comb~natorial
QA 164.8.S73
19S6
ISElN 0-5~~-0bS~h-5

enumeration
51 l.62
(y. 1)

problems.
86-14

1. Title.

It is regrettable that a book, once published and on the way to starting a IXe of
its own, cari no longer bear witness to the painful choices that the author had to
face in the course of bis writing. There are choices that confront the writer of
every book: who is the intended audience? who is to be proved wrong? who will
be the most likely critic? Most of us bave indulged in the idle practice of drafting
tables of contents of books we know will never sec the light of day. In some
countries, some such particularly imaginative drafts bave actually been sent to
press (though they may not be included among the authors list of publications).
In mathcmatics. however, the burden ofchoice faced by the writer is SOheavy
as to turn off a11but the most courageous. And of a11 mathematics. combinatorics
is nowadays perhaps the hardest to Write on, despite an eager audience that cuts
across the party lines. Shall an isolated special result be granted a section of its
own? Shall a fledgling new theory with as yet sparse applications
be gingerly
thrust in the middle of a chapter? Shall the author yield to one of the contrary
temptations of recreational math at one end, and categorical rigor at the other?
or to the highly rewarding lure of the algorithm?
Richard Stanley has corne through these hurdles with flying colors. It has
been said that combinatorics
has too many theorems, matched with very few
theories; Stanleys book belies this assertion. Together with a sage choice of the
most attractive theories on todays stage, he blends a variety of examples democratically chosen from topology to computer science, from algebra to complex
variables. The reader will never be at a loss for an illustrative example, or for a
proof that fails to meet G. H. Hardy3 criterion of pleasant surprise.
His choice of exercises will at last enable us to give a satisfying reference to
the colleague who knocks at our door with his combinatorial
problem. %ut best
ofall, Stanley has succeeded in dramatizing the subject, in a book that will engage
from start to finish the attention of any mathematician
who will open it at page
one.
Gian-Carlo Rota
V

areas, this situation arises quite frequently. As a result, 1 have made a special
effort in this book to include coverage of topics from enumerative combinatorics
that arise in other branches of mathematics.
The exercises found at the end of each chapter play a vital role in achieving
The#%!=
exere&e!s (!%+y;with dif#%X&~ r&ings
of 1 - to 3 -) may be attempted by students using this book as a text; the more
difficult exercises are not really meant to be solved (though some readers will
undoubtedly
be unable to resist a real challenge), but rather serve as an entry
into areas that are not directly covered by the text. 1 hope that these more difficult
exercises will convince the reader of the depth and the wide applicability
of
enumerative combinatorics,
especially in Chapter 3, where it is by no means L
priori evident that partially ordered sets are more than a convenient bookkeeping
device. Solutions or references to solutions are provided for almost a11 of the
exercises.
The method of citation and referencing is, 1 hope, largely self-explanatory.
Al1 citations to references in another chapter are preceded by the relevant chapter
number. For instance, [3.16] refers to reference 16 in Chapter 3. 1 have included
no references to outside literature within the text itself; a11such references appear
in the Notes at the end of each chapter. Each chapter bas its own list of references.
while the references relevant to an exercise are given separately in the solution
to that exercise.
Many people have contributed
in many ways to the writing of this book.
Special mention must go to G.-C. Rota for introducing me to the pleasures of
enumerative combinatorics and for his constant encouragement
and stimulation.
1 must also mention Donald Knuth, whose superb texts on computer science
inspired me to include a wide range of solved exercises with a difficulty level
prescribed in advance. The following people have contributed valuable suggestions and encouragement,
and 1 thank them: Ed Bender, Lou Bil]era, Anders
Bjorner, Thomas Brylawski, Persi Diaconis, Dominique Foata, Adriano Garsia,
Ira Gesse], Jay Goldman, Curtis Greene, Victor Klee, Pierre Leroux, and Ronald
C. Mullin. In addition, the names of many whose ideas 1 have borrowed are
mentioned in the Notes and Exercises. 1 am grateful to a number of typists for
their lne preparation
of the manuscript, including Ruby Aguirre, Louise Balzarini, Margaret Beucler, Benito Rakower, and Phyllis Ruby. Finally, thanks to
John Kimmel of Wadsworth & Brooks/Cole Advanced Books & Software for
his support and encouragement
throughout the preparation of this book, and to
Phyllis Larimore for her careful editing.
For lnancial support during the writing of this book 1 wish to thank the
Massachusetts
Institute of Technology, the National Science Foundation,
and
the Guggenheim Foundation.
Richard Stanley

Contents

Votatiou

Chupter

What 1s Enumerative Combinatorics?

1.1

How to Count

1.2

Sets and Multisets

1.3

Permutation

1.4

The Twelvefold

Statistics
Way

Notes
References
A Note about the Exercises
Exercises
Solutions

Chapter

to Exercises

Sieve Methods

2.1

Inclusion-Exclusion

2.2

Examples

2.3

Permutations

2.4

Ferrers Boards

2.5

F-partitions

2.6

Involutions

2.1

Determinants

and Special Cases


with Restricted

and Unimodal

Notes
References
Exercises
Solutions

to Exercises

Positions

Sequences

C/zq~

Partially Ordered Sets

96

3.1

Basic Concepts

96

3.2

New Posets from Old

100

Notation

v
Distributive

3.5

Chains in Distributive

3.6

The Incidence

3.7

The Mobius Inversion

3.8

Techniques

3.9

Lattices and Their Mobius

Lattices

110

Lattices

Algebra of a Locally Finite Poset

113
116

Formula

for Computing

Mobius Functions

117

Algebras

124
126

complex numbers

Zeta Polynomials

129

nonnegative

3.12

Rank-selection

131

positive integers

3.13

3.10

The Mobius

3.11

Function

of a Semimodular

Lattice

integers

R-labelings

133

rational

3.14

Eulerian

135

real numbers

3.15

Binomial

Functions

140

integers

3.16

An Application

Enumeration

147

the set { 1,2,. . . ,rz), for 11E N (SO 10] = @)

Notes

149

for integers i 5 j, the set {i. j + 1.. . .j:

References

152

greatest integer

Exercises

153

least integer

174

a11used for the number of elements of the lnite set X

Posets
Posets and Generating

Solutions

Chapter 4

to Permutation

to Exercises

Rational Generating Functions

202

4.1

Rational

202

4.2

Further

4.3

Polynomials

208

4.4

Quasi-polynomials

210

4.5

P-partitions

211

4.6

Linear Homogeneous

4.1

Appendix

Power Series in One Variable


Ramilcations

The Transfer-matrix

204

Diophantine
Method

Equations

221
241

Notes

260

References

263

Exercises

264

theset

numbers

{ui,...,

the Kronecker

5 Y

>x
Ut} c R, where a1 < ... < Ut
delta, equal to 1 if i = j and 0 otherwise

equals by delnition
image of the function

kernel of the homomorphism

or linear transformation

trace of the linear transformation

the lnite leld (unique up to isomorphism)

with

q elements

direct sum of the vector spaces (or modules, rings, etc.) F


ring of polynomials in the indeterminate
in the integral domain R

x with coeflcients

ring of rational functions in x with coefficients in R (R(x) is


the quotient leld of R[x] when R is a field)

to Exercises

275

ring of forma1 power series In>0 U~Xin x with coefficients


u,, in R

Graph Theory Terminology

293

ring of forma1 Laurent series 1 k q~ uY, for some ne E Z, in


x with coefficients un in R (R((x)) is the quotient leld of
R [[x]] when R is a field)

Solutions

Index

105

3.4

296

xi

CHAPTER

W_tie
Combinatorics?

1.1

How to Count
The basic problem of enumerative combinatorics
is that of counting the number
of elements of a finite set. Usually we are given an infinite class of Inite sets Si
where i ranges over some index set 1 (such as the nonnegative integers N). and
we wish to Count the number j(i) of elements of each Si simultaneously.*
Immediate philosophical
diflculties arise. What does it mean to Count the
number of elements of Si?There is no delnitive answer to this question. Only
through experience does one develop an idea of what is meant by a determination of a counting function j-(i). The counting function j(i) cari be given
in several standard ways:
1. The most satisfactory form of j(i) is a completely explicit closed formula
involving only well-known functions, and free from summation symbols. Only
in rare cases will such a formula exist. As formulas for j-(i) become more
complicated, our willingness to accept them as determinations
of j(i) decreases.
Consider the following examples.
1.1.1 Example.
For each n E N, let j(n) be the number of subsets of the set
[n-j = {1,2,..., n}. Then j(n) = 2, and no one will quarrel about this being a
satisfactory formula for j(n).
1.1.2 Example.
Suppose n men give their n hats to a hat-check person. Let j(n)
be the number of ways that the bats cari be given back to the men, each man
receiving one bat, SO that no man receives his own hat. For instance, j(l) = 0,
f(2) = 1, j(3) = 2. We will see in Chapter 2 that
j-(n) =

n!i~f(-l)i/i!.

This formula for j(n) is not as elegant as the formula in Example 1.1.1, but for
lack of a simpler answer we are willing to accept (1) as a satisfactory formula. In
1

CtYJpter1

What

1s Enumerati\e

Combinatorics?

1.1

fact. once the derivation of (1) is understood (using the Principle of Inclusion
Exclusion), every term of (1) bas an easily understood combinatorial
meaning.
This enables us to understand (1) intuitively, SO our willingness to accept it is
enhanced. We also remark~tmat~ it follows easily from (Il that J(H) is_thee
intcger to n!/e. Ths s certamy a simple explicit formula. but it bas the disadvantage of being *non-combinatorial;
that is, dividing by e and rounding off
to the nearest integer bas no direct combinatorial
significance.
1.1.3 Example.
Let ,Jrr) be the number of 11x rz matrices M of zeros and ones
such that every row and column of M bas three ones. For example, J(O) = _Q1) =
j(2) = 0, ,f(3) = 1. The most explicit formula known at present for f(n) is

How to Count

4. Thc most useful but most diflcult to understand method for cvaluating
J(i) is to give its ~~~~~~~~~ri~~~~,~~~~~~~j~~.
We will not dcvelop in this chapter a rigorous
abstract theory of generating functions, but will instead content ourselves with
an abject that represents a counting function j(i). Usually this abject is a $NY~~LZ/
seritx
The two most common types of generating functions are orditwyy~
generatit~~g /imrious
and uponentiui
genetxting
,fiuwtions.
If 1 = ,Y%.then the
ordinary gencrating function of J()r) is the forma1 power series
puver

while the exponential

where the sum is over a11(11+ 2)(/1 + l),? solutions to 2 + /1 + ;J = jr in nonnegative intcgers. This formula givcs very little insight into the behavior of J(ti).
but it does allow one to compute ,f(t~) much fastcr than if only the combinatorial
delnition of j(tr) were used. Hence with some reluctance we accept (2) as a
determination
of f(fr). Of course if someone were later to prove ~(II) =
~I(N- I)()l - 2)/6 (rather unlikely), then our enthusiasm for (2) would be considerably diminished.
1.1.4 Exampie.
There are actually formulas in the literature (nameless here
for evermore) for certain counting functions ~(II) whose evaluation rcquire
listing a11 (or aimost ah) of thc f(tz) abjects being counted! Such a formula. is
completeiy worthless.
2. A rccurrence for j(i) may be given in terms of previously calculated.f( j)+s,
thereby giving a simple procedure for calculating f(i) for any desired i E I. For
instance, let ,f(n) be the number of subsets of [n] that do not contain two
consecutive integers. For example, for n = 4 we have the subsets @, { 1 ), {2), {3;.
[4;., $31,
{1,4J, {2,41, SO f(4)=
8. It is easily seen that J(a) = f(n - 1) +
,f(n - 2) for n 2 2. This makes it trivial, for example, to compute f(20). On the
other hand, it cari be shown that

where T = *(l + fi), T = i(l - 3).


This is an explicit answer, but because it
involves irrational numbers it is a matter of opinion whether it is a better answer
than the recurrence f(n) = _/(a - 1) + _/(n - 2).
3. An estimate may be given for f(i). If 1 = IV, this estimate frequently takes
the form of an us~~m~r&cfirrrz~/u~(~) - g(n), where g(n) is a familiar function.
The notation f(n) - g(n) means that lim_ f(n)/g(n) = 1. For instance, let f(n)
be the function of Example 1.1.3. It cari be shown that
Rr) - e -z36-n(3n)!.
For many purposes

this estimate is superior

to the explicit formula (2).

generating

function of J(ri) is the formai powcr stries

(If 1 = p. thc positive integers, thcn these sums begin at 11= 1.) These power
series are callcd formai* because we are not concerned with lctting Y takc
on particular valtics. and we ignore questions of convergence and divergence.
The term _Yor .Y ti! merely marks the place where ~(II) is written. If F(_~I =
x,,>,, o,,.Y. we cal1 u,, the cwjficimt
of _Yin F(.Y) and Write

Similarly

ke cari deal Lvith gcnerating

functions

of scveral variables.

such as

(which may be considered as ordinary in the indices 1. jrr and exponential in


n), or even of infinitely many variables. In this latter case every term should
involve only lnitely many of the variables.
Why bother with generating functions if they are merely another way of
writing a counting function? The answer is that we cari perform various natural
operations on generating functions that have a combinatorial
signifcance. For
instance, we cari add two generating functions (in one variable) by the rule

Similarly, we cari multiply generating

where Ci = xy=,, uibn_i>or

functions

according

to the rule

1.1

,
,

where & = L;E0 (y)~$,,-~, with (y) = ~!/tt!(tz - i)!. Note that these operations are
just what we would obtain by treating generating functions as if they obeyed the
ordinary laws of algebra, such as _xixj = xi+j. These operations coincide with the
addition and multiplication
of functions when the power series converge for
?Il@roll%iaZ~vaIues of~~~~anu iney ooey such famlia~rlaws of algbra as associativity and commutativity
of addition and multiplication, distributivity of multiplication over addition, and cancellation of multiplication
(i.e., if F(~)G(X) =
F(x)H(x) and F(x) # 0, then G(x) = H(x)). In fact, the set of a11 forma1 power
series 1 z 0 ux with complex coefficients un forms a (commutative)
integral
domain under the operations just delned. This integral domain is denoted by
C [ [x]]. (Actually, C [[.Y]] is a very special type of integral domain. For readers
with some familiarity with algebra, we remark that C[[x]]
s a principal ideal
domain and therefore a unique factorization
domain. In fact, every ideal of
C[[x]]
has the form (.Y) for some n 2 0. From the viewpoint of commutative
algebra, C[[x]] is a one-dimensional
complete regular local ring. These general
algebraic considerations
will not concern us here; rather we will discuss from
an elementary viewpoint the properties of C[[xJ]
that will be useful to us.)
Similarly, the set of forma1 power series in the rn variables xi, . . , xm (where m
may be infinite) is denoted C[ [x l,. . . , .Y,,,]] and forms a unique factorization
domain (though not a principal ideal domain for m 2 2).
It is primarily through experience that the combinatorial
signitcance of the
algebraic operations of C [ [.Y]] or C [ [xi,. . . , x,,,]] is understood, as well as the
problem of whether to use ordinary or exponential
generating functions (or
various other kinds discussed in later chapters). In Section 3.15, we will explain
to some extent the combinatorial
signifcance of these operations, but even then
experience is indispensable.
If F(x) and G(x) are elements of C[[?C]] satisfying F(x)G(x) = 1, then we
(naturally) Write G(x) = F(x)-. (Here 1 is short for 1 + Ox + Ox2 + ....) It is
easy to see that F(x)- exists (in which case it is unique) if and only if u0 # 0,
where F(x) = 1 z ,, ux. One commonly writes symbolically u0 = F(O), even
though F(x) is not considered to be a function of x. If F(O) # 0 and F(~)G(X) =
H(x), then G(x) = F(x))lH(x).
More generally, the operation -i satisles a11 the
familiar laws of algebra, provided it is only applied to power series F(x) satisfying
F(O) # 0. For instance, (F(~)G(X))- = F(x)-G(x)-,
(F(x)-r)-t
= F(x), and SO
on. Similar results hold for C[[xt, . . . , xn J].

HO~

to Count

This formula cornes as no surprise; it is simply the formula (in a forma1 setting)
for summing a geometric series.
Example 1.1.5 provides a simple illustration of a general principle that,
informally speakinz. states that if we have an identity involving power series
that is valid when the power series are regarded as functions (SO that the
variables are suffciently small complex numbers), then this identity continues to
remain valid when regarded as an identity among forma1 power series, prokfed
the operations involved in the formulas are well-dehned for forma1 power series.
It would be unnecessarily pedantic for us to state a precise form of this principle
here, since the reader should have little trouble justifying in any particular case
the forma1 validity of our manipulations
with power series. We will give several
examples throughout this section to illustrate this contention.
1.1.6JXxample.

The identity
(3)

is valid at the function-theorctic


level (it states that eXeeX = 1) and is well-defined
as a statement involving forma1 power series. Hence (3) is a valid forma1 power
series identity. In other words (equating coeflcients of x#n! on both sides of (3))
we have

To justify this identity directly from (3), we may reason as follows. Both sides of
(3) converge for a11.K6 :C, SO we have

But if two power series in x represent the same function J(x) in a neighborhood
of 0, then these two power series must agree term-by-term,
by a standard
elementary result concerning power series. Hence (4) follows.
1.1.7 Example.

The identity

;. (x + lY/rl! = eFo x/rI!


1.1.5 Example.
Let (~~2,,~x)(l
- CYX)
= ~~2,,c#,
where a is a non-zero
complex number. Then by the detnition of power series multiplication,
cn =

1,

rr=o

1 a - a(a-l)

= 0,

n 2 1.

Hence En>0 ax = (1 - ax)-, which cari also be written


1
anxn c ~
X
1 -ax
PI20

is valid at the ,function-theoretic


level (it states that eX+ = e.eX), but does not
make sense as a statement involving forma1 power series. There is no formuf
procedure for writing En>0 (x + ly/rr! as a member of C[[x]].
Although the expression xnzo (x + l)/n! does not make sense fir&ly,
there are nevertheless certain infinite processes that cari be carried out formally
in C [ [xl]. (These concepts extend straightforwardly
to C [
. . . , x,J], but
for simplicity we consider only C[[x]].) TO deline these processes, we need to
put some additional structure on C[[x]]-namely,
the notion of conuergence.

[xr,

From an algebraic standpoint, the delnition of convergence is inherent in the


statement that C[[.Y]] is complete in a certain standard topology that cari be
put on C[[X]]. However. we will assume no knowledge of topology on the part
of the reader and will instead give a self-contained,
elementary trgstment of
con vcgeEeC
If-FI(x), F2(.y), . is a sequence of forma1 power series, and if F(X) =
~20a,$
is another forma1 power series, we say by delnition that Fi(x) conuerges to F(X) as i -t x. wfitten Fi(~) -+ F(X), provided that for a11n 2 0 there is
a number (j(n) such that the coeflcient of _Yin Fi(x) is an whenever i 2 J(tz). In
other words, for every n the sequence
[ F1 (.y), [ F* (.Y), .
n
n
of complex numbers eventually becomes constant with value a. An equivalent
definition of convergence is the following, Deline the @ree of a non-zero forma1
power series F(X) = 1 n2,, a,,.~, denoted degF(x), to be the least integer n such
that un # 0. Note that deg F(~)G(X) = deg F(x) + deg G(X). Then Fi(x) converges
if and only if limi_E deg(F,+,(x) - Fi(_~)) = co.
We now say that an infinite sum 1. ,20f+)
has the value F(X) provided
that x>+, Fi(x) -+ F(+x). A similar definition is made for the infinite product
nj> l Fj(.yl. TO avoid unimportant
technicalities we assume that in any infinite
product ~j~ 14(x), each factor q(x) satisles c(O) = 1. For instance, let e(x) =
aj-x. Then for I 2 u, the coeflcient of X in E;=u Fj(x) is a,,. Hence xjZO Fj(.y) is
just the power series 1 ,,20 a&. Thus we cari think of the forma1 power series
xnZ0 a,,.~ as actually being the sum of its individual terms. The proofs of the
following two elementary results are left to the reader.
1.1.8 Proposition.
The
limj_ deg e(x) = CC.

inlnite

series

1. ,ZQ &(x)

converges

if and

only

if
0

1.1.9 Proposition.
The infnite product nj2 1(1 + e(x)), where q(O) = 0, converges if and only if limj_m degq(x) = a.
0
It is essential to realize that in evaluating a convergent series xj20 4(x) (or
similarly a product fl. ,> l q(x)), the coefficient of x for any given n cari be
computed using only jhite processes. For if j is suflcientiy large, say j > d(n),
then deg4(x) > n, SO that

The latter expression involves only a finite sum.


The most important combinatorial
application of the notion ofconvergence
is to the idea ofpower series compositon. If F(x) = JTnzOa,,~ and G(x) are forma1
power series with G(O) = 0, deline the composition F(G(x)) to be the infinite sum
xn20 ~C(X). Since deg G(x) = n.deg G(x) 2 n, we see by Proposition 1.1.8 that
F(G(x)) is well-defned as a forma1 power series. We also see why an expression such as elX does not make sense forrnally; namely, the inlnite series

~nx,U + $/n! does not converge in accordance with the above delnition. On
the other hand, an expression like eeXml makes good sense fotmally, since it has
the form F(G(x)) where F(x) = xnkOx;n! and G(x) = x,,> l x/n!.

where (i) = 2(2. - 1)...(2 - n + l)/f~!. In fact, we may regard 2 as an indeterminate and take (5) as the definition of (1 + F(.K)) as an element of C[[.Y,~_]]
(or of C[;_l [[.Y]]; that is, the coefficient of .Y in (1 + F(.Y)) is a po/JXomia/
in 2). Al1 the expected properties
of exponentiation
are indeed valid. such
as (1 + Fe))i+fl = (1 + F(.Y))(~ + F(.Y))~ (regarded as an identity in the ring
C[[X,~,A~]], or in the ring C[[X]] where one takes j.. ~CC\.
If F(x) = x,,kO a,,.?, deline the jtirmal deriuatire F(.Y) (also denotcd L or
DF(x)) to be the forma1 power series xn2,, MZ.Y- = x,,ZO(~j + ~)u,,+~.Y.It is
easy to check that a11 the familiar laws of differentiation that are well-defined
formally continue to be valid for forma1 power series. In particular
(F + G) = F + G
(FG) = F!G + FG
F(G(x)) = G(x)F(G(x)).
We thus have a theory of fortna/ calchs for forma1 power series. The usefulness
of this theory will become apparent in subsequent examples. We first give an
example of the use of the forma1 calculus that should shed some additional light
on the validity of manipulating
forma1 power series as if they were actual
functions of x.
1.1.11 Example.
satisfying

Suppose

G(X) = F(x)/F(x),

F(O) = 1, and let G(x) be the unique


G(O) = 0.

power series

(6)

From the function-theoretic


viewpoint we cari salve (6) to obtain F(x) =
exp G(x), where by definition exp G(x) = En>,, G(x)/~!. Since G(O) = 0 everything is well-defned formally, SO(6) should remain equivalent to F(x) = exp G(X)
even if the power series for F(x) converges only at x = 0. How cari this assertion
be justified without actually proving a combinatorial
identity? Let F(x) = 1 +
xn2 l ux. From (6) we cari compute explicitly G(x) = xRZ l &x, and it is
quickly seen that each b is a polynomial in lnitely many of the ais. It then follows
that if exp G(x) = 1 + En2 l cnx, then each c will also be a polynomial in finitely
many of the ais, say c = P~(U~,a*, . . . , a,,,), where m depends on n. Now we know
that F(x) = expG(x) provided 1 + x21 UX converges. If-two Taylor series
convergent in some neighborhood
of the origin represent the same function, then
their coeflcients coincide. Hence a = ~,,(a~,u2,. . . , a,,,) provided 1 + En2 I U~X

&.*

converges. Thus the two polynomials


un and pJui,+,.
. . ,u,,,) agree in some
neighborhood
of the origin of C, SO they must be equal. (It is well-known
that if two complex polynomials in m variables agree in some open set of Cm,
then they are identical.) Since un = p,,(~i, u2,. . . , u,,,) as polynomials, the identity
#%KG,
,%Z,..,a..
a.%...-J,
,,cC+*
rVwb* C?C,*
1V>.
There is an alternative method for justifying the forma1 solution F(X) =
exp G(x) to (6), which may appeal to topologically inclined readers. Given G(X)
with G(O) = 0, deline F(x) = expG(x) and consider a map 4 : C[[x]]
-+ C[[_Y]]
delned by #(G(x)) = G(x) - $$. One easily vernies the following: (a) if G
converges in some neighborhood
of 0 then &G(x)) = 0; (b) the set 9 of a11power
series G(.x) E C[[x]]
that converge in some neighborhood
of0 is dense in C[[S]],
in the topology delned above (in fact. the set C[x] of polynomials is dense); and
(c) the function 4 is continuous
in the topology delned above. From this it
follows that C$(G(X))= 0 for a11 G(.x)EC[[.X]] with G(O) = 0.
We now present various illustrations
in the manipulation
of generating
functions. Throughout we will be making heavy use of the principle that forma1
power series cari be treated as if they were functions.
1.1.12 Exampk.
Find a simple expression for the generating function
xn,0 u,$, where u,, = ~1, = 1, un = un-, + u,,_* if n 2 2. We have

F(x) =

..

_...

1.1.14 Example.
Let P(~I) be the Mobius function of number theory; that is,
~(1) = 1, p(n) = 0 if n is divisible by the square of an integer greater than one,
and p(n) = (- ly if n is the product of r distinct primes. Find a simple expression
for the power series
F(x) = n (1 - xn)-p(nfl.
II>I

(8)

First let us make sure that F(x) is well-detned


by Example 1.1.10 that

as a forma1 power series. We have

Note that (1 - .Y)-pn~n= 1 + H(x), where deg H(x) = n. Hence by Proposition


1.1.9 the inlnite product (8) converges, SOF(x) is well-defined. Now apply log to
(8). In other words, form IB$!F(x), where
(- lY-x/n,

log(1 + x) = t
21

the power series expansion


log F(x) = log n

for the natural

logarithm.

We obtain

(1 - x)-fl(

21
=

&

log(

= -zi

= 1+

.K +

_K(F(.K)-

1) +

x2F(x).

1 -

x)-PC

$)log(l

- _Xfl)

-;lpJq).

Solving for F(x) yields F(x) = l/( 1 - .Y- x).


The coeflcient of xm in the above power series is
1.1.13 Exampie.
Find a simple expression for the generating function F(X) =
~,,~ou&/~!,
where u. = ai = 1, un = a_i + (n - l)~_~ if n 2 2. We have
F(x) = 1

/44,
In

where the sum is over a11 positive integers d dividing m. It is well-known

Il20

= 1+

;F

UX/?Z!
x +

1 UX/r7!

&&l)

22

= 1 + x + 1 (un-1 + (n - l)un_&c/n!.
22

In

that

m=

0,

otherwise.

(7)

Let G(x) = 1 ,,2Z un_i.?/~! and H(x) = znkZ (n - l)~~-~x/n!. Then G(x) =
xnkZ ~~_ix-/(n - l)! = F(x) - 1, and
H(x) = xn21 u,,-~x~-/(~ - 2)! =
xF(x). Hence if we differentiate (7) we obtain
F(x) = 1 + (F(x) - 1) + xF(x) = (1 + x)F(x).
The unique solution to this differential equation satisfying F(O) = 1 is F(x) =
exp(x + 4~~). (As shown in Example 1.1.11, solving this differential equation is
a purely forma1 procedure.)

Hence logF(x) = x, SO F(x) = ex. Note that the derivation


formula involved only for~~u/ manipulations.
1.1.15 Exampie.
satisfying
i

of this miraculous

Find the unique sequence u. = 1, ai, uZ, . . . of real numbers

U&z_~= 1

(9)

k=O

for a11 n E lV. The trick is to recognize the left-hand

side of (9) as the coeflcient

10

Chapter

What

1s Enumerative

1.1

Comhinatorics?

HO~ to Count

11

(for someone suflciently versed in complex variable theory) to obtain the asymptotic formula

U,, = ( - 1y

(_+)

= (_ ,Y( -;)(

-;)(-;j...(

Il

No other method of describing ~(II) makes it SO easy to determine these


fundamental properties. Many other properties ofj(n) cari also be easily obtained
from the generating function: for instance, we leave to the reader the problem of
evaluating, essentially by inspection of (lO), the sum

-y)
n!

l 3 .5 . (2t1 -

1)

2% !
NO~ that we have discussed thc manipulation
of forma1 power series. the
question arises as to the advantages of using generating functions to represent a
counting function j(tt). Why, for instance. should a formula such as

be regarded as a determination
of ,f(/t)? Basicaily, the answer is that there are
many standard, routine techniques for extracting information from generating
functions. Generating functions are frequently the most concise and eftcient way
of prescnting information
about their coefficients. For instance, from (10) an
experienced enumerativc combinatorialist
cari tel1 at a glancc the fohowing:
1. A simple recurrence for ,f(tz) cari be found by differentiation. Namely. we
obtain

n;. ,/(tz).K-/yn Equating

coefficients

l)! = t 1 + x)e- r+x-2, = ( 1 + .y)&


of Yn! yields

.fCtl+ 1) = _f(tz) + nf(n - l),


2. An explicit
Namely,

j(tl).Y.tl!.

formula

n 2 1.

for f(n)

cari be obtained

from J?+(~~) = c&~.

SO that

3. Regarded as a function of a complex variable, exp(.x + g) is a nicelybehaved entire function, SO that standard techniques from the theory of asymptotic estimates cari be used to estimate f(n). As a first approximation,
it is routine

Thercfore vve are ready to accept dhe generating function exp(.y + q) as a satisfactory determination
of f(n).
This completes our discussion of generating functions and more generally
the problem of giving a satisfactory description of a counting function ,/(tr). We
now turn to the question of what is the best way to pr~~~cthat a counting function
bas some given description. In accordance with the Princip]e from other branches
of mathematics that it is bctter to exhibit an explicit isomorphism between two
abjects than merely to prove that they are isomorphic. we adopt the general
principle that it is better to exhibit an cxplicit onc-to-one correspondence
(bijection) between two Imite sets than merely to prove that they bave the same number
of elements. A proof that shows that a certain set S bas a certain number ttt of
elements by constructing an explicit bijection between S and some other set that
is known to have ttl elements is called a cotnbinatorial prmf or bijectioe proof.
The precise border between combinatorial
and non-combinatorial
proofs is
rather hazy. and certain arguments that to an inexperienced enumerator
will
appear non-combinatorial
will be recognized by a more experienced counter as
C-,, icombinatorial,
primarily because he or sFis
aware of certain standard tech-_ .-.--niques for converting apparently non-combinatorial
arguments into combinatorial ones. Such subtleties will not concern us here, and we now give some cleartut examples of the distinction between combinatorial
and non-combinatorial
proofs.
1.1.16 Example.
Let n and k be fixed positive integers. How many sequences
(XI, X2.. . . , XJ are there of subsets of the set [n] = { 1,2,. . , nl such that XI n
Xl n ... n Xk = @? Let f(k, n) be this number. If we were not particuiarly inspired we could perhaps argue as follows. Suppose XI n X2 n . . . n Xk_l = T,
wherelTl=~.If~=Xi-T,thenY~n...nY~_~=~and~~[n]-T.Hence
there are f(k - 1,n - i) sequences (XI,. . .,Xk_l) such that XI n X2 n ... n
Xk-l = T. For each such sequence, Xk cari be any of the 2-i subsets of [n] - T.
As is probably familiar to most readers and will be discussed later, there are
(y) = n!/i!(n - i)! i-element subsets T of [n]. Hence

You might also like