Professional Documents
Culture Documents
Enumerative Combinatorics by Richard P. Stanley
Enumerative Combinatorics by Richard P. Stanley
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
1.1
How to Count
1.2
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 Unimodal
Notes
References
Exercises
Solutions
to Exercises
Positions
Sequences
C/zq~
96
3.1
Basic Concepts
96
3.2
100
Notation
v
Distributive
3.5
Chains in Distributive
3.6
The Incidence
3.7
3.8
Techniques
3.9
Lattices
110
Lattices
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
Notes
149
References
152
greatest integer
Exercises
153
least integer
174
Posets
Posets and Generating
Solutions
Chapter 4
to Permutation
to Exercises
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
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
or linear transformation
with
q elements
x with coeflcients
to Exercises
275
293
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
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
generating
(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
functions
of scveral variables.
such as
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)
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
1,
rr=o
1 a - a(a-l)
= 0,
n 2 1.
[xr,
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
~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),
power series
(6)
&.*
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)
log(1 + x) = t
21
logarithm.
We obtain
(1 - x)-fl(
21
=
&
log(
= -zi
= 1+
.K +
_K(F(.K)-
1) +
x2F(x).
1 -
x)-PC
$)log(l
- _Xfl)
-;lpJq).
/44,
In
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.)
of this miraculous
U&z_~= 1
(9)
k=O
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
-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
coefficients
j(tl).Y.tl!.
formula
n 2 1.
for f(n)
cari be obtained
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