Combinatorics Notes
Combinatorics Notes
Combinatorics Notes
Discovery1
Kenneth P. Bogart
March 20, 2005
1 This
ii
c
Kenneth
P. Bogart, 2004
Contents
Preface
ix
1 What is Combinatorics?
1.1 About These Notes . . . . . . . . . . . . . . . .
1.2 Basic Counting Principles . . . . . . . . . . . .
1.2.1 The sum and product principles . . . . .
1.2.2 Functions and directed graphs . . . . . .
1.2.3 The bijection principle . . . . . . . . . .
1.2.4 Counting subsets of a set . . . . . . . . .
1.2.5 Pascals Triangle . . . . . . . . . . . . .
1.2.6 The quotient principle . . . . . . . . . .
1.3 Some Applications of Basic Counting Principles
1.3.1 Lattice paths and Catalan Numbers . . .
1.3.2 The Binomial Theorem . . . . . . . . . .
1.3.3 The pigeonhole principle . . . . . . . . .
iii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
2
3
7
14
18
18
20
24
32
33
39
42
iv
CONTENTS
1.4
44
46
51
51
51
55
55
57
58
61
63
64
66
67
68
69
69
71
72
75
76
77
80
CONTENTS
2.4
Supplementary Problems . . . . . . . . . . . . . . . . . . . . . . .
82
3 Distribution Problems
85
3.1 The Idea of a Distribution . . . . . . . . . . . . . . . . . . . . . . 85
3.1.1 The twenty-fold way . . . . . . . . . . . . . . . . . . . . . 86
3.1.2 Ordered functions . . . . . . . . . . . . . . . . . . . . . . . 90
3.1.3 Multisets . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.1.4 Compositions of integers . . . . . . . . . . . . . . . . . . . 94
3.1.5 Broken permutations and Lah numbers . . . . . . . . . . . 95
3.2 Partitions and Stirling Numbers . . . . . . . . . . . . . . . . . . . 96
3.2.1 Stirling Numbers of the second kind . . . . . . . . . . . . . 96
3.2.2 Stirling Numbers and onto functions . . . . . . . . . . . . 98
3.2.3 Stirling Numbers and bases for polynomials . . . . . . . . 100
3.3 Partitions of Integers . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.3.1 The number of partitions of k into n parts . . . . . . . . . 104
3.3.2 Representations of partitions . . . . . . . . . . . . . . . . . 104
3.3.3 Ferrers and Young Diagrams and the conjugate of a partition105
3.3.4 Partitions into distinct parts . . . . . . . . . . . . . . . . . 112
3.3.5 Supplementary Problems . . . . . . . . . . . . . . . . . . . 113
4 Generating Functions
4.1 The Idea of Generating Functions . . . . .
4.1.1 Visualizing Counting with Pictures
4.1.2 Picture functions . . . . . . . . . .
4.1.3 Generating functions . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
121
121
121
123
125
vi
CONTENTS
4.2
4.3
4.4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
128
130
131
134
140
141
142
142
144
149
150
.
.
.
.
.
.
.
.
.
.
.
153
153
154
155
157
160
160
160
161
162
164
166
CONTENTS
vii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
169
169
170
172
175
177
181
183
184
188
192
196
202
205
209
211
217
.
.
.
.
.
221
221
221
224
226
230
viii
B Mathematical Induction
B.1 The Principle of Mathematical Induction . . . . .
B.1.1 The ideas behind mathematical induction
B.1.2 Mathematical induction . . . . . . . . . .
B.1.3 Proving algebraic statements by induction
B.2 Strong Induction . . . . . . . . . . . . . . . . . .
C Exponential Generating Functions
C.1 Indicator Functions . . . . . . . . . . . . . . . . .
C.2 Exponential Generating Functions . . . . . . . . .
C.3 Applications to Recurrences. . . . . . . . . . . . .
C.3.1 Using calculus with exponential generating
C.4 The Product Principle for EGFs . . . . . . . . . .
C.5 The Exponential Formula . . . . . . . . . . . . .
C.6 Supplementary Problems . . . . . . . . . . . . . .
CONTENTS
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. . . . . .
. . . . . .
. . . . . .
functions
. . . . . .
. . . . . .
. . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
239
239
239
243
245
246
.
.
.
.
.
.
.
251
251
253
257
258
259
269
276
Preface
This book is an introduction to combinatorial mathematics, also known as combinatorics. The book focuses especially but not exclusively on the part of combinatorics that mathematicians refer to as counting. The book consists almost
entirely of problems. Some of the problems are designed to lead you to think
about a concept, others are designed to help you figure out a concept and state a
theorem about it, while still others ask you to prove the theorem. Other problems
give you a chance to use a theorem you have proved. From time to time there is
a discussion that pulls together some of the things you have learned or introduces
a new idea for you to work with. Many of the problems are designed to build
up your intuition for how combinatorial mathematics works. There are problems
that some people will solve quickly, and there are problems that will take days
of thought for everyone. Probably the best way to use this book is to work on a
problem until you feel you are not making progress and then go on to the next
one. Think about the problem you couldnt get as you do other things. The next
chance you get, discuss the problem you are stymied on with other members of the
ix
PREFACE
class. Often you will all feel youve hit dead ends, but when you begin comparing
notes and listening carefully to each other, you will see more than one approach
to the problem and be able to make some progress. In fact, after comparing notes
you may realize that there is more than one way to interpret the problem. In
this case your first step should be to think together about what the problem is
actually asking you to do. You may have learned in school that for every problem
you are given, there is a method that has already been taught to you, and you
are supposed to figure out which method applies and apply it. That is not the
case here. Based on some simplified examples, you will discover the method for
yourself. Later on, you may recognize a pattern that suggests you should try to
use this method again.
The point of learning from this book is that you are learning how to discover
ideas and methods for yourself, not that you are learning to apply methods that
someone else has told you about. The problems in this book are designed to lead
you to discover for yourself and prove for yourself the main ideas of combinatorial
mathematics. There is considerable evidence that this leads to deeper learning
and more understanding.
You will see that some of the problems are marked with bullets. Those are
the problems that I feel are essential to having an understanding of what comes
later, whether or not it is marked by a bullet. The problems with bullets are
the problems in which the main ideas of the book are developed. Your instructor
may leave out some of these problems because he or she plans not to cover future
problems that rely on them. Many problems, in fact entire sections, are not
marked in this way, because they use an important idea rather than developing
one. Some other special symbols are described in what follows; a summary appears
xi
Table 1: The meaning of the symbols to the left of problem numbers.
essential
motivational material
summary
especially interesting
difficult
essential for this or the next section
in Table 1.
Some problems are marked with open circles. This indicates that they are
designed to provide motivation for, or an introduction to, the important concepts,
motivation with which some students may already be familiar. You will also see
that some problems are marked with arrows. These point to problems that I think
are particularly interesting. Some of them are also difficult, but not all are. A few
problems that summarize ideas that have come before but arent really essential
are marked with a plus, and problems that are essential if you want to cover
the section they are in or, perhaps, the next section, are marked with a dot (a
small bullet). If a problem is relevant to a much later section in an essential way,
Ive marked it with a dot and a parenthetical note that explains where it will be
essential. Finally, problems that seem unusually hard to me are marked with an
asterisk. Some Ive marked as hard only because I think they are difficult in light
of what has come before, not because they are intrinsically difficult. In particular,
xii
PREFACE
some of the problems marked as hard will not seem so hard if you come back to
them after you have finished more of the problems.
If you are taking a course, your instructor will choose problems for you to work
on based on the prerequisites for and goals of the course. If you are reading the
book on your own, I recommend that you try all the problems in a section you
want to cover. Try to do the problems with bullets, but by all means dont restrict
yourself to them. Often a bulleted problem makes more sense if you have done
some of the easier motivational problems that come before it. If, after youve tried
it, you want to skip over a problem without a bullet or circle, you should not miss
out on much by not doing that problem. Also, if you dont find the problems in
a section with no bullets interesting, you can skip them, understanding that you
may be skipping an entire branch of combinatorial mathematics! And no matter
what, read the textual material that comes before, between, and immediately after
problems you are working on!
One of the downsides of how we learn math in high school is that many of us
come to believe that if we cant solve a problem in ten or twenty minutes, then we
cant solve it at all. There will be problems in this book that take hours of hard
thought. Many of these problems were first conceived and solved by professional
mathematicians, and they spent days or weeks on them. How can you be expected
to solve them at all then? You have a context in which to work, and even though
some of the problems are so open ended that you go into them without any idea
of the answer, the context and the leading examples that precede them give you
a structure to work with. That doesnt mean youll get them right away, but you
will find a real sense of satisfaction when you see what you can figure out with
concentrated thought. Besides, you can get hints!
xiii
Some of the questions will appear to be trick questions, especially when you
get the answer. They are not intended as trick questions at all. Instead they
are designed so that they dont tell you the answer in advance. For example the
answer to a question that begins How many... might be none. Or there might
be just one example (or even no examples) for a problem that asks you to find all
examples of something. So when you read a question, unless it directly tells you
what the answer is and asks you to show it is true, dont expect the wording of
the problem to suggest the answer. The book isnt designed this way to be cruel.
Rather, there is evidence that the more open-ended a question is, the more deeply
you learn from working on it. If you do go on to do mathematics later in life, the
problems that come to you from the real world or from exploring a mathematical
topic are going to be open-ended problems because nobody will have done them
before. Thus working on open-ended problems now should help to prepare you to
do mathematics and apply mathematics in other areas later on.
You should try to write up answers to all the problems that you work on. If
you claim something is true, you should explain why it is true; that is you should
prove it. In some cases an idea is introduced before you have the tools to prove
it, or the proof of something will add nothing to your understanding. In such
problems there is a remark telling you not to bother with a proof. When you
write up a problem, remember that the instructor has to be able to get your
ideas and understand exactly what you are saying. Your instructor is going to
choose some of your solutions to read carefully and give you detailed feedback on.
When you get this feedback, you should think it over carefully and then write the
solution again! You may be asked not to have someone else read your solutions
to some of these problems until your instructor has. This is so that the instructor
xiv
PREFACE
can offer help which is aimed at your needs. On other problems it is a good idea
to seek feedback from other students. One of the best ways of learning to write
clearly is to have someone point out to you where it is hard to figure out what
you mean. The crucial thing is to make it clear to your reader that you really
want to know where you may have left something out, made an unclear statement,
or failed to support a statement with a proof. It is often very helpful to choose
people who have not yet become an expert with the problems, as long as they
realize it will help you most for them to tell you about places in your solutions
they do not understand, even if they think it is their problem and not yours!
As you work on a problem, think about why you are doing what you are doing.
Is it helping you? If your current approach doesnt feel right, try to see why. Is
this a problem you can decompose into simpler problems? Can you see a way to
make up a simple example, even a silly one, of what the problem is asking you to
do? If a problem is asking you to do something for every value of an integer n,
then what happens with simple values of n like 0, 1, and 2? Dont worry about
making mistakes; it is often finding mistakes that leads mathematicians to their
best insights. Above all, dont worry if you cant do a problem. Some problems
are given as soon as there is one technique youve learned that might help do
that problem. Later on there may be other techniques that you can bring back to
that problem to try again. The notes have been designed this way on purpose. If
you happen to get a hard problem with the bare minimum of tools, you will have
accomplished much. As you go along, you will see your ideas appearing again
later in other problems. On the other hand, if you dont get the problem the first
time through, it will be nagging at you as you work on other things, and when
you see the idea for an old problem in new work, you will know you are learning.
xv
There are quite a few concepts that are developed in this book. Since most of
the intellectual content is in the problems, it is natural that definitions of concepts
will often be within problems. When you come across an unfamiliar term in a
problem, it is likely it was defined earlier. Look it up in the index, and with luck
(hopefully no luck will really be needed!) you will be able to find the definition.
Above all, this book is dedicated to the principle that doing mathematics is
fun. As long as you know that some of the problems are going to require more
than one attempt before you hit on the main idea, you can relax and enjoy your
successes, knowing that as you work more and more problems and share more
and more ideas, problems that seemed intractable at first become a source of
satisfaction later on.
The development of this book is supported by the National Science Foundation. An essential part of this support is an advisory board of faculty members from a wide variety of institutions who have tried to help me understand
what would make the book helpful in their institutions. They are Karen Collins,
Wesleyan University, Marc Lipman, Indiana University/Purdue University, Fort
Wayne, Elizabeth MacMahon, Lafayette College, Fred McMorris, Illinois Institute
of Technology, Mark Miller, Marietta College, Rosa Orellana, Dartmouth College,
Vic Reiner, University of Minnesota, and Lou Shapiro, Howard University. The
overall design and most of the problems in the appendix on exponential generating functions are due to Professors Reiner and Shapiro. Any errors or confusing
writing in that appendix are due to me! I believe the board has managed both to
make the book more accessible and more interesting.
xvi
PREFACE
Chapter 1
What is Combinatorics?
Combinatorial mathematics arises from studying how we can combine objects into
arrangements. For example, we might be combining sports teams into a tournament, samples of tires into plans to mount them on cars for testing, students into
classes to compare approaches to teaching a subject, or members of a tennis club
into pairs to play tennis. There are many questions one can ask about such arrangements of objects. Here we will focus on questions about how many ways we
may combine the objects into arrangements of the desired type. These are called
counting problems. Sometimes, though, combinatorial mathematicians ask if an
arrangement is possible (if we have ten baseball teams, and each team has to play
each other team once, can we schedule all the games if we only have the fields
available at enough times for forty games?). Sometimes they ask if all the arrangements we might be able to make have a certain desirable property (Do all ways
1
1.1
These notes are based on the philosophy that you learn the most about a subject
when you are figuring it out directly for yourself, and learn the least when you
are trying to figure out what someone else is saying about it. On the other hand,
there is a subject called combinatorial mathematics, and that is what we are going
to be studying, so we will have to tell you some basic facts. What we are going
to try to do is to give you a chance to discover many of the interesting examples
that usually appear as textbook examples and discover the principles that appear
as textbook theorems. Your main activity will be solving problems designed to
lead you to discover the basic principles of combinatorial mathematics. Some of
the problems lead you through a new idea, some give you a chance to describe
what you have learned in a sequence of problems, and some are quite challenging.
When you find a problem challenging, dont give up on it, but dont let it stop
you from going on with other problems. Frequently you will find an idea in a later
problem that you can take back to the one you skipped over or only partly finished
in order to finish it off. With that in mind, lets get started. In the problems that
follow, you will see some problems marked on the left with various symbols. The
preface gives a full explanation of these symbols and discusses in greater detail
why the book is organized as it is! Table 1.1, which is repeated from the preface,
summarizes the meaning of the symbols.
Table 1.1: The meaning of the symbols to the left of problem numbers.
1.2
essential
motivational material
summary
especially interesting
difficult
essential for this or the next section
1. Five schools are going to send their baseball teams to a tournament, in which
each team must play each other team exactly once. How many games are
required?
4. An ordered pair (a, b) consists of two things we call a and b. We say a is the
first member of the pair and b is the second member of the pair. If M is an
m-element set and N is an n-element set, how many ordered pairs are there
whose first member is in M and whose second member is in N ? Does this
problem have anything to do with any of the previous problems?
a sandwich, and a fruit (from among four different kinds). In how many
ways may a student make a choice of the three items now?
6. The coach of the team in Problem 3 knows of an ice cream parlor along the
way where she plans to stop to buy each team member a triple decker cone.
There are 12 different flavors of ice cream, and triple decker cones are made
in homemade waffle cones. Having chocolate ice cream as the bottom scoop
is different from having chocolate ice cream as the top scoop. How many
possible ice cream cones are going to be available to the team members?
How many cones with three different kinds of ice cream will be available?
7. The idea of a function is ubiquitous in mathematics. A function f from a
set S to a set T is a relationship between the two sets that associates exactly
one member f (x) of T with each element x in S. We will come back to the
ideas of functions and relationships in more detail and from different points
of view from time to time. However, the quick review above should probably
let you answer these questions. If you have difficulty with them, it would
be a good idea to go now to Appendix A and work through Section A.1.1
which covers this definition in more detail. You might also want to study
Section A.1.3 to learn to visualize the properties of functions. We will take
up the topic of this section later in this chapter as well, but in less detail
than is in the appendix.
(a) Using f , g, . . . , to stand for the various functions, write down all
the different functions you can from the set {1, 2} to the set {a, b}.
For example, you might start with the function f given by f (1) = a,
9. Two sets are said to be disjoint if they have no elements in common. For
example, {1, 3, 12} and {6, 4, 8, 2} are disjoint, but {1, 3, 12} and {3, 5, 7}
are not. Three or more sets are said to be mutually disjoint if no two of
them have any elements in common. What can you say about the size of
the union of a finite number of finite (mutually) disjoint sets? Does this
have anything to do with any of the previous problems?
10. Disjoint subsets are defined in Problem 9. What can you say about the size
of the union of m (mutually) disjoint sets, each of size n? Does this have
anything to do with any of the previous problems?
1.2.1
These problems contain among them the kernels of many of the fundamental
ideas of combinatorics. For example, with luck, you just stated the sum principle
(illustrated in Figure 1.1), and product principle (illustrated in Figure 1.2) in
Problems 9 and 10. These are two of the most basic principles of combinatorics.
These two counting principles are the basis on which we will develop many other
counting principles.
You may have noticed some standard mathematical words and phrases such
as set, ordered pair, function and so on creeping into the problems. One of our
goals in these notes is to show how most counting problems can be recognized as
counting all or some of the elements of a set of standard mathematical objects. For
example, Problem 4 is meant to suggest that the question we asked in Problem 3
was really a problem of counting all the ordered pairs consisting of a bread choice
and a filling choice. We use A B to stand for the set of all ordered pairs whose
first element is in A and whose second element is in B and we call A B the
Cartesian product of A and B. Thus you can think of Problem 4 as asking you
for the size of the Cartesian product of M and N , that is, asking you to count the
10
11
13. Let us now return to Problem 7 and justifyor perhaps finishour answer
to the question about the number of functions from a three-element set to
a 12-element set.
(a) How can you justify your answer in Problem 7 to the question How
many functions are there from a three element set (say [3] = {1, 2, 3})
to a twelve element set (say [12])?
(b) Based on the examples youve seen so far, make a conjecture about
how many functions there are from the set
[m] = {1, 2, 3, . . . , m}
to [n] = {1, 2, 3, . . . , n} and prove it.
(c) A common notation for the set of all functions from a set M to a set
N is N M . Why is this a good notation?
14. Now suppose we are thinking about a set S of functions f from [m] to some
set X. (For example, in Problem 6 we were thinking of the set of functions
from the three possible places for scoops in an ice-cream cone to 12 flavors
of ice cream.) Suppose there are k1 choices for f (1). (In Problem 6, k1 was
12, because there were 12 ways to choose the first scoop.) Suppose that for
each choice of f (1) there are k2 choices for f (2). (For example, in Problem
6 k2 was 12 if the second flavor could be the same as the first, but k2 was 11
if the flavors had to be different.) In general, suppose that for each choice
of f (1), f (2), . . . f (i 1), there are ki choices for f (i). (For example, in
12
The point of Problem 14 is that the general product principle can be stated
informally, as we did originally, or as a statement about counting sets of standard
concrete mathematical objects, namely functions.
15. A roller coaster car has n rows of seats, each of which has room for two
people. If n men and n women get into the car with a man and a woman in
each row, in how many ways may they choose their seats?
+
13
19. Assuming k n, in how many ways can we pass out k distinct pieces of
fruit to n children if each child may get at most one? What is the number
if k > n? Assume for both questions that we pass out all the fruit.
20. Another name for a list, in a specific order, of k distinct things chosen from a
set S is a k-element permutation of S. We can also think of a k-element
permutation of S as a one-to-one function (or, in other words, injection)
from [k] = {1, 2, . . . , k} to S. How many k-element permutations does an nelement set have? (For this problem it is natural to assume k n. However,
the question makes sense even if k > n.) What is the number of k-element
permutations of an n-element set if k > n?
There are a variety of different notations for the number of k-element permutations of an n-element set. The one we shall use was introduced by Don Knuth;
namely nk , read n to the k falling or n to the k down. In Problem 20 you
may have shown that
k
n = n(n 1) (n k + 1) =
k
Y
(n i + 1).
(1.1)
i=1
14
1.2.2
15
16
25
000
001
010
011
100
101
110
111
(b) The function from the set {0,1,2,3,4,5,6,7} to the set of triples
of zeros and ones given by f(x) = the binary representation of x.
-2
-1
2
3
16
the vertex for y if f (x) = y. Sometimes, as in part (e) of the figure, if we have
a function from a set S to itself, we draw only one set of vertices representing
the elements of S, in which case we can have arrows both entering and leaving a
given vertex. As you see, the digraph can be more enlightening in this case if we
experiment with the function to find a nice placement of the vertices rather than
putting them in a row.
Notice that there is a simple test for whether a digraph whose vertices represent
the elements of the sets S and T is the digraph of a function from S to T . There
must be one and only one arrow leaving each vertex of the digraph representing
an element of S. The fact that there is one arrow means that f (x) is defined
for each x in S. The fact that there is only one arrow means that each x in S
is related to exactly one element of T . (Note that these remarks hold as well if
we have a function from S to S and draw only one set of vertices representing
the elements of S.) For further discussion of functions and digraphs see Sections
A.1.1 and A.1.2 of Appendix A.
23. Draw the digraph of the function from the set {Alice, Bob, Dawn, Bill} to
the set {A, B, C, D, E} given by
f (X) = the first letter of the name X.
24. A function f : S T is called an onto function or surjection if each element
of T is f (x) for some x S. Choose a set S and a set T so that you can
draw the digraph of a function from S to T that is one-to-one but not onto,
and draw the digraph of such a function.
17
25. Choose a set S and a set T so that you can draw the digraph of a function
from S to T that is onto but not one-to-one, and draw the digraph of such
a function.
26. Digraphs of functions help us visualize the ideas of one-to-one functions and
onto functions.
(a) What does the digraph of a one-to-one function (injection) from a finite
set X to a finite set Y look like? (Look for a test somewhat similar to
the one we described for when a digraph is the digraph of a function.)
(b) What does the digraph of an onto function look like?
(c) What does the digraph of a one-to-one and onto function from a finite
set S to a set T look like?
27. The word permutation is actually used in two different ways in mathematics.
A permutation of a set S is a one-to-one function from S onto S. How
many permutations does an n-element set have?
Notice that there is a great deal of consistency between the use of the word
permutation in Problem 27 and the use in the Problem 20. If we have some way
a1 , a2 , . . . , an of listing our set S, then any other list b1 , b2 , . . . , bn gives us the
permutation of S whose rule is f (ai ) = bi , and any permutation of S, say the one
given by g(ai ) = ci gives us a list c1 , c2 , . . . , cn of S. Thus there is really very little
difference between the idea of a permutation of S and an n-element permutation
of S when n is the size of S.
18
1.2.3
Another name for a one-to-one and onto function is bijection. The digraphs
marked (a), (b), and (e) in Figure 1.3 are digraphs of bijections. The description
in Problem 26c of the digraph of a bijection from X to Y illustrates one of the
fundamental principles of combinatorial mathematics, the bijection principle:
Two sets have the same size if and only if there is a bijection between them.
It is surprising how this innocent sounding principle guides us into finding insight
into some otherwise very complicated proofs.
1.2.4
19
frequently used way to read the binomial coefficient notation is the number of
combinations of n things taken k at a time. We wont use this way of reading
the notation. You are going to be asked to construct two bijections that relate
to these numbers and figure out what famous formula they prove. We are going
to think about subsets of the n-element set [n] = {1, 2, 3, . . . , n}. As an example,
the set of two-element subsets of [4] is
{{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}}.
This example tells us that
4
2
= 6.
29. Let C be the set of k-element subsets of [n] that contain the number n, and
let D be the set of k-element subsets of [n] that dont contain n.
(a) Let C 0 be the set of (k 1)-element subsets of [n 1]. Describe a
bijection from C to C 0 . (A verbal description is fine.)
(b) Let D0 be the set of k-element subsets of [n 1] = {1, 2, . . . n 1}.
Describe a bijection from D to D0 . (A verbal description is fine.)
(c) Based on the two previous parts, express the sizes of C and D in terms
of binomial coefficients involving n 1 instead of n.
(d) Apply the
sum principle to C and D and obtain a formula that expresses nk in terms of two binomial coefficients involving n 1. You
have just derived the Pascal Equation that is the basis for the famous
Pascals Triangle.
20
1.2.5
Pascals Triangle
The Pascal Equation that you derived in Problem 29 gives us the triangle in
Figure 1.4. This figure has the number of k-element subsets of an n-element set
as the kth number over in the nth row (we call the top row the zeroth row and the
beginning entry of a row the zeroth
number over). Youll see that your formula
n
doesnt say anything about k if k = 0 or k = n, but otherwise it says that each
entry is the sum of the two that are above it and just to the left or right.
Figure 1.4: Pascals Triangle
1
1
1
1
1
1
1
1
2
3
4
5
1
3
6
10
15
21
4
10
20
35
1
1
5
15
35
1
6
21
1
7
30. Just for practice, what is the next row of Pascals triangle?
31. Without writing out the rows completely, write out enough of Pascals triangle to get a numerical answer for the first question in Problem 8.
21
k=0
1
1
1
1
1
1
1
1
1
2
3
4
5
6
7
1
3
6
10
15
21
1
4
10
20
35
1
5
15
35
1
6
21
1
7
22
Seeing this right triangle leads us to ask whether there is some natural way
to extend the right triangle to a rectangle. If we did have a rectangular table of
binomial coefficients, counting the first row as row zero (i.e., n = 0) and the first
column as column zero (i.e., k = 0), the entries we dont yet have are values of nk
for k > n. But how many k-element subsets does an n-element set have if k > n?
The answer, of course, is zero, so all the other entries we would fill in would be
zero, giving us the rectangular array in Figure 1.6. It is straightforward to check
that Pascals Equation now works for all the entries in the rectangle that have an
entry above them and an entry above and to the left.
Figure 1.6: Pascals Rectangle
n=0
1
2
3
4
5
6
7
k=0
1
1
1
1
1
1
1
1
1
0
1
2
3
4
5
6
7
2
0
0
1
3
6
10
15
21
3
0
0
0
1
4
10
20
35
4
0
0
0
0
1
5
15
35
5
0
0
0
0
0
1
6
21
6
0
0
0
0
0
0
1
7
7
0
0
0
0
0
0
0
1
32. Because our definition told us that nk is 0 when k > n, we got a rectangular
table of numbers that satisfies the Pascal Equation.
23
(a) Is there any other way to define nk when k > n in order to get a
rectangular table that agrees with Pascals Right Triangle for k n
and satisfies the Pascal Equation?
(b) Suppose
we want to extend Pascals Rectangle to the left and define
n
for n 0 and k > 0 so that k < 0. What should we put into
k
row n and column k of Pascals Rectangle in order for the Pascal
Equation to hold true?
(c) What should we put into row n (assume n is positive) and column
k or column k in order for the Pascal Equation to continue to hold?
Do we have any freedom of choice?
33. There is yet another bijection that lets us prove that a set of size n has 2n
subsets. Namely, for each subset S of [n] = {1, 2, . . . , n}, define a function
(traditionally denoted by S ) as follows.1
S (i) =
1 if i S
0 if i 6 S
The symbol is the Greek letter chi that is pronounced Ki, with the i sounding like eye.
24
1.2.6
34. As we noted in Problem 29, the first question in Problem 8 asked us for the
number of three-element subsets of a twelve-element set. We were able to
use the Pascal Equation to get a numerical answer to that question. Had
we had twenty or thirty flavors of ice cream to choose from, using the Pascal
Equation to get our answer would have entailed a good bit more work. We
25
have seen how the general product principle gives us an answer to Problem
6. Thus we might think that the number of ways to choose a three element
set from 12 elements is the number of ways to choose the first element times
the number of ways to choose the second element times the number of ways
to choose the third element, which is 12 11 10 = 1320. However, our result
in Problem 29 shows that this is wrong.
(a) What is it that is different between the number of ways to stack ice
cream in a triple decker cone with three different flavors of ice cream
and the number of ways to simply choose three different flavors of ice
cream?
(b) In particular, how many different triple decker cones use vanilla, chocolate, and strawberry? (Of course any three distinct flavors could substitute for vanilla, chocolate and strawberry without changing the answer.)
(c) Using your answer from part 34b, compute the number of ways to
choose three different flavors of ice cream (out of twelve flavors) from
the number of ways to choose a triple decker cone with three different
flavors (out of twelve flavors).
35. Based on what you observed in Problem 34c, how many k-element subsets
does an n-element set have?
36. The formula you proved in Problem
35 is symmetric in k and n k; that
n
is, it gives the same number for nk as it gives for nk
. Whenever two
26
37. In how many ways can we pass out k (identical) ping-pong balls to n children
if each child may get at most one?
38. In how many ways may n people sit around a round table? (Assume that
when people are sitting around a round table, all that really matters is who is
to each persons right. For example, if we can get one arrangement of people
around the table from another by having everyone get up and move to the
right one place and sit back down, then we get an equivalent arrangement of
people. Notice that you can get a list from a seating arrangement by marking
a place at the table, and then listing the people at the table, starting at that
place and moving around to the right.) There are at least two different ways
of doing this problem. Try to find them both.
We are now going to analyze the result of Problem 35 in more detail in order to
tease out another counting principle that we can use in a wide variety of situations.
In Table 1.2 we list all three-element permutations of the 5-element set {a, b, c, d, e}.
Each row consists of all 3-element permutations of some subset of {a, b, c, d, e}.
Because a given k-element subset can be listed as a k-element permutation in k!
ways, there are 3! = 6 permutations in each row. Because each 3-element permutation appears exactly once in the table, each row is a block of a partition
of the set of 3-element permutations of {a, b, c, d, e}. Each block has size six.
27
Table 1.2: The 3-element permutations of {a, b, c, d, e} organized by which 3element set they permute.
abc
abd
abe
acd
ace
ade
bcd
bce
bde
cde
acb
adb
aeb
adc
aec
aed
bdc
bec
bed
ced
bac
bad
bae
cad
cae
dae
cbd
cbe
dbe
dce
bca
bda
bea
cda
cea
dea
cdb
ceb
deb
dec
cab
dab
eab
dac
eac
ead
dbc
ebc
ebd
ecd
cba
dba
eba
dca
eca
eda
dcb
ecb
edb
edc
Each block consists of all 3-element permutations of some three element subset of
{a, b, c, d, e}. Since there are ten rows, we see that there are ten 3-element subsets
of {a, b, c, d, e}. An alternate way to see this is to observe that we partitioned
the set of all 60 three-element permutations of {a, b, c, d, e} into some number q
of blocks, each of size six. Thus by the product principle, q 6 = 60, so q = 10.
39. Rather than restricting ourselves to n = 5 and k = 3, we can partition the
set of all k-element permutations of an n-element set S up into blocks. We
do so by letting BK be the set (block) of all k-element permutations of K
for each k-element subset K of S. Thus as in our preceding example, each
28
n
k
of k-element sub-
40. A basketball team has 12 players. However, only five players play at any
given time during a game.
(a) In how may ways may the coach choose the five players?
(b) To be more realistic, the five players playing a game normally consist
of two guards, two forwards, and one center. If there are five guards,
four forwards, and three centers on the team, in how many ways can
the coach choose two guards, two forwards, and one center?
(c) What if one of the centers is equally skilled at playing forward?
29
30
table was a symmetry in the problem of people at a table; the fact that we can
order the sets in any order is the symmetry in the problem of counting k-element
subsets.)
In Section A.2 of Appendix A we introduce the idea of an equivalence relation,
see what equivalence relations have to do with partitions, and discuss the quotient
principle from that point of view. While that appendix is not required for what we
are doing here, if you want a more thorough discussion of the quotient principle,
this would be a good time to work through that appendix.
43. In how many ways may we string n distinct beads on a necklace without a
clasp? (Perhaps we make the necklace by stringing the beads on a string,
and then carefully gluing the two ends of the string together so that the joint
cant be seen. Assume someone can pick up the necklace, move it around in
space and put it back down, giving an apparently different way of stringing
the beads that is equivalent to the first.)
44. We first gave this problem as Problem 12a. Now we have several ways to
approach the problem. A tennis club has 2n members. We want to pair up
the members by twos for singles matches.
(a) In how many ways may we pair up all the members of the club? Give
at least two solutions different from the one you gave in Problem 12a.
(You may not have done Problem 12a. In that case, see if you can find
three solutions.)
(b) Suppose that in addition to specifying who plays whom, for each pairing
31
we say who serves first. Now in how many ways may we specify our
pairs? Try to find as many solutions as you can.
45.
(This becomes especially relevant in Chapter 6, though it makes an important point here.) In how many ways may we attach two identical red beads
and two identical blue beads to the corners of a square (with one bead per
corner) free to move around in (three-dimensional) space?
46. While the formula you proved in Problem 35 and Problem 39d is very useful,
it doesnt give us a sense of how big the binomial coefficients
are. We can
2n
get a very rough idea, for example, of the size of n by recognizing that
2n1
n+1
, and each quotient is at least 2,
we can write (2n)n /n! as 2n
n
n1
1
n
so the product is at least 2 . If this were an accurate estimate, it would
mean the fraction of n-element subsets of a 2n-element set would be about
2n /22n = 1/2n , which becomes very small as n becomes large. However,
it is pretty clear the approximation will not be a very good one, because
some of the terms in that product are much larger than 2. In fact, if 2n
k
1
of 22n .
were the same for every k, then each would be the fraction 2n+1
This
is much larger than the fraction 21n . But our intuition
suggests that
2n
2n
2n
is much larger than 1 and is likely larger than n1 so we can be
n
sure our approximation is a bad one. For estimates like this, James Stirling
developed
a formula to approximate n! when n is large, namely n! is about
32
2n
nn
.
en
n
We read this notation as n! is asymptotic to 2n nen . Use Stirlings formula to show that
set is
the fraction of subsets of size n in an 2n-element
1
approximately 1/ n. This is a much bigger fraction than 2n !
1.3
2
Proving this takes more of a detour than is advisable here; however there is an elementary
proof which you can work through in the problems of the end of Section 1 of Chapter 1 of
Introductory Combinatorics by Kenneth P. Bogart, Harcourt Academic Press, (2000).
1.3.1
33
47. In a part of a city, all streets run either north-south or east-west, and there
are no dead ends. Suppose we are standing on a street corner. In how many
ways may we walk to a corner that is four blocks north and six blocks east,
using as few blocks as possible?
48.
(a) What is the length of a lattice path from (0, 0) to (m, n)?
34
49.
(a) Describe which points are connected to (0, 0) by diagonal lattice paths.
(b) What is the length of a diagonal lattice path from (0, 0) to (m, n)?
(c) Assuming that (m, n) is a point you can get to from (0, 0), how many
diagonal lattice paths are there from (0, 0) to (m, n)?
35
50. A school play requires a ten dollar donation per person; the donation goes
into the student activity fund. Assume that each person who comes to the
play pays with a ten dollar bill or a twenty dollar bill. The teacher who
is collecting the money forgot to get change before the event. If there are
always at least as many people who have paid with a ten as a twenty as they
arrive the teacher wont have to give anyone an IOU for change. Suppose
2n people come to the play, and exactly half of them pay with ten dollar
bills.
(a) Describe a bijection between the set of sequences of tens and twenties
people give the teacher and the set of lattice paths from (0, 0) to (n, n).
(b) Describe a bijection between the set of sequences of tens and twenties that people give the teacher and the set of diagonal lattice paths
between (0, 0) and (2n, 0).
(c) In each of the previous parts, what is the geometric interpretation of a
sequence that does not require the teacher to give any IOUs?
51.
Notice that a lattice path from (0, 0) to (n, n) stays inside (or on the edges
of) the square whose sides are the x-axis, the y-axis, the line x = n and the
line y = n. In this problem we will compute the number of lattice paths
from (0,0) to (n, n) that stay inside (or on the edges of) the triangle whose
sides are the x-axis, the line x = n and the line y = x. Such lattice paths
are called Catalan paths. For example, in Figure 1.9 we show the grid of
points with integer coordinates for the triangle whose sides are the x-axis,
the line x = 4 and the line y = x.
36
Figure 1.9: The Catalan paths from (0, 0) to (i, i) for i = 0, 1, 2, 3, 4. The number
of paths to the point (i, i) is shown just above that point.
14
5
2
1
1
(a) Explain why the number of lattice paths from (0, 0) to (n, n) that go
outside the triangle described previously is the number of lattice paths
from (0, 0) to (n, n) that either touch or cross the line y = x + 1.
(b) Find a bijection between lattice paths from (0, 0) to (n, n) that touch
(or cross) the line y = x + 1 and lattice paths from (1, 1) to (n, n).
(c) Find a formula for the number of lattice paths from (0, 0) to (n, n) that
do not go above the line y = x. The number of such paths is called a
Catalan Number and is usually denoted by Cn .
52. Your formula for the Catalan Number can be expressed as a binomial co-
37
38
1.3.2
39
40
55. What is
P10 10
56. What is
i=1
n
0
3i ?
n
1
n
2
n
n
n
m+n
=
.
ki
k
41
58. From the symmetry of the binomial coefficients, it is not too hard to see
that when n is an odd number, the number of subsets of {1, 2, . . . , n} of odd
size equals the number of subsets of {1, 2, . . . , n} of even size. Is it true that
when n is even the number of subsets of {1, 2, . . . , n} of even size equals the
number of subsets of odd size? Why or why not?
59. What is
Pn
i=0 i
n
i
Notice how the proof you gave of the binomial theorem was a counting argument. It is interesting that an apparently algebraic theorem that tells us how to
expand a power of a binomial is proved by an argument that amounts to counting the individual terms of the expansion. Part of the reason that combinatorial
mathematics turns out to be so useful is that counting arguments often underlie
important results of algebra. As the algebra becomes more sophisticated, so do
the families of objects we have to count, but nonetheless we can develop a great
deal of algebra on the basis of counting.
42
1.3.3
60. American coins are all marked with the year in which they were made. How
many coins do you need to have in your hand to guarantee that on two (at
least) of them, the date has the same last digit? (When we say to guarantee
that on two (at least) of them,... we mean that you can find two with the
same last digit. You might be able to find three with that last digit, or you
might be able to find one pair with the last digit 1 and one pair with the
last digit 9, or any combination of equal last digits, as long as there is at
least one pair with the same last digit.)
There are many ways in which you might explain your answer to Problem 60.
For example, you can partition the coins according to the last digit of their date;
that is, you put all the coins with a given last digit in a block together, and put
no other coins in that block; repeating until all coins are in some block. Then
you have a partition of your set of coins. If no two coins have the same last digit,
then each block has exactly one coin. Since there are only ten digits, there are at
most ten blocks and so by the sum principle there are at most ten coins. In fact
with ten coins it is possible to have no two with the same last digit, but with 11
coins some block must have at least two coins in order for the sum of the sizes
of at most ten blocks to be 11. This is one explanation of why we need 11 coins
in Problem 60. This kind of situation arises often in combinatorial situations,
and so rather than always using the sum principle to explain our reasoning, we
enunciate another principle which we can think of as yet another variant of the
sum principle. The pigeonhole principle states that
43
63.
64. All the powers of five end in a five, and all the powers of two are even. Show
that for some integer n, if you take the first n powers of a prime other than
two or five, one must have 01 as the last two digits.
65.
Show that in a set of six people, there is a set of at least three people who all
know each other, or a set of at least three people none of whom know each
44
66.
Draw five circles labeled Al, Sue, Don, Pam, and Jo. Find a way to draw
red and green lines between people so that every pair of people is joined
by a line and there is neither a triangle consisting entirely of red lines or a
triangle consisting of green lines. What does Problem 65 tell you about the
possibility of doing this with six peoples names? What does this problem
say about the conclusion of Problem 65 holding when there are five people
in our set rather than six?
1.3.4
Ramsey Numbers
Problems 65 and 66 together show that six is the smallest number R with the
property that if we have R people in a room, then there is either a set of (at least)
three mutual acquaintances or a set of (at least) three mutual strangers. Another
way to say the same thing is to say that six is the smallest number so that no
matter how we connect six points in the plane (no three on a line) with red and
green lines, we can find either a red triangle or a green triangle. There is a name for
this property. The Ramsey Number R(m, n) is the smallest number R so that if
we have R people in a room, then there is a set of at least m mutual acquaintances
or at least n mutual strangers. There is also a geometric description of Ramsey
Numbers; it uses the idea of a complete graph on R vertices. A complete graph
on R vertices consists of R points in the plane, together with line segments (or
45
curves) connecting each two of the R vertices.4 The points are called vertices and
the line segments are called edges. In Figure 1.10 we show three different ways to
draw a complete graph on four vertices. We use Kn to stand for a complete graph
on n vertices.
Figure 1.10: Three ways to draw a complete graph on four vertices
46
number R such that if we color the edges of a KR with two colors, then our picture
contains a Kn all of whose edges have the same color.
67. Since R(3, 3) = 6, an uneducated guess might be that R(4, 4) = 8. Show
that this is not the case.
68.
Show that among ten people, there are either four mutual acquaintances or
three mutual strangers. What does this say about R(4, 3)?
69.
Show that among an odd number of people there is at least one person who
is an acquaintance of an even number of people and therefore also a stranger
to an even number of people.
70.
Find a way to color the edges of a K8 with red and green so that there is
no red K4 and no green K3 .
71.
As of this writing, relatively few Ramsey Numbers are known. R(3, n) is known
for n < 10, R(4, 4) = 18, and R(5, 4) = R(4, 5) = 25.
1.4
1. Remember that we can write n as a sum of n ones. How many plus signs do
we use? In how many ways may we write n as a sum of a list of k positive
numbers? Such a list is called a composition of n into k parts.
47
3.
Write down a list of all 16 zero-one sequences of length four starting with
0000 in such a way that each entry differs from the previous one by changing
just one digit. This is called a Gray Code. That is, a Gray Code for 0-1
sequences of length n is a list of the sequences so that each entry differs from
the previous one in exactly one place. Can you describe how to get a Gray
Code for 0-1 sequences of length five from the one you found for sequences
of length 4? Can you describe how to prove that there is a Gray code for
sequences of length n?
4. Use the idea of a Gray Code from Problem 3 to prove bijectively that the
number of even-sized subsets of an n-element set equals the number of oddsized subsets of an n-element set.
5. A list of parentheses is said to be balanced if there are the same number of
left parentheses as right, and as we count from left to right we always find at
least as many left parentheses as right parentheses. For example, (((()()))())
is balanced and ((()) and (()()))(() are not. How many balanced lists of n
left and n right parentheses are there?
6. Suppose we plan to put six distinct computers in a network as shown in
Figure 1.11. The lines show which computers can communicate directly
with which others. Consider two ways of assigning computers to the nodes
of the network different if there are two computers that communicate directly
48
7. In a circular ice cream dish we are going to put four scoops of ice cream of
four distinct flavors chosen from among twelve flavors. Assuming we place
four scoops of the same size as if they were at the corners of a square, and
recognizing that moving the dish doesnt change the way in which we have
put the ice cream into the dish, in how many ways may we choose the ice
cream and put it into the dish?
8. In as many ways as you can, show that
n
k
nk
m
n
m
nm
k
49
doubles matches so that each player is in one doubles match? In how many
ways may we do it if we specify in addition who serves first on each team?
10. A town has n streetlights running along the north side of Main Street. The
poles on which they are mounted need to be painted so that they do not
rust. In how many ways may they be painted with red, white, blue, and
green if an even number of them are to be painted green?
11. We have n identical ping-pong balls. In how many ways may we paint them
red, white, blue, and green?
12. We have n identical ping-pong balls. In how many ways may we paint them
red, white, blue, and green if we use green paint on an even number of them?
50
Chapter 2
Applications of Induction and
Recursion in Combinatorics and
Graph Theory
2.1
If you are unfamiliar with the Principle of Mathematical Induction, you should
read Appendix B (a portion of which is repeated here).
2.1.1
Mathematical induction
52
As an example, let us give yet another proof that a set with n elements has 2n
subsets. This proof uses essentially the the same bijections we used in proving the
Pascal Equation. The statement we wish to prove is the statement that A set of
size n has 2n subsets.
Our statement is true when n = 0, because a set of size 0 is the empty
set and the empty set has 1 = 20 subsets. (This step of our proof is
called a base step.)
Now suppose that k > 0 and every set with k 1 elements has 2k1
subsets. Suppose S = {a1 , a2 , . . . ak } is a set with k elements. We
partition the subsets of S into two blocks. Block B1 consists of the
subsets that do not contain an and block B2 consists of the subsets
that do contain an . Each set in B1 is a subset of {a1 , a2 , . . . ak1 },
and each subset of {a1 , a2 , . . . ak1 } is in B1 . Thus B1 is the set of
all subsets of {a1 , a2 , . . . ak1 }. Therefore by our assumption in the
first sentence of this paragraph, the size of B1 is 2k1 . Consider the
function from B2 to B1 which takes a subset of S including ak and
53
54
2.1.2
55
72. When we studied the Pascal Equation and subsets in Chapter 1, it may
have appeared that there is no connection between the Pascal relation nk =
n1
k1
n!
. Of course you probably realize
+ n1
and the formula nk = k!(nk)!
k
you can prove the Pascal relation by substituting the values the formula
gives you into the right-hand side of the equation and simplifying to give
you
the left hand
side. In fact, from the Pascal Relation and
the facts that
n
n
= 1 and n = 1, you can actually prove the formula for nk by induction
0
on n. Do so.
73. Use the fact that (x + y)n = (x + y)(x + y)n1 to give an inductive proof of
the binomial theorem.
74. Suppose that f is a function defined on the nonnegative integers such that
f (0) = 3 and f (n) = 2f (n 1). Find a formula for f (n) and prove your
formula is correct.
+
75. Prove the conjecture in Problem 13b for an arbitrary positive integer m
without appealing to the general product principle.
2.1.3
Inductive definition
You may have seen n! described by the two equations 0! = 1 and n! = n(n 1)!
for n > 0. By the principle of mathematical induction we know that this pair of
equations defines n! for all nonnegative numbers n. For this reason we call such a
56
77. Suppose that f is a function on the nonnegative integers such that f (0) = 0
and f (n) = n + f (n 1). Prove that f (n) = n(n + 1)/2. Notice that this
gives a third proof that 1 + 2 + + n = n(n + 1)/2, because this sum
satisfies the two conditions for f . (The sum has no terms and is thus 0
when n = 0.)
78. Give an inductive definition of the summation notation ni=1 ai . Use it and
the distributive law b(a + c) = ba + bc to prove the distributive law
P
n
X
i=1
ai =
n
X
i=1
bai .
2.1.4
57
58
Qm
i=1
ki
80. Prove the general form of the product principle from the partition form of
the product principle.
2.1.5
In Section 1.3.4 we gave two different descriptions of the Ramsey number R(m, n).
However, if you look carefully, you will see that we never showed that Ramsey
numbers actually exist; we merely described what they were and showed that
59
R(3, 3) and R(3, 4) exist by computing them directly. As long as we can show
that there is some number R such that when there are R people together, there are
either m mutual acquaintances or n mutual strangers, this shows that the Ramsey
Number R(m, n) exists, because it is the
smallest
such R. Mathematical induction
m+n2
allows us to show that one such R is m1 . The question is, what should we
induct on, m or n? In other words, do we use the fact that with m+n3
people
m2
in a room there are at least m 1 mutual
acquaintances
or n mutual strangers, or
do we use the fact that with at least m+n3
people
in
a
room there are at least
n2
m mutual acquaintances or at least n 1 mutual strangers? It turns out that we
use both. Thus we want to be able to simultaneously induct on m and n. One
way to do that is to use yet another variation on the principle of mathematical
induction, the Principle of Double Mathematical Induction. This principle (which
can be derived from one of our earlier ones) states that
60
61
81.
82.
83.
2.1.6
Problem 85 gives us an upper bound on R(n, n). A very clever technique due
to Paul Erdos, called the probabilistic method, will give a lower bound. Since
both bounds are exponential in n, they show that R(n, n) grows exponentially
as n gets large. An analysis of what happens to a function of n as n gets large
is usually called an asymptotic analysis. The probabilistic method, at least in its
62
simpler forms, can be expressed in terms of averages, so one does not need to
know the language of probability in order to understand it. We will apply it to
Ramsey numbers in the next problem.
Combined with the result of Problem 85,
n
this problem will give us that 2 < R(n, n) < 22n2 , so that we know that the
Ramsey number R(n, n) grows exponentially with n.
86. Suppose we have two numbers n and m. We consider all possible ways to
color the edges of the complete graph Km with two colors, say red and blue.
For each coloring, we look at each n-element subset N of the vertex set M
of Km . Then N together with the edges of Km connecting vertices in N
forms a complete graph on n vertices. This graph, which we denote by KN ,
has its edges colored by the original coloring of the edges of Km .
(a) Why is it that, if there is no subset N M so that all the edges of KN
are colored the same color for any coloring of the edges of Km , then
R(n, n) > m?
(b) To apply the probabilistic method, we are going to compute the average, over all colorings of Km , of the number of sets N M with
|N | = n such that KN does have all its edges the same color. Explain
why it is that if the average is less than 1, then for some coloring there
is no set N such that KN has all its edges colored the same color. Why
does this mean that R(n, n) > m?
(c) We call a KN monochromatic for a coloring c of Km if the color c(e)
assigned to edge e is the same for every edge e of KN . Let us define
mono(c, N ) to be 1 if N is monochromatic for c and to be 0 otherwise.
63
m
n
n
2( 2 )1 .
n
n
(f) Explain why R(n, n) > n!2( 2 )1 .
(g)
By using
formula, show that if n is large enough, then R(n, n) >
Stirlings
n
2n = 2 . (Here large enough means large enough for Stirlings formula to be reasonably accurate.)
2.2
Recurrence Relations
87. How is the number of subsets of an n-element set related to the number of
subsets of an (n 1)-element set? Prove that you are correct.
88. Explain why it is that the number of bijections from an n-element set to an
n-element set is equal to n times the number of bijections from an (n 1)element subset to an (n 1)-element set. What does this have to do with
Problem 27?
We can summarize these observations as follows. If sn stands for the number of
subsets of an n-element set, then
sn = 2sn1 ,
(2.1)
64
and if bn stands for the number of bijections from an n-element set to an n-element
set, then
bn = nbn1 .
(2.2)
Equations 2.1 and 2.2 are examples of recurrence equations or recurrence relations.
A recurrence relation or simply a recurrence is an equation that expresses the
nth term of a sequence an in terms of values of ai for i < n. Thus Equations 2.1
and 2.2 are examples of recurrences.
2.2.1
(2.3)
an = 3an1 + 2n ,
(2.4)
(2.5)
(2.6)
65
89. Show that there is only one solution to Recurrence 2.1 that satisfies s0 = 1.
90. A first-order recurrence relation is one which expresses an in terms of an1
and other functions of n, but which does not include any of the terms ai for
i < n 1 in the equation.
(a) Which of the recurrences 2.1 through 2.6 are first order recurrences?
(b) Show that there is one and only one sequence an that is defined for
every nonnegative integer n, satisfies a given first order recurrence,
and satisfies a0 = a for some fixed constant a.
Figure 2.1: The Towers of Hanoi Puzzle
91. The Towers of Hanoi puzzle has three rods rising from a rectangular base
with n rings of different sizes stacked in decreasing order of size on one rod.
A legal move consists of moving a ring from one rod to another so that it
does not land on top of a smaller ring. If mn is the number of moves required
to move all the rings from the initial rod to another rod that you choose,
give a recurrence for mn .
66
92. We draw n mutually intersecting circles in the plane so that each one crosses
each other one exactly twice and no three intersect in the same point. (As
examples, think of Venn diagrams with two or three mutually intersecting
sets.) Find a recurrence for the number rn of regions into which the plane
is divided by n circles. (One circle divides the plane into two regions, the
inside and the outside.) Find the number of regions with n circles. For
what values of n can you draw a Venn diagram showing all the possible
intersections of n sets using circles to represent each of the sets?
2.2.2
93. A child puts away two dollars from her allowance each week. If she starts
with twenty dollars, give a recurrence for the amount an of money she has
after n weeks and find out how much money she has at the end of n weeks.
94. A sequence that satisfies a recurrence of the form an = an1 + c is called an
arithmetic progression. Find a formula in terms of the initial value a0 and
the common difference c for the term an in an arithmetic progression and
prove you are right.
95. A person who is earning $50,000 per year gets a raise of $3000 a year for n
years in a row. Find a recurrence for the amount an of money the person
earns over n + 1 years. What is the total amount of money that the person
earns over a period of n + 1 years? (In n + 1 years, there are n raises.)
96. An arithmetic series is a sequence sn equal to the sum of the terms a0
67
2.2.3
Recurrences such as those in Equations 2.1 through 2.5 are called linear recurrences, as are the recurrences of Problems 91 and 92. A linear recurrence is one
in which an is expressed as a sum of functions of n times values of (some of the
terms) ai for i < n plus (perhaps) another function (called the driving function)
of n. A linear equation is called homogeneous if the driving function is zero (or, in
other words, there is no driving function). It is called a constant coefficient linear
recurrence if the functions that are multiplied by the ai terms are all constants
(but the driving function need not be constant).
97. Classify the recurrences in Equations 2.1 through 2.5 and Problems 91 and
92 according to whether or not they are constant coefficient, and whether
or not they are homogeneous.
98. As you can see from Problem 97 some interesting sequences satisfy first
order linear recurrences, including many that have constant coefficients, have
constant driving term, or are homogeneous. Find a formula in terms of b,
d, a0 and n for the general term an of a sequence that satisfies a constant
coefficient first order linear recurrence an = ban1 + d and prove you are
68
2.2.4
Geometric Series
Pn1
i=0
dbi
69
1 bn
. If b = 1,
Theorem 2 If b 6= 1 and an = ban1 + d, then an = a0 b + d
1b
then an = a0 + nd.
n
n1
X
n1
X
1 bn
Corollary 1 If b 6= 1, then
b =
. If b = 1,
bi = n.
1b
i=0
i=0
2.3
2.3.1
70
6
7
v
z
2
f
c
1
labelled y) to itself or it is possible to have two or more edges (like those between
vertices v and y) between two vertices. The degree of a vertex is the number of
times it appears as the endpoint of edges; thus the degree of y in the third graph
in the figure is four.
100. In the graph on the left in Figure 2.2, what is the degree of each vertex?
101. For each graph in Figure 2.2 is the number of vertices of odd degree even or
71
odd?
102.
103.
What can you say about the number of vertices of odd degree in a graph?
2.3.2
72
106. A cycle in a graph is a walk (with at least one edge) whose first and last
vertex are equal but which has no other repeated vertices or edges. Which
graphs in Figure 2.2 have cycles? What is the largest number of edges in
a cycle in the second graph in Figure 2.2? What is the smallest number of
edges in a cycle in the third graph in Figure 2.2?
107. A connected graph with no cycles is called a tree. Which graphs, if any, in
Figure 2.2 are trees?
2.3.3
108.
Draw some trees and on the basis of your examples, make a conjecture about
the relationship between the number of vertices and edges in a tree. Prove
your conjecture.
109.
110.
In a tree on any number of vertices, given two vertices, how many paths can
you find between them? Prove that you are correct.
111. How many trees are there on the vertex set {1, 2}? On the vertex set
{1, 2, 3}? When we label the vertices of our tree, we consider the tree which
has edges between vertices 1 and 2 and between vertices 2 and 3 different
from the tree that has edges between vertices 1 and 3 and between 2 and 3.
73
See Figure 2.3. How many (labelled) trees are there on four vertices? How
many (labelled) trees are there with five vertices? You dont have a lot of
data to guess from, but try to guess a formula for the number of labelled
trees with vertex set {1, 2, , n}.
We are now going to introduce a method to prove the formula you guessed.
Given a tree with two or more vertices, labelled with positive integers, we define
a sequence b1 , b2 , . . . of integers inductively as follows: If the tree has two vertices,
the sequence consists of one entry, namely the label of the vertex with the larger
label. Otherwise, let a1 be the lowest numbered vertex of degree 1 in the tree.
Let b1 be the label of the unique vertex in the tree adjacent to a1 and write down
b1 . For example, in the first graph in Figure 2.2, a1 is 1 and b1 is 2. Given a1
through ai1 , let ai be the lowest numbered vertex of degree 1 in the tree you
get by deleting a1 through ai1 and let bi be the unique vertex in this new tree
adjacent to ai . For example, in the first graph in Figure 2.2, a2 = 2 and b2 = 3.
Then a3 = 5 and b3 = 4. We use b to stand for the sequence of bi s we get in this
way. In the tree (the first graph) in Figure 2.2, the sequence b is 2344378. (If you
are unfamiliar with inductive (recursive) definition, you might want to write down
74
some other labelled trees on eight vertices and construct the sequence of bi s.)
112. (a) How long will the sequence of bi s be if it is computed from a tree with
n vertices (labelled with 1 through n)?
(b) What can you say about the last member of the sequence of bi s?
(c) Can you tell from the sequence of bi s what a1 is?
(d) Find a bijection between labelled trees and something you can count
that will tell you how many labelled trees there are on n labelled vertices.
The sequence b1 , b2 , . . . , bn2 in Problem 112 is called a Pr
ufer coding or Pr
ufer
code for the tree. Thus the Pr
ufer code for the tree of Figure 2.2 is 234437. Notice
that we do not include the term bn1 in the Pr
ufer code because we know it is n.
There is a good bit of interesting information encoded into the Pr
ufer code for a
tree.
113. What can you say about the vertices of degree one from thePr
ufer code for
a tree labeled with the integers from 1 to n?
114. What can you say about the Pr
ufer code for a tree with exactly two vertices
of degree 1 (and perhaps some vertices with other degrees as well)? Does
this characterize such trees?
115. What can you determine about the degree of the vertex labelled i from the
Pr
ufer code of the tree?
75
116. What is the number of (labelled) trees on n vertices with three vertices of
degree 1? (Assume they are labelled with the integers 1 through n.) This
problem will appear again in the next chapter after some material that will
make it easier.
2.3.4
Spanning trees
Many of the applications of trees arise from trying to find an efficient way to
connect all the vertices of a graph. For example, in a telephone network, at any
given time we have a certain number of wires (or microwave channels, or cellular
channels) available for use. These wires or channels go from a specific place to a
specific place. Thus the wires or channels may be thought of as edges of a graph
and the places the wires connect may be thought of as vertices of that graph. A
tree whose edges are some of the edges of a graph G and whose vertices are all of
the vertices of the graph G is called a spanning tree of G. A spanning tree for
a telephone network will give us a way to route calls between any two vertices in
the network. In Figure 2.4 we show a graph and all its spanning trees.
117. Show that every connected graph has a spanning tree. It is possible to find
a proof that starts with the graph and works down towards the spanning
tree and to find a proof that starts with just the vertices and works up
towards the spanning tree. Can you find both kinds of proof?
76
2.3.5
Our motivation for talking about spanning trees was the idea of finding a minimum
number of edges we need to connect all the edges of a communication network
together. In many cases edges of a communication network come with costs
associated with them. For example, one cell-phone operator charges another one
when a customer of the first uses an antenna of the other. Suppose a company has
offices in a number of cities and wants to put together a communication network
connecting its various locations with high-speed computer communications, but
to do so at minimum cost. Then it wants to take a graph whose vertices are the
cities in which it has offices and whose edges represent possible communications
lines between the cities. Of course there will not necessarily be lines between each
pair of cities, and the company will not want to pay for a line connecting city
77
i and city j if it can already connect them indirectly by using other lines it has
chosen. Thus it will want to choose a spanning tree of minimum cost among all
spanning trees of the communications graph. For reasons of this application, if
we have a graph with numbers assigned to its edges, the sum of the numbers on
the edges of a spanning tree of G will be called the cost of the spanning tree.
118. Describe a method (or better, two methods different in at least one aspect)
for finding a spanning tree of minimum cost in a graph whose edges are
labelled with costs, the cost on an edge being the cost for including that
edge in a spanning tree. Prove that your method(s) work.
The method you used in Problem 118 is called a greedy method, because each
time you made a choice of an edge, you chose the least costly edge available to
you.
2.3.6
There are two operations on graphs that we can apply to get a recurrence (though
a more general kind than those we have studied for sequences) which will let us
compute the number of spanning trees of a graph. The operations each apply to
an edge e of a graph G. The first is called deletion; we delete the edge e from the
graph by removing it from the edge set. Figure 2.5 shows how we can delete edges
from a graph to get a spanning tree.
The second operation is called contraction. Contractions of three different
edges in the same graph are shown in Figure 2.6. Intuitively, we contract an edge
by shrinking it in length until its endpoints coincide; we let the rest of the graph
78
Figure 2.5: Deleting two appropriate edges from this graph gives a spanning tree.
go along for the ride. To be more precise, we contract the edge e with endpoints
v and w as follows:
1. remove all edges having either v or w or both as an endpoint from the edge
set,
2. remove v and w from the vertex set,
3. add a new vertex E to the vertex set,
4. add an edge from E to each remaining vertex that used to be an endpoint
of an edge whose other endpoint was v or w, and add an edge from E to E
for any edge other than e whose endpoints were in the set {v, w}.
We use G e (read as G minus e) to stand for the result of deleting e from G, and
we use G/e (read as G contract e) to stand for the result of contracting e from G.
119.
(a) How do the number of spanning trees of G not containing the edge
e and the number of spanning trees of G containing e relate to the
number of spanning trees of G e and G/e?
79
5
4
e
e
1
(b) Use #(G) to stand for the number of spanning trees of G (so that,
for example, #(G/e) stands for the number of spanning trees of G/e).
Find an expression for #(G) in terms of #(G/e) and #(G e). This
expression is called the deletion-contraction recurrence.
(c) Use the recurrence of the previous part to compute the number of
spanning trees of the graph in Figure 2.7.
80
2.3.7
Suppose that a company has a main office in one city and regional offices in
other cities. Most of the communication in the company is between the main
office and the regional offices, so the company wants to find a spanning tree that
minimizes not the total cost of all the edges, but rather the cost of communication
between the main office and each of the regional offices. It is not clear that such
a spanning tree even exists. This problem is a special case of the following. We
have a connected graph with nonnegative numbers assigned to its edges. (In this
situation these numbers are often called weights.) The (weighted) length of a
path in the graph is the sum of the weights of its edges. The distance between
two vertices is the least (weighted) length of any path between the two vertices.
Given a vertex v, we would like to know the distance between v and each other
vertex, and we would like to know if there is a spanning tree in G such that the
length of the path in the spanning tree from v to each vertex x is the distance
from v to x in G.
81
120. Show that the following algorithm (known as Dijkstras algorithm) applied
to a weighted graph whose vertices are labelled 1 to n gives, for each i, the
distance from vertex 1 to i as d(i).
(a) Let d(1) = 0. Let d(i) = for all other i. Let v(1)=1. Let v(j) = 0
for all other j. For each i and j, let w(i, j) be the minimum weight of
an edge between i and j, or if there are no such edges. Let k = 1.
Let t = 1.
(b) For each i, if d(i) > d(k) + w(k, i) let d(i) = d(k) + w(k, i).
(c) Among those i with v(i) = 0, choose one with d(i) a minimum, and let
k = i. Increase t by 1. Let v(i) = 1.
(d) Repeat the previous two steps until t = n.
121. Is there a spanning tree such that the distance from vertex 1 to vertex i given
by the algorithm in Problem 120 is the distance from vertex 1 to vertex i in
the tree (using the same weights on the edges, of course)?
82
2.4
Supplementary Problems
1. Use the inductive definition of an to prove that (ab)n = an bn for all nonnegative integers n.
2. Give an inductive definition of
n
[
i=1
n
[
Si =
n
[
A Si .
i=1
i=1
83
with Cs and Hs so that each C vertex has degree four and each H vertex
has degree one. A hydrocarbon is called an alkane if the graph is a tree.
Common examples are methane (natural gas), butane (one version of which
is shown in Figure 2.8), propane, hexane (ordinary gasoline), octane (to
make gasoline burn more slowly), etc.
(a) How many vertices are labelled H in the graph of an alkane with exactly
n vertices labelled C?
(b) An alkane is called butane if it has four carbon atoms. Why do we say
one version of butane is shown in Figure 2.8?
4. (a) Give a recurrence for the number of ways to divide 2n people into sets
of two for tennis games. (Dont worry about who serves first.)
(b) Give a recurrence for the number of ways to divide 2n people into sets
of two for tennis games and to determine who serves first.)
5. Give a recurrence for the number of ways to divide 4n people into sets of
four for games of bridge. (Dont worry about how they sit around the bridge
table or who is the first dealer.)
6. Use induction to prove your result in Supplementary Problem 2 at the end
of Chapter 1.
7. Give an inductive definition of the product notation
n
Y
i=1
ai .
84
n
Y
i=1
!k
ai
n
Y
aki .
i=1
9. How many labelled trees on n vertices have exactly four vertices of degree
1? (This problem also appears in the next chapter since some ideas in that
chapter make it more straightforward.)
10. The degree sequence of a graph is a list of the degrees of the vertices in
nonincreasing order. For example the degree sequence of the first graph in
Figure 2.4 is (4, 3, 2, 2, 1). For a graph with vertices labelled 1 through n, the
ordered degree sequence of the graph is the sequence d1 , d2 , . . . dn in which
di is the degree of vertex i. For example the ordered degree sequence of the
first graph in Figure 2.2 is (1, 2, 3, 3, 1, 1, 2, 1).
(a) How many labelled trees are there on n vertices with ordered degree
sequence d1 , d2 , . . . dn ? (This problem appears again in the next chapter
since some ideas in that chapter make it more straightforward.)
(b) How many labelled trees are there on n vertices with with the degree
sequence in which the degree d appears id times?
Chapter 3
Distribution Problems
3.1
86
3.1.1
When we are passing out objects to recipients, we may think of the objects as
being either identical or distinct. We may also think of the recipients as being
either identical (as in the case of putting fruit into plastic bags in the grocery
store) or distinct (as in the case of passing fruit out to children). We may restrict
the distributions to those that give at least one object to each recipient, or those
that give exactly one object to each recipient, or those that give at most one object
to each recipient, or we may have no such restrictions. If the objects are distinct,
it may be that the order in which the objects are received is relevant (think about
putting books onto the shelves in a bookcase) or that the order in which the
objects are received is irrelevant (think about dropping a handful of candy into
a childs trick or treat bag). If we ignore the possibility that the order in which
objects are received matters, we have created 2 2 4 = 16 distribution problems.
In the cases where a recipient can receive more than one distinct object, we also
have four more problems when the order objects are received matters. Thus we
have 20 possible distribution problems.
We describe these problems in Table 3.1. Since there are twenty possible distribution problems, we call the table the Twenty-fold Way, adapting terminology
suggested by Joel Spencer for a more restricted class of distribution problems. In
87
the first column of the table we state whether the objects are distinct (like people)
or identical (like ping-pong balls) and then give any conditions on how the objects
may be received. The conditions we consider are whether each recipient gets at
most one object, whether each recipient gets at least one object, whether each
recipient gets exactly one object, and whether the order in which the objects are
received matters. In the second column we give the solution to the problem and
the name of the mathematical model for this kind of distribution problem when
the recipients are distinct, and in the third column we give the same information when the recipients are identical. We use question marks as the answers to
problems we have not yet solved and models we have not yet studied. We give
explicit answers to problems we solved in Chapter 1 and problems whose answers
are immediate. The goal of this chapter is to develop methods that will allow us
to fill in the table with formulas or at least quantities we know how to compute,
and we will give a completed table at the end of the chapter. We will now justify
the answers that are not question marks and replace some question marks with
answers as we cover relevant material.
If we pass out k distinct objects (say pieces of fruit) to n distinct recipients
(say children), we are saying for each object to which recipient it goes. Thus
we are defining a function from the set of objects to the recipients. We saw the
following theorem in Problem 13b.
Theorem 3 There are nk functions from a k-element set to an n-element set.
We proved it in one way in Problem 13b and in another way in Problem 75. If we
pass out k distinct objects (say pieces of fruit) to n indistinguishable recipients
(say identical paper bags) then we are dividing the objects up into disjoint sets;
88
that is, we are forming a partition of the objects into some number, certainly no
more than the number k of objects, of parts. Later in this chapter (and again in
the next chapter) we shall discuss how to compute the number of partitions of a
k-element set into n parts. This explains the entries in row one of our table.
If we pass out k distinct objects to n recipients so that each gets at most one,
we still determine a function, but the function must be one-to-one. The number
of one-to-one functions from a k-element set to an n element set is the same as the
number of one-to-one functions from the set [k] = {1, 2, . . . , k} to an n-element
set. In Problem 20 we proved the following theorem.
Theorem 4 If 0 k n, then the number of k-element permutations of an
n-element set is
nk = n(n 1) (n k + 1) = n!/(n k)!.
89
from a k-element set onto an n-element set. At present we do not know how to
compute the number of such functions, but we will discuss how to do so later in
this chapter and in the next chapter. If we distribute k identical objects to n
recipients, we are again simply partitioning the objects, but the condition that
each recipient gets at least one means that we are partitioning the objects into
exactly n blocks. Again, we will discuss how to compute the number of ways of
partitioning a set of k objects into n blocks later in this chapter. This explains
the entries in row three of our table.
If we pass out k distinct objects to n recipients so that each gets exactly one,
then k = n and the function that our distribution gives us is a bijection. The
number of bijections from an n-element set to an n-element set is n! by Theorem
4. If we pass out k distinct objects to n identical recipients so that each gets
exactly 1, then in this case it doesnt matter which recipient gets which object,
so the number of ways to do so is 1 if k = n. If k 6= n, then the number of such
distributions is zero. This explains the entries in row four of our table.
We now jump to row eight of our table. We saw in Problem 37 that the number
of ways to pass out k identical ping-pong balls to n children is simply the number
of k-element subsets of an n-element set. In Problem 39d we proved the following
theorem.
Theorem 5 If 0 k n, the number of k-element subsets of an n-element set
is given by
!
n!
nk
n
=
.
=
k!
k!(n k)!
k
We define
n
k
90
an n-element set. Notice that this is what the middle term of the formula in the
theorem gives us. This explains the entries of row 8 of our table. For now we
jump over row 9.
In row 10 of our table, if we are passing out k identical objects to n recipients
so that each gets exactly one, it doesnt matter whether the recipients are identical
or not; there is only one way to pass out the objects if k = n and otherwise it
is impossible to make the distribution, so there are no ways of distributing the
objects. This explains the entries of row 10 of our table. Several other rows of
our table can be computed using the methods of Chapter 1.
3.1.2
Ordered functions
122. Suppose we wish to place k distinct books onto the shelves of a bookcase
with n shelves. For simplicity, assume for now that all of the books would
fit on any of the shelves. Also, lets imagine that once we are done putting
books on the shelves, we push the books on a shelf as far to the left as we
can, so that we are only thinking about how the books sit relative to each
other, not about the exact places where we put the books. Since the books
are distinct, we can think of the first book, the second book and so on.
(a) How many places are there where we can place the first book?
(b) When we place the second book, if we decide to place it on the shelf
that already has a book, does it matter if we place it to the left or right
of the book that is already there?
91
(c) How many places are there where we can place the second book? nce
we have i 1 books placed, if we want to place book i on a shelf that
already has some books, is sliding it in to the left of all the books
already there different from placing it to the right of all the books
already there or between two books already there?
(d) In how many ways may we place the ith book into the bookcase?
(e) In how many ways may we place all the books?
123. Suppose we wish to place the books in Problem 122e (satisfying the assumptions we made there) so that each shelf gets at least one book. Now in how
many ways may we place the books?
The assignment of which books go to which shelves of a bookcase is simply a
function from the books to the shelves. But a function doesnt determine which
book sits to the left of which others on the shelf, and this information is part of
how the books are arranged on the shelves. In other words, the order in which
the shelves receive their books matters. Our function must thus assign an ordered
list of books to each shelf. We will call such a function an ordered function. More
precisely, an ordered function from a set S to a set T is a function that assigns
an (ordered) list of elements of S to some, but not necessarily all, elements of T
in such a way that each element of S appears on one and only one of the lists.1
(Notice that although it is not the usual definition of a function from S to T ,
1
The phrase ordered function is not a standard one, because there is as yet no standard name
for the result of an ordered distribution problem.
92
k
Y
i=1
enough that it has a name; it is called the kth rising factorial power of n and
is denoted by nk . It is read as n to the k rising. (This notation is due to
Don Knuth, who also suggested the notation for falling factorial powers.) We can
summarize with a theorem that adds two more formulas for the number of ordered
functions.
Theorem 6 The number of ordered functions from a k-element set to an nelement set is
k
n =
k
Y
i=1
(n + i 1) =
(n + k 1)!
= (n + k 1)k .
(n 1)!
Ordered functions explain the entries in the middle column of rows 5 and 6 of
our table of distribution problems.
3.1.3
93
Multisets
In the middle column of row 7 of our table, we are asking for the number of ways
to distribute k identical objects (say ping-pong balls) to n distinct recipients (say
children).
124. In how many ways may we distribute k identical books on the shelves of a
bookcase with n shelves, assuming that any shelf can hold all the books?
125. A multiset chosen from a set S may be thought of as a subset with repeated
elements allowed. To determine a multiset we must say how many times
(including, perhaps, zero) each member of S appears in the multiset. The
number of times an element appears is called its multiplicity. For example
if we choose three identical red marbles, six identical blue marbles and four
identical green marbles, from a bag of red, blue, green, white and yellow
marbles then the multiplicity of a red marble in our multiset is three, while
the multiplicity of a yellow marble is zero. The size of a multiset is sum of
the multiplicities of its elements. For example if we choose three identical
red marbles, six identical blue marbles and four identical green marbles, then
the size of our multiset of marbles is 13. What is the number of multisets
of size k that can be chosen from an n-element set?
126. Your answer in the previous problem should be expressible as a binomial coefficient. Since a binomial coefficient counts subsets, find a bijection between
subsets of something and multisets chosen from a set S.
94
127. How many solutions are there in nonnegative integers to the equation x1 +
x2 + + xm = r, where m and r are constants?
128. In how many ways can we distribute k identical objects to n distinct recipients so that each recipient gets at least m?
Multisets explain the entry in the middle column of row 7 of our table of
distribution problems.
3.1.4
Compositions of integers
129.
In how many ways may we put k identical books onto n shelves if each shelf
must get at least one book?
130.
131. Your answer in Problem 130 can be expressed as a binomial coefficient. This
means it should be possible to interpret a composition as a subset of some
set. Find a bijection between compositions of k into n parts and certain
subsets of some set. Explain explicitly how to get the composition from the
subset and the subset from the composition.
132.
Explain the connection between compositions of k into n parts and the problem of distributing k identical objects to n recipients so that each recipient
gets at least one.
95
The sequence of problems you just completed should explain the entry in the
middle column of row 9 of our table of distribution problems.
3.1.5
133.
In how many ways may we stack k distinct books into n identical boxes so
that there is a stack in every box?
We can think of stacking books into identical boxes as partitioning the books
and then ordering the blocks of the partition. This turns out not to be a useful
computational way of visualizing the problem because the number of ways to order
the books in the various stacks depends on the sizes of the stacks and not just
the number of stacks. However, instead of dividing a set up into non-overlapping
parts, we may think of dividing a permutation (thought of as a list) of our k objects
up into n ordered blocks. We will say that a set of ordered lists of elements of
a set S is a broken permutation of S if each element of S is in one and only
one of these lists.2 The number of broken permutations of a k-element set with n
blocks is denoted by L(k, n). The number L(k, n) is called a Lah
(this is
Number
k1
standard) and, from our solution to Problem 133, is equal to k! n1 /n!.
The Lah numbers are the solution to the question In how many ways may
we distribute k distinct objects to n identical recipients if order matters and each
recipient must get at least one? Thus they give the entry in row 6 and column 3
of our table. The entry in row 5 and column 3 of our table will be the number of
2
The phrase broken permutation is not standard, because there is no standard name for the
solution to this kind of distribution problem.
96
broken permutations with less than or equal to n parts. Thus it is a sum of Lah
numbers.
We have seen that ordered functions and broken permutations explain the
entries in rows 5 and 6 of our table.
In the next two sections we will give ways of computing the remaining entries.
3.2
We have seen how the number of partitions of a set of k objects into n blocks
corresponds to the distribution of k distinct objects to n identical recipients.
While there is a formula that we shall eventually learn for this number, it requires
more machinery than we now have available. However there is a good method for
computing this number that is similar to Pascals equation. Now that we have
studied recurrences in one variable, we will point out that Pascals
equation is in
n
fact a recurrence in two variables; that is, it lets us compute k in terms of values
of
m
i
in which either m < n or i < k or both. It was the fact that we had such
3.2.1
n
0
and
n
n
We use the notation S(k, n) to stand for the number of partitions of a k element
set with n blocks. For historical reasons, S(k, n) is called a Stirling Number of the
second kind.
97
134. In a partition of the set [k], the number k is either in a block by itself, or it
is not. How does the number of partitions of [k] with n parts in which k is
in a block with other elements of [k] compare to the number of partitions of
[k 1] into n blocks? Find a two-variable recurrence for S(k, n), valid for k
and n larger than one.
135. What is S(k, 1)? What is S(k, k)? Create a table of values of S(k, n) for
k between 1 and 5 and n between 1 and k. This table is sometimes called
Stirlings Triangle (of the second kind). How would you define S(k, 0) and
S(0, n)? (Note that the previous question includes S(0, 0).) How would you
define S(k, n) for n > k? Now for what values of k and n is your two variable
recurrence valid?
136. Extend Stirlings triangle enough to allow you to answer the following question and answer it. (Dont fill in the rows all the way; the work becomes
quite tedious if you do. Only fill in what you need to answer this question.) A caterer is preparing three bag lunches for hikers. The caterer has
nine different sandwiches. In how many ways can these nine sandwiches be
distributed into three identical lunch bags so that each bag gets at least
one?
137. The question in Problem 136 naturally suggests a more realistic question; in
how many ways may the caterer distribute the nine sandwiches into three
identical bags so that each bag gets exactly three? Answer this question.
138.
98
139. In how many ways can we partition k (distinct) items into n blocks so
P
that we have ki blocks of size i for each i? (Notice that ki=1 ki = n and
Pk
i=1 iki = k.) The sequence k1 , k2 , . . . , kn is called the type vector of the
partition.
+
140. Describe how to compute S(n, k) in terms of quantities given by the formula
you found in Problem 139.
141. Find a recurrence for the Lah numbers L(k, n) similar to the one in Problem
134.
142.
3.2.2
143. Given a function f from a k-element set K to an n-element set, we can define
a partition of K by putting x and y in the same block of the partition if and
only if f (x) = f (y). How many blocks does the partition have if f is onto?
99
How is the number of functions from a k-element set onto an n-element set
related to a Stirling number? Be as precise in your answer as you can.
144. How many labeled trees on n vertices have exactly 3 vertices of degree one?
Note that this problem has appeared before in Chapter 2.
145. Each function from a k-element set K to an n-element set N is a function
from K onto some subset of N . If J is a subset of N of size j, you know how
to compute the number of functions that map onto J in terms of Stirling
numbers. Suppose you add the number of functions mapping onto J over all
possible subsets J of N . What simple value should this sum equal? Write
the equation this gives you.
146. In how many ways can the sandwiches of Problem 136 be placed into three
distinct bags so that each bag gets at least one?
147. In how many ways can the sandwiches of Problem 137 be placed into distinct
bags so that each bag gets exactly three?
148. In how many ways may we label the elements of a k element set with n
distinct labels (numbered 1 through n) so that label i is used ji times? ( If
we think of the labels as y1 , y2 , . . . , yn , then we can rephrase this question
as follows. How many functions are there from a k-element set K to a set
N = {y1 , y2 , . . . yn } so that each yi is the image of ji elements of K?) This
number is called a multinomial coefficient and denoted by
!
k
.
j1 , j2 , . . . , jn
100
149. Explain how to compute the number of functions from a k-element set K to
an n-element set N by using multinomial coefficients.
150. Explain how to compute the number of functions from a k-element set K
onto an n-element set N by using multinomial coefficients.
151. What do multinomial coefficients have to do with expanding the kth power
of a multinomial x1 + x2 + + xn ? This result is called the multinomial
theorem.
3.2.3
152.
You showed in Problem 152b how to get each power of x in terms of the falling
factorial powers xj . Therefore every polynomial in x is expressible in terms of a
sum of numerical multiples of falling factorial powers. Using the language of linear
101
algebra, we say that the ordinary powers of x and the falling factorial powers of x
each form a basis for the space of polynomials, and that the numbers S(k, n) are
change of basis coefficients. If you are not familiar with linear algebra, a basis
for the space of polynomials3 is a set of polynomials such that each polynomial,
whether in that set or not, can be expressed in one and only one way as a sum of
numerical multiples of polynomials in the set.
153. Show that every power of x+1 is expressible as a sum of numerical multiples
of powers of x. Now show that every power of x (and thus every polynomial
in x) is a sum of numerical multiples (some of which could be negative) of
powers of x+1. This means that the powers of x+1 are a basis for the space
of polynomials as well. Describe the change of basis coefficients that we use
to express the binomial powers (x+1)n in terms of the ordinary xj explicitly.
Find the change of basis coefficients we use to express the ordinary powers
xn in terms of the binomial powers (x + 1)k .
154.
The space of polynomials is just another name for the set of all polynomials.
(3.1)
102
155. Write down the rows of Stirlings triangle of the first kind for k = 0 to 6.
By definition, the Stirling numbers of the first kind are also change of basis
coefficients. The Stirling numbers of the first and second kind are change of basis
coefficients from the falling factorial powers of x to the ordinary factorial powers,
and vice versa.
156. Explain why every rising factorial polynomial xk can be expressed as a sum
of multiples of the falling factorial polynomials xn . Let b(k, n) stand for the
change of basis coefficients that allow us to express xk in terms of the falling
factorial polynomials xn ; that is, define b(k, n) by the equations
xk =
k
X
b(k, n)xn .
n=0
103
(d) Say as much as you can (but say it precisely) about the change of basis
coefficients for expressing xk in terms of xn .
3.3
Partitions of Integers
We have now completed all our distribution problems except for those in which
both the objects and the recipients are identical. For example, we might be
putting identical apples into identical paper bags. In this case all that matters is
how many bags get one apple (how many recipients get one object), how many
get two, how many get three, and so on. Thus for each bag we have a number,
and the multiset of numbers of apples in the various bags is what determines our
distribution of apples into identical bags. A multiset of positive integers that add
to n is called a partition of n. Thus the partitions of 3 are 1+1+1, 1+2 (which
is the same as 2+1) and 3. The number of partitions of k is denoted by P (k); in
computing the partitions of 3 we showed that P (3) = 3. It is traditional to use
Greek letters like (the Greek letter is pronounced LAMB duh) to stand for
partitions; we might write = 1, 1, 1, = 2, 1 and = 3 to stand for the three
partitions of three. We also write = 13 as a shorthand for = 1, 1, 1, and we
write a 3 as a shorthand for is a partition of three.
157. Find all partitions of 4 and find all partitions of 5, thereby computing P (4)
and P (5).
104
3.3.1
3.3.2
Representations of partitions
159. How many solutions are there in the positive integers to the equation x1 +
x2 + x3 = 7 with x1 x2 x3 ?
160. Explain the relationship between partitions of k into n parts and lists x1 , x2 ,. . . ,
xn of positive integers that add to k with x1 x2 . . . xn . Such a representation of a partition is called a decreasing list representation of the
partition.
161. Describe the relationship between partitions of k and lists or vectors (x1 , x2 , . . . , xn )
such that x1 + 2x2 + . . . kxk = k. Such a representation of a partition is
called a type vector representation of a partition, and it is typical to leave
the trailing zeros out of such a representation; for example (2, 1) stands for
the same partition as (2, 1, 0, 0). What is the decreasing list representation
for this partition, and what number does it partition?
105
162. How does the number of partitions of k relate to the number of partitions
of k + 1 whose smallest part is one?
When we write a partition as = 1 , 2 , . . . , n , it is customary to write the
list of i s as a decreasing list. When we have a type vector (t1 , t2 , . . . , tm ) for
a partition, we write either = 1t1 2t2 mtm or = mtm (m 1)tm1 2t2 1t1 .
Henceforth we will use the second of these. When we write = i11 i22 inn , we
will assume that i > i+1 .
3.3.3
106
163. Draw the Young diagram of the partition (4,4,3,1,1). Describe the geometric
relationship between the Young diagram of (5,3,3,2) and the Young diagram
of (4,4,3,1,1).
164. The partition (1 , 2 , . . . , n ) is called the conjugate of the partition (1 , 2 , . . . , m )
if we obtain the Young diagram of one from the Young diagram of the other
by flipping one around the line with slope -1 that extends the diagonal of
the top left square. See Figure 3.2 for an example. What is the conjugate
Figure 3.2: The Ferrers diagram the partition (5,3,3,2) and its conjugate.
107
of parts of its conjugate? What does this tell you about the number of
partitions of a positive integer k with largest part m?
165. A partition is called self-conjugate if it is equal to its conjugate. Find a
relationship between the number of self-conjugate partitions of k and the
number of partitions of k into distinct odd parts.
166. Explain the relationship between the number of partitions of k into even
parts and the number of partitions of k into parts of even multiplicity, i.e.
parts which are each used an even number of times as in (3,3,3,3,2,2,1,1).
167. Show that the number of partitions of k into four parts equals the number
of partitions of 3k into four parts of size at most k 1 (or 3k 4 into four
parts of size at most k 2 or 3k + 4 into four parts of size at most k).
168. The idea of conjugation of a partition could be defined without the geometric
interpretation of a Young diagram, but it would seem far less natural without
the geometric interpretation. Another idea that seems much more natural
in a geometric context is this. Suppose we have a partition of k into n parts
with largest part m. Then the Young diagram of the partition can fit into
a rectangle that is m or more units wide (horizontally) and n or more units
deep. Suppose we place the Young diagram of our partition in the top lefthand corner of an m0 unit wide and n0 unit deep rectangle with m0 m and
n0 n, as in Figure 3.3.
(a) Why can we interpret the part of the rectangle not occupied by our
Young diagram, rotated in the plane, as the Young diagram of an-
108
109
the smallest rectangle it will fit into, and continue the process until we get
the partition 1 of one into one part. What can you say about the partition
with which we started?
170. Show that P (k, n) is at least
1 k1
n! n1
With the binomial coefficients, with Stirling numbers of the second kind, and
with the Lah numbers, we were able to find a recurrence by asking what happens
to our subset, partition, or broken permutation of a set S of numbers if we remove
the largest element of S. Thus it is natural to look for a recurrence to count the
number of partitions of k into n parts by doing something similar. Unfortunately,
since we are counting distributions in which all the objects are identical, there is no
way for us to identify a largest element. However if we think geometrically, we can
ask what we could remove from a Young diagram to get a Young diagram. Two
natural ways to get a partition of a smaller integer from a partition of n would be
to remove the top row of the Young diagram of the partition and to remove the left
column of the Young diagram of the partition. These two operations correspond
to removing the largest part from the partition and to subtracting 1 from each
part of the partition respectively. Even though they are symmetric with respect
to conjugation, they arent symmetric with respect to the number of parts. Thus
one might be much more useful than the other for finding a recurrence for the
number of partitions of k into n parts.
171.
In this problem we will study the two operations and see which one seems
more useful for getting a recurrence for P (k, n). Part of the reason
110
111
not so easy.)
(d) Find a recurrence (which need not have just two terms on the right hand
side) that describes how to compute P (k, n) in terms of the number of
partitions of smaller integers into a smaller number of parts.
(e) What is P (k, 1) for a positive integer k?
(f) What is P (k, k) for a positive integer k?
(g) Use your recurrence to compute a table with the values of P (k, n) for
values of k between 1 and 7.
(h) What would you want to fill into row 0 and column 0 of your table
in order to make it consistent with your recurrence? What does this
say P (0, 0) should be? We usually define a sum with no terms in it to
be zero. Is that consistent with the way the recurrence says we should
define P (0, 0)?
It is remarkable that there is no known formula for P (k, n), nor is there one for
P (k). This section is devoted to developing methods for computing values of
P (n, k) and finding properties of P (n, k) that we can prove even without knowing
a formula. Some future sections will attempt to develop other methods.
We have seen that the number of partitions of k into n parts is equal to
the number of ways to distribute k identical objects to n recipients so that each
receives at least one. If we relax the condition that each recipient receives at
least one, then we see that the number of distributions of k identical objects to
P
n recipients is ni=1 P (k, i) because if some recipients receive nothing, it does not
112
matter which recipients these are. This completes rows 7 and 8 of our table of
distribution problems. The completed table is shown in Figure 3.2. Every entry
in that table tells us how to count something. There are quite a few theorems
that you have proved which are summarized by Table 3.2. It would be worthwhile
to try to write them all down! The methods we used to complete Figure 3.2 are
extensions of the basic counting principles we learned in Chapter 1. The remaining
chapters of this book develop more sophisticated kinds of tools that let us solve
more sophisticated kinds of counting problems.
3.3.4
Often Q(k, n) is used to denote the number of partitions of k into distinct parts,
that is, parts that are different from each other.
172. Show that
1 k1
.
Q(k, n)
n! n 1
173. Show that the number of partitions of seven into three parts equals the
number of partitions of 10 into three distinct parts.
174.
There is a relationship between P (k, n) and Q(m, n) for some other number
m. Find the number m that gives you the nicest possible relationship.
175.
Find a recurrence that expresses Q(k, n) as a sum of Q(k n, m) for appropriate values of m.
113
176. Show that the number of partitions of k into distinct parts equals the number
of partitions of k into odd parts.
2
177. Euler showed that if k 6= 3j 2+j , then the number of partitions of k into an
even number of distinct parts is the same as the number of partitions of k
into an odd number of distinct parts. Prove this, and in the exceptional
case find out how the two numbers relate to each other.
3.3.5
Supplementary Problems
n+k1
k
n+k1
n
n1
k1
k1
n1
n
k
k
n
, nk , k n ,
(a) In how many ways may we pass out k identical pieces of candy to n
children?
(b) In how many ways may we pass out k distinct pieces of candy to n
children?
(c) In how many ways may we pass out k identical pieces of candy to n
children so that each gets at most one? (Assume k n.)
(d) In how many ways may we pass out k distinct pieces of candy to n
children so that each gets at most one? (Assume k n.)
(e) In how many ways may we pass out k distinct pieces of candy to n
children so that each gets at least one? (Assume k n.)
114
115
(g) Answer the question in Part 2f assuming that every family must get a
tree.
(h) Answer the question in Part 2e assuming that each family must get at
least one tree.
3. In how many ways can n identical chemistry books, r identical mathematics
books, s identical physics books, and t identical astronomy books be arranged on three bookshelves? (Assume there is no limit on the number of
books per shelf.)
4. One formula for the Lah numbers is
!
k
L(k, n) =
(k 1)kn
n
Find a proof that explains this product.
5. What is the number of partitions of n into two parts?
6.
7. Show that the number of partitions of k into n parts of size at most m equals
the number of partitions of mn k into no more than n parts of size at most
m 1.
8. Show that the number of partitions of k into parts of size at most m is equal
to the number of partitions of k + m into m parts.
116
k1
S(k i, n 1)
.
S(k, n) =
i1
i=1
12. Let c(k, n) be the number of ways for k children to hold hands to form
n circles, where one child clasping his or her hands together and holding
them out to form a circle is considered a circle. (Having Mary hold Sams
right hand is different from having Mary hold Sams left hand.) Find a
recurrence for c(k, n). Is the family of numbers c(k, n) related to any of the
other families of numbers we have studied? If so, how?
13. How many labeled trees on n vertices have exactly four vertices of degree
1?
14. The degree sequence of a graph is a list of the degrees of the vertices in
non-increasing order. For example the degree sequence of the first graph in
Figure 2.4 is (4, 3, 2, 2, 1). For a graph with vertices labeled 1 through n, the
117
118
n;
0 otherwise
k
Each gets at most one
subsets
9. Identical
?
?
Each gets at least one
?
?
10. Identical
1 if k = n; 0 otherwise
1 if k = n; 0 otherwise
Each gets exactly one
119
Table 3.2: The number of ways to distribute k objects to n recipients, with restrictions on how the objects are received
The Twenty-fold Way: A Table of Distribution Problems
k objects and conditions
n recipients and mathematical model for distribution
on how they are received
Distinct
Identical
P
k
1. Distinct
nk
i=1 S(n, i)
no conditions
functions
set partitions ( n parts)
2. Distinct
Each gets at most one
3. Distinct
Each gets at least one
4. Distinct
Each gets exactly one
5. Distinct, order matters
6. Distinct, order matters
Each gets at least one
7. Identical
no conditions
8. Identical
Each gets at most one
9. Identical
Each gets at least one
10. Identical
Each gets exactly one
nk
k-element permutations
S(k, n)n!
onto functions
k! = n!
permutations
(k + n 1)k
ordered functions
1 if k n; 0 otherwise
S(k, n)
set partitions (n parts)
1 if k = n; 0 otherwise
Pn
i=1 L(k, i)
broken permutations ( n parts)
(k)n (k 1)kn
L(k, n) = nk (k 1)kn
ordered onto functions broken permutations (n parts)
Pn
n+k1
i=1 P (k, i)
k
multisets
number partitions ( n parts)
n
1 if k n; 0 otherwise
k
subsets
k1
P (k, n)
n1
compositions (n parts)
number partitions (n parts)
1 if k = n; 0 otherwise
1 if k = n; 0 otherwise
120
Chapter 4
Generating Functions
4.1
4.1.1
Suppose you are going to choose three pieces of fruit from among apples, pears
and bananas for a snack. We can symbolically represent all your choices as
+
Here we are using a picture of a piece of fruit to stand for taking a piece of that
fruit. Thus
stands for taking an apple,
for taking an apple and a pear,
and
for taking two apples. You can think of the plus sign as standing for the
exclusive or, that is, + would stand for I take an apple or a banana but
121
122
. We
not both. To say I take both an apple and a banana, we would write
can extend the analogy to mathematical notation by condensing our statement
that we take three pieces of fruit to
3
In this notation 3 stands for taking a multiset of three apples, while 2 stands
for taking a multiset of two apples and a banana, and so on. What our notation
is really doing is giving us a convenient way to list all three element multisets
chosen from the set { , , }.1
Suppose now that we plan to choose between one and three apples, between
one and two pears, and between one and two bananas. In a somewhat clumsy
way we could describe our fruit selections as
+
+ +
+ +
2 2
+ +
+ +
2 2
. (4.1)
123
179. Substitute x for all of A, P and B (or for the corresponding pictures) in the
formula you got in Problem 178 and expand the result in powers of x. Give
an interpretation of the coefficient of xn .
If we were to expand the formula
( +
)( +
)( +
),
(4.2)
we would get Formula 4.1. Thus Formula 4.1 and Formula 4.2 each describe
the number of multisets we can choose from the set { , , } in which appears
between one and three times, and and each appear once or twice. We interpret
Formula 4.1 as describing each individual multiset we can choose, and we interpret
Formula 4.2 as saying that we first decide how many apples to take, and then
decide how many pears to take, and then decide how many bananas to take. At
this stage it might seem a bit magical that doing ordinary algebra with the second
formula yields the first, but in fact we could define addition and multiplication
with these pictures more formally so we could explain in detail why things work
out. However, since the pictures are for motivation, and are actually difficult to
write out on paper, it doesnt make much sense to work out these details. We will
see an explanation in another context later on.
4.1.2
Picture functions
As youve seen, in our descriptions of ways of choosing fruits, weve treated the
pictures of the fruit as if they are variables. Youve also likely noticed that it is
much easier to do algebraic manipulations with letters rather than pictures, simply
124
because it is time consuming to draw the same picture over and over again, while
we are used to writing letters quickly. In the theory of generating functions,
we associate variables or polynomials or even power series with members of a
set. There is no standard language describing how we associate variables with
members of a set, so we shall invent2 some. By a picture of a member of a set we
will mean a variable, or perhaps a product of powers of variables (or even a sum
of products of powers of variables). A function that assigns a picture P (s) to each
member s of a set S will be called a picture function. The picture enumerator
for a picture function P defined on a set S will be the sum of the pictures of the
elements in S. In symbols we can write this conveniently as.
EP (S) =
P (s).
s:sS
182.
125
(Used in Chapter 6.) Notice that when we used A2 to stand for taking two
apples, and P 3 to stand for taking three pears, then we used the product
A2 P 3 to stand for taking two apples and three pears. Thus we have chosen
the picture of the ordered pair (2 apples, 3 pears) to be the product of the
pictures of a multiset of two apples and a multiset of three pears. Show
that if S1 and S2 are sets with picture functions P1 and P2 defined on
them, and if we define the picture of an ordered pair (x1 , x2 ) S1 S2 to
be P ((x1 , x2 )) = P1 (x1 )P2 (x2 ), then the picture enumerator of P on the set
S1 S2 is EP1 (S1 )EP2 (S2 ). We call this the product principle for picture
enumerators.
4.1.3
Generating functions
183. Suppose you are going to choose a snack of between zero and three apples,
between zero and three pears, and between zero and three bananas. Write
down a polynomial in one variable x such that the coefficient of xn is the
number of ways to choose a snack with n pieces of fruit.
184. Suppose an apple costs 20 cents, a banana costs 25 cents, and a pear costs
30 cents. What should you substitute for A, P , and B in Problem 181 in
order to get a polynomial in which the coefficient of xn is the number of
ways to choose a selection of fruit that costs n cents?
185. Suppose an apple has 40 calories, a pear has 60 calories, and a banana has
80 calories. What should you substitute for A, P , and B in Problem 181
126
186. We are going to choose a subset of the set [n] = {1, 2, . . . , n}. Suppose we
use x1 to be the picture of choosing 1 to be in our subset. What is the
picture enumerator for either choosing 1 or not choosing 1? Suppose that
for each i between 1 and n, we use xi to be the picture of choosing i to
be in our subset. What is the picture enumerator for either choosing i or
not choosing i to be in our subset? What is the picture enumerator for all
possible choices of subsets of [n]? What should we substitute for xi in order
to get a polynomial in x such that the coefficient of xk is the number of ways
to choose a k-element subset of n? What theorem have we just reproved (a
special case of)?
In Problem 186 we see that we can think of the process of expanding
the polynon
mial (1 + x) as a way of generating the binomial coefficients nk as the coefn
ficients of xk in the expansion of (1 + x)n . For this reason,
we say that (1 + x)
is the generating function for the binomial coefficients nk . More generally, the
generating function for a sequence ai , defined for i with 0 i n is the exP
pression ni=0 ai xi , and the generating function for the sequence ai with i 0
P
i
is the expression
i=0 ai x . This last expression is an example of a power series.
In calculus it is important to think about whether a power series converges in
order to determine whether or not it represents a function. In a nice twist of language, even though we use the phrase generating function as the name of a power
series in combinatorics, we dont require the power series to actually represent a
127
function in the usual sense, and so we dont have to worry about convergence.3
Instead we think of a power series as a convenient way of representing the terms
of a sequence of numbers of interest to us. The only justification for saying that
such a representation is convenient is because of the way algebraic properties of
power series capture some of the important properties of some sequences that are
of combinatorial importance. The remainder of this chapter is devoted to giving
examples of how the algebra of power series reflects combinatorial ideas.
Because we choose to think of power series as strings of symbols that we
manipulate by using the ordinary rules of algebra and we choose to ignore issues
of convergence, we have to avoid manipulating power series in a way that would
require us to add infinitely many real numbers. For example, we cannot make the
P
i
substitution of y +1 for x in the power series
i=0 x , because in order to interpret
P
i
i=0 (y + 1) as a power series we would have to apply the binomial theorem to
each of the (y + 1)i terms, and then collect like terms, giving us infinitely many
ones added together as the coefficient of y 0 , and in fact infinitely many numbers
added together for the coefficient of any y i . (On the other hand, it would be fine
to substitute y + y 2 for x. Can you see why?)
3
In the evolution of our current mathematical terminology, the word function evolved through
several meanings, starting with very imprecise meanings and ending with our current rather
precise meaning. The terminology generating function may be thought of as an example of
one of the earlier usages of the term function.
128
4.1.4
Power series
For now, most of our uses of power series will involve just simple algebra. Since
we use power series in a different way in combinatorics than we do in calculus, we
should review a bit of the algebra of power series.
187. In the polynomial (a0 + a1 x + a2 x2 )(b0 + b1 x + b2 x2 + b3 x3 ), what is the
coefficient of x2 ? What is the coefficient of x4 ?
188. In Problem 187 why is there a b0 and a b1 in your expression for the coefficient
of x2 but there is not a b0 or a b1 in your expression for the coefficient of x4 ?
What is the coefficient of x4 in
(a0 + a1 x + a2 x2 + a3 x3 + a4 x4 )(b0 + b1 x + b2 x2 + b3 x3 + b4 x4 )?
Express this coefficient in the form
4
X
something,
i=0
where the something is an expression you need to figure out. Now suppose
that a3 = 0, a4 = 0, and b4 = 0. To what is your expression equal after
you substitute these values? In particular, what does this have to do with
Problem 187?
189. The point of the Problems 187 and 188 is that so long as we are willing to
assume ai = 0 for i > n and bj = 0 for j > m, then there is a very nice
129
! m
X
ai x i b j x j .
i=0
j=0
!
X
j
ai x b j x .
i=0
j=0
We use the expression you obtained in Problem 190 to define the product of
power series. That is, we define the product
X
i=0
!
X
ai x i b j x j
j=0
k
to be the power series
k=0 ck x , where ck is the expression you found in Problem
190. Since you derived this expression by using the usual rules of algebra for
polynomials, it should not be surprising that the product of power series satisfies
these rules.4
4
Technically we should explicitly state these rules and prove that they are all valid for power
series multiplication, but it seems like overkill at this point to do so!
130
4.1.5
Each time that we converted a picture function to a generating function by substituting x or some power of x for each picture, the coefficient of x had a meaning
that was significant to us. For example, with the picture enumerator for selecting
between zero and three each of apples, pears, and bananas, when we substituted
x for each of our pictures, the exponent i in the power xi is the number of pieces
of fruit in the fruit selection that led us to xi . After we simplify our product by
collecting together all like powers of x, the coefficient of xi is the number of fruit
selections that use i pieces of fruit. In the same way, if we substitute xc for a
picture, where c is the number of calories in that particular kind of fruit, then
the i in an xi term in our generating function stands for the number of calories
in a fruit selection that gave rise to xi , and the coefficient of xi in our generating
function is the number of fruit selections with i calories. The product principle
of picture enumerators translates directly into a product principle for generating
functions. However, it is possible to give a proof that does not rely on the product
principle for enumerators.
191. Suppose that we have two sets S1 and S2 . Let v1 (v stands for value) be
a function from S1 to the nonnegative integers and let v2 be a function
from S2 to the nonnegative integers. Define a new function v on the set
P
i
S1 S2 by v(x1 , x2 ) = v1 (x1 ) + v2 (x2 ). Suppose further that
i=0 ai x is the
generating function for the number of elements x1 of S1 of value i, that is,
P
j
with v1 (x1 ) = i. Suppose also that
j=0 bj x is the generating function for
the number of elements x2 of S2 of value j, that is, with v2 (x2 ) = j. Prove
131
X
i=0
!
X
j
ai x b j x
i
j=0
4.1.6
132
Pn
k=0
(1 x)
xk ?
k=0
194. Express the generating function for the number of multisets of size k chosen
from [n] (where n is fixed but k can be any nonnegative integer) as a 1 over
something relatively simple.
195. Find a formula for (1 + x)n as a power series whose coefficients involve
binomial
What does this formula tell you about how we should
coefficients.
define n
when
n
is
positive?
k
133
Qn
i=1
deg(i)
xi
(b) Write down the picture enumerators for trees on two, three, and four
vertices. Factor them as completely as possible.
(c) Explain why x1 x2 xn is a factor of the picture of a tree on n vertices.
134
4.2
200. If we have five identical pennies, five identical nickels, five identical dimes,
and five identical quarters, give the picture enumerator for the combinations
of coins we can form and convert it to a generating function for the number
of ways to make k cents with the coins we have. Do the same thing assuming
we have an unlimited supply of pennies, nickels, dimes, and quarters.
201. Recall that a partition of an integer k is a multiset of numbers that adds
to k. In Problem 200 we found the generating function for the number of
135
partitions of an integer into parts of size 1, 5, 10, and 25. When working
with generating functions for partitions, it is becoming standard to use q
rather than x as the variable in the generating function. From now on,
write your answers to problems involving generating functions for partitions
of an integer in this notation.5
(a) Give the generating function for the number of partitions of an integer
into parts of size one through ten.
(b) Give the generating function for the number of partitions of an integer
k into parts of size at most m, where m is fixed but k may vary. Notice
this is the generating function for partitions whose Young diagram fits
into the space between the line x = 0 and the line x = m in a coordinate
plane. (We assume the boxes in the Young diagram are one unit by
one unit.)
202. In Problem 201b you gave the generating function for the number of partitions of an integer into parts of size at most m. Explain why this is also the
generating function for partitions of an integer into at most m parts. Notice
that this is the generating function for the number of partitions whose Young
diagram fits into the space between the line y = 0 and the line y = m.
5
The reason for this change in the notation relates to the subject of finite fields in abstract
algebra, where q is the standard notation for the size of a finite field. While we will make no
use of this connection, it will be easier for you to read more advanced work if you get used to
the different notation.
136
1 + q + q2 + + qi
and
1 + q i + q 2i + + q i .
i=1
i=1
However, one makes sense and one doesnt. Figure out which one makes
sense and explain why it makes sense and the other one doesnt. If we want
to make sense of a product of the form
Y
i=1
1 + pi (q),
137
1 q 2i
= 1 + qi
1 qi
and the generating function for the number of partitions of an integer into
distinct parts to show how the number of partitions of an integer k into
distinct parts is related to the number of partitions of an integer k into odd
parts.
138
209. Write down the generating function for the number of ways to partition
an integer into parts of size no more than m, each used an odd number of
times. Write down the generating function for the number of partitions of
an integer into parts of size no more than m, each used an even number of
times. Use these two generating functions to get a relationship between the
two sequences for which you wrote down the generating functions.
210. In Problem 201b and Problem 202 you gave the generating functions for,
respectively, the number of partitions of k into parts the largest of which is
at most m and for the number of partitions of k into at most m parts. In this
problem we will give the generating function for the number of partitions of
k into at most n parts, the largest of which is at most m. That is, we will
P
k
analyze
i=0 ak q where ak is the number of partitions of k into at most n
parts, the largest of which is at most m. Geometrically, it is the generating
function for partitions whose Young diagram fits into an m by n rectangle,
as in Problem 168. This
generating function has significant
h
i analogs to the
m+n
m+n
binomial coefficient n , and so it is denoted by n . It is called a
q
q-binomial coefficient.
(a) Compute
h i
4
2 q
2+2
.
2 q
as asking
h i
n
1 q
and
n
.
n1 q
m+n
and m+n
related? Prove
n
m q
q
h i
h
i
r
how rs and rs
are related.)
q
q
139
140
m+n
n
=
q
[m + n]!q
.
[m]!q [n]!q
ii. lim[n]!q .
q1
m+n
iii. lim
.
q1
n
q
Why is the limit in Part iii equal to the number of partitions (of any
number) with at most n parts all of size most m? Can you explain
bijectively why this quantity equals the formula you got?
(h) What happens to
4.3
m+n
n
q
4.3.1
141
Algebraic manipulations with generating functions can sometimes reveal the solutions to a recurrence relation.
211. Suppose that ai = 3ai1 + 3i .
(a) Multiply both sides by xi and sum both the left hand side and right
hand side from i = 1 to infinity. In the left-hand side use the fact that
ai x i = (
i=1
ai x i ) a0
i=0
X
i=1
ai1 xi = x
X
i=1
ai1 xi1 = x
X
j=0
aj x j = x
ai x i
i=0
142
212. Suppose we deposit $5000 in a savings certificate that pays ten percent
interest and also participate in a program to add $1000 to the certificate at
the end of each year (from the end of the first year on) that follows (also
subject to interest). Assuming we make the $5000 deposit at the end of year
0, and letting ai be the amount of money in the account at the end of year
i, write a recurrence for the amount of money the certificate is worth at the
end of year n. Solve this recurrence. How much money do we have in the
account (after our year-end deposit) at the end of ten years? At the end of
20 years?
4.3.2
Fibonacci Numbers
4.3.3
213. Suppose we start (at the end of month 0) with 10 pairs of baby rabbits,
and that after baby rabbits mature for one month they begin to reproduce,
6
Apparently Leonardo de Pisa was given the name Fibonacci posthumously. It is a shortening
of son of Bonacci in Italian.
143
with each mature pair producing two new pairs at the end of each month
afterwards. Suppose further that over the time we observe the rabbits, none
die. Let an be the number pairs of rabbits we have at the end of month
n. Show that an = an1 + 2an2 . This is an example of a second order
linear recurrence with constant coefficients. Using a method similar to that
of Problem 211, show that
X
i=0
ai x i =
10
.
1 x 2x2
This gives us the generating function for the sequence ai giving the population in month i; shortly we shall see a method for converting this to a
solution to the recurrence.
214. In Fibonaccis original problem, each pair of mature rabbits produces one
new pair at the end of each month, but otherwise the situation is the same
as in Problem 213. Assuming that we start with one pair of baby rabbits
(at the end of month 0), find the generating function for the number of pairs
of rabbits we have at the end of n months.
215. Find the generating function for the solutions to the recurrence
ai = 5ai1 6ai2 + 2i .
The recurrence relations we have seen in this section are called second order
because they specify ai in terms of ai1 and ai2 , they are called linear because ai1
144
and ai2 each appear to the first power, and they are called constant coefficient
recurrences because the coefficients in front of ai1 and ai2 are constants.
4.3.4
Partial fractions
The generating functions you found in the previous section all can be expressed
in terms of the reciprocal of a quadratic polynomial. However, without a power
series representation, the generating function doesnt tell us what the sequence is.
It turns out that whenever you can factor a polynomial into linear factors (and
over the complex numbers such a factorization always exists) you can use that
factorization to express the reciprocal in terms of power series.
216. Express
1
x3
2
x2
as a single fraction.
217. In Problem 216 you see that when we added numerical multiples of the
reciprocals of first degree polynomials we got a fraction in which the denominator is a quadratic polynomial. This will always happen unless the
two denominators are multiples of each other, because their least common
multiple will simply be their product, a quadratic polynomial. This leads
us to ask whether a fraction whose denominator is a quadratic polynomial
can always be expressed as a sum of fractions whose denominators are first
degree polynomials. Find numbers c and d so that
c
d
5x + 1
=
+
.
(x 3)(x + 5)
x3 x+5
145
218. In Problem 217 you may have simply guessed at values of c and d, or you
may have solved a system of equations in the two unknowns c and d. Given
constants a, b, r1 , and r2 (with r1 6= r2 ), write down a system of equations
we can solve for c and d to write
c
d
ax + b
=
+
.
(x r1 )(x r2 )
x r 1 x r2
Writing down the equations in Problem 218 and solving them is called the method
of partial fractions. This method will let you find power series expansions for
generating functions of the type you found in Problems 213 to 215. However, you
have to be able to factor the quadratic polynomials that are in the denominators
of your generating functions.
219. Use the method of partial fractions to convert the generating function of
Problem 213 into the form
d
c
+
.
x r1 x r2
Use this to find a formula for an .
220. Use the quadratic formula to find the solutions to x2 + x 1 = 0, and use
that information to factor x2 + x 1.
146
1
+x1
in the form
d
c
+
.
x r1 x r2
(Hint: You can save yourself a tremendous amount of frustrating algebra if
you arbitrarily choose one of the solutions and call it r1 and call the other
solution r2 and solve the problem using these algebraic symbols in place
of the actual roots.7 Not only will you save yourself some work, but you
will get a formula you could use in other problems. When you are done,
substitute in the actual values of the solutions and simplify.)
222. (a) Use the partial fractions decomposition you found in Problem 220 to
write the generating function you found in Problem 214 in the form
an x i
n=0
and use this to give an explicit formula for an . (Hint: once again it
will save a lot of tedious algebra if you use the symbols r1 and r2 for
the solutions as in Problem 221 and substitute the actual values of the
7
147
1
1
= 2
2
1xx
x +x1
1
1
1
1
=
5 r1 x
5 r2 x
1
1
1
1
=
r1 5 1 x/r1 r2 5 1 x/r2
1 X
1 X
x n
x n
r1 5 n=0 r1
r2 5 n=0 r2
an x n =
n=0
=
+
5(1 + 5)n+1
5(1 5)n+1
5 4n+1
5 4n+1
!n+1
!n+1
1 1+ 5
1 1 5
.
=
2
2
5
5
an =
(b) When we have a0 = 1 and a1 = 1, i.e. when we start with one pair
of baby rabbits, the numbers an are called Fibonacci Numbers. Use
148
4.3.5
149
Catalan Numbers
224. (a) Using either lattice paths or diagonal lattice paths, explain why the
Catalan Number Cn satisfies the recurrence
Cn =
n
X
Ci1 Cni .
i=1
n
(b) Show that if we use y to stand for the power series
i=0 Cn x , then we
can find y by solving a quadratic equation. (Hint: does the right hand
side of the recurrence remind you of some products you have worked
with?) Find y.
(c) Taylors theorem from calculus tells us that the extended binomial theorem
!
X
r i
r
(1 + x) =
x
i=0 i
holds for any number real number r, where
r
i
is defined to be
ri
r(r 1) (r i + 1)
=
.
i!
i!
Use this and your solution for y (note that of the two possible values
for y that you get from the quadratic formula, only one gives an actual
power series) to get a formula for the Catalan numbers.
150
4.4
Supplementary Problems
1. What is the generating function for the number of ways to pass out k pieces
of candy from an unlimited supply of identical candy to n children (where
n is fixed) so that each child gets between three and six pieces of candy
(inclusive)? Use the fact that
(1 + x + x + x3 )(1 x) = 1 x4
to find a formula for the number of ways to pass out the candy.
2. (a) In paying off a mortgage loan with initial amount A, annual interest
rate p% (on a monthly basis) with a monthly payment of m, what
recurrence describes the amount owed after n months of payments in
terms of the amount owed after n 1 months? Some technical details:
You make the first payment after one month. The amount of interest
included in your monthly payment is .01p/12. This interest rate is
applied to the amount you owed immediately after making your last
monthly payment.
(b) Find a formula for the amount owed after n months.
(c) Find a formula for the number of months needed to bring the amount
owed to zero. Another technical point: If you were to make the standard monthly payment m in the last month, you might actually end
up owing a negative amount of money. Therefore it is ok if the result
of your formula for the number of months needed gives a non-integer
151
number of months. The bank would just round up to the next integer
and adjust your payment so your balance comes out to zero.
(d) What should the monthly payment be to pay off the loan over a period
of 30 years?
3. We have said that for nonnegative i and positive n we want to define
to be
define
n+i1
. If we want
i
n
when n and i
i
n
i
4. Find a recurrence relation for the number of ways to divide a convex n-gon
into triangles by means of non-intersecting diagonals. How do these numbers
relate to the Catalan numbers?
5. How does
Pn
k=0
nk
k
6. Let m and n be fixed. Express the generating function for the number of
k-element multisets of an n-element set such that no element appears more
than m times as a quotient of two polynomials. Use this expression to get a
formula for the number of k-element multisets of an n-element set such that
no element appears more than m times.
7. One natural but oversimplified model for the growth of a tree is that all
new wood grows from the previous years growth and is proportional to it
in amount. To be more precise, assume that the (total) length of the new
growth in a given year is the constant c times the (total) length of new
152
Chapter 5
The Principle of Inclusion and
Exclusion
5.1
One of our very first counting principles was the sum principle which says that
the size of a union of disjoint sets is the sum of their sizes. Computing the size
of overlapping sets requires, quite naturally, information about how they overlap.
Taking such information into account will allow us to develop a powerful extension
of the sum principle known as the principle of inclusion and exclusion.
153
154
5.1.1
225. In a biology lab study of the effects of basic fertilizer ingredients on plants,
16 plants are treated with potash, 16 plants are treated with phosphate, and
among these plants, eight are treated with both phosphate and potash. No
other treatments are used. How many plants receive at least one treatment?
If 32 plants are studied, how many receive no treatment?
226. Give a formula for the size of the union A B of two sets A and B in terms
of the sizes |A| of A, |B| of B, and |A B| of A B. If A and B are subsets
of some universal set U , express the size of the complement U (A B)
in terms of the sizes |U | of U , |A| of A, |B| of B, and |A B| of A B.
227. In Problem 225, there were just two fertilizers used to treat the sample
plants. Now suppose there are three fertilizer treatments, and 15 plants are
treated with nitrates, 16 with potash, 16 with phosphate, 7 with nitrate and
potash, 9 with nitrate and phosphate, 8 with potash and phosphate and 4
with all three. Now how many plants have been treated? If 32 plants were
studied, how many received no treatment at all?
5.1.2
155
n
[
Ai
i=1
EP (S) =
P (s).
s:sS
that we used to stand for the sum of the pictures of the elements of a set S when
we introduced picture enumerators.
Let us define
\
Ai
i:iI
Ai = A1 A3 A4 A6 .
(5.1)
156
I:I{1,2,3,4}, |I|=2
(5.2)
230. Use notation something like that of Equation 5.1 and Equation 5.2 to express
the answer to Problem 229. Note there are many different correct ways to
do this problem. Try to write down more than one and choose the nicest
one you can. Say why you chose it (because your view of what makes a
formula nice may be different from somebody elses). The nicest formula
wont necessarily involve all the elements of Equations 5.1 and 5.2. (The
authors version doesnt use all those elements.)
231. A group of n students goes to a restaurant carrying backpacks. The manager
invites everyone to check their backpack at the check desk and everyone does.
While they are eating, a child playing in the check room randomly moves
around the claim check stubs on the backpacks. We will try to compute the
probability that, at the end of the meal, at least one student receives his or
her own backpack. This probability is the fraction of the total number of
ways to return the backpacks in which at least one student gets his or her
own backpack back.
(a) What is the total number of ways to pass back the backpacks?
157
5.1.3
The formula you have given in Problem 230 is often called the principle of
inclusion and exclusion for unions of sets. The reason is the pattern in which
the formula first adds (includes) all the sizes of the sets, then subtracts (excludes)
158
all the sizes of the intersections of two sets, then adds (includes) all the sizes of
the intersections of three sets, and so on. Notice that we havent yet proved the
principle. There are a variety of proofs. Perhaps one of the most straightforward
(though not the most elegant) is an inductive proof that relies on the fact that
A1 A2 An = (A1 A2 An1 ) An
and the formula for the size of a union of two sets.
232. Give a proof of your formula for the principle of inclusion and exclusion.
233. We get a more elegant proof if we ask for a picture enumerator for A1 A2
An . So let us assume A is a set with a picture function P defined on
it and that each set Ai is a subset of A.
(a) By thinking about how we got the formula for the size of a union, write
down instead a conjecture for \
the picture enumerator of a union. You
Ai ) for the picture enumerator of the
could use a notation like EP (
i:iS
n
[
i=1
n
[
i=1
Ai )?
n
[
159
i=1
n
[
Ai )?
i=1
(d) How have you proved your conjecture for the picture enumerator of the
union of the sets Ai ?
(e) How can you get the formula for the principle of inclusion and exclusion
from your formula for the picture enumerator of the union?
234. Frequently when we apply the principle of inclusion and exclusion, we will
have a situation like that of Problem 231d. That is, we will have a set A
and subsets A1 , A2 , . . . , An and we will want the size or the probability of
the set of elements in A that are not in the union. This set is known as the
S
complement of the union of the Ai s in A, and is denoted by A ni=1 Ai , or
Sn
Sn
if A is clear from context, by i=1 Ai . Give the formula for i=1 Ai . The
principle of inclusion and exclusion generally refers to both this formula
and the one for the union.
We
\ can find a very elegant way of writing the formula in Problem 234 if we
Ai = A. For this reason, if we have a family of subsets Ai of a set A, we
let
i:i
define1
Ai = A.
i:i
1
T For those interested in logic and set theory, given a family of subsets Ai of a set A, we define
i:iS Ai to be the set of all members x of A that are in Ai for all i S. (Note that this allows
160
5.2
5.2.1
235. In how many ways may we distribute k identical apples to n children so that
no child gets more than four apples? Compare your result with your result
in Problem 197.
5.2.2
The M
enage Problem
161
once we seat one couple in that set, or, for that matter, once we seat one
person.)
5.2.3
238. Given a function f from the k-element set K to the n-element set [n], we
say f is in the set Ai if f (x) 6= i for every x in K. How many of these sets
does an onto function belong to? What is the number of functions from a
k-element set onto an n-element set?
239. Find a formula for the Stirling number (of the second kind) S(k, n).
240. If we roll a die eight times, we get a sequence of 8 numbers, the number of
dots on top on the first roll, the number on the second roll, and so on.
(a) What is the number of ways of rolling the die eight times so that each
of the numbers one through six appears at least once in our sequence?
To get a numerical answer, you will likely need a computer algebra
package.
(b) What is the probability that we get a sequence in which all six numbers
between one and six appear? To get a numerical answer, you will
likely need a computer algebra package, programmable calculator, or
spreadsheet.
(c) How many times do we have to roll the die to have probability at
least one half that all six numbers appear in our sequence. To an-
162
5.2.4
163
vertex v is connected to vertex v by the trivial walk consisting of the single vertex
v and no edges. To have a partition, each vertex must be in one and only one
block. To prove that we have defined a partition, suppose that vertex v is in the
blocks B1 and B2 . Then B1 is the set of all vertices connected by walks to some
vertex v1 and B2 is the set of all vertices connected by walks to some vertex v2 .
241.
Since B1 = B2 , these two sets are the same block, and thus all blocks containing
v are identical, so v is in only one block. Thus we have a partition of the vertex
set, and the blocks of the partition are the connected components of the graph.
Notice that the connected components depend on the edge set of the graph. If we
have a graph on the vertex set V with edge set E and another graph on the vertex
set V with edge set E 0 , then these two graphs could have different connected
components. It is traditional to use the Greek letter (gamma)3 to stand for the
number of connected components of a graph; in particular, (V, E) stands for the
number of connected components of the graph with vertex set V and edge set E.
We are going to show how the principle of inclusion and exclusion may be used
to compute the number of ways to color a graph properly using colors from a set
C of c colors.
242.
3
Suppose we have a graph G with vertex set V and edge set E = {e1 , e2 , . . . e|E| }.
Suppose F is a subset of E. Suppose we have a set C of c colors with which
to color the vertices.
The Greek letter gamma is pronounced gam-uh, where gam rhymes with ham.
164
The formula you found in Problem 242c is a formula that involves powers of c,
and so it is a polynomial function of c. Thus it is called the chromatic polynomial
of the graph G. Since we like to think about polynomials as having a variable
x and we like to think of c as standing for some constant, people often use x as
the notation for the number of colors we are using to color G. Frequently people
will use G (x) to stand for the number of ways to color G with x colors, and call
G (x) the chromatic polynomial of G.
5.3
166
245. (a) In how many ways may you properly color the vertices of a path on
n vertices with x colors? Describe any dependence of the chromatic
polynomial of a path on the number of vertices.
(b) (Not tremendously hard.) In how many ways may you properly color
the vertices of a cycle on n vertices with x colors? Describe any dependence of the chromatic polynomial of a cycle on the number of vertices.
246. In how many ways may you properly color the vertices of a tree on n vertices
with x colors?
247. What do you observe about the signs of the coefficients of the chromatic
polynomial of the graph in Figure 5.1? What about the signs of the coefficients of the chromatic polynomial of a path? Of a cycle? Of a tree? Make
a conjecture about the signs of the coefficients of a chromatic polynomial
and prove it.
5.4
Supplementary Problems
1. Each person attending a party has been asked to bring a prize. The person
planning the party has arranged to give out exactly as many prizes as there
are guests, but any person may win any number of prizes. If there are n
guests, in how many ways may the prizes be given out so that nobody gets
the prize that he or she brought?
2. There are m students attending a seminar in a room with n seats. The
167
seminar is a long one, and in the middle the group takes a break. In how
many ways may the students return to the room and sit down so that nobody
is in the same seat as before?
3. What is the number of ways to pass out k pieces of candy from an unlimited supply of identical candy to n children (where n is fixed) so that each
child gets between three and six pieces of candy (inclusive)? If you have
done Supplementary Problem 1 in Chapter 4 compare your answer in that
problem with your answer in this one.
4. In how many ways may k distinct books be arranged on n shelves so that
no shelf gets more than m books?
5. Suppose that n children join hands in a circle for a game at nursery school.
The game involves everyone falling down (and letting go). In how many
ways may they join hands in a circle again so that nobody has the same
person immediately to the right both times the group joins hands?
6. Suppose that n people link arms in a folk-dance and dance in a circle. Later
on they let go and dance some more, after which they link arms in a circle
again. In how many ways can they link arms the second time so that no one
links with a person with whom he or she linked arms before?
7. (A challenge; the author has not tried to solve this one!) Redo Problem 6
in the case that there are n men and n women and when people arrange
themselves in a circle they do so alternating gender.
168
8. Suppose we take two graphs G1 and G2 with disjoint vertex sets, we choose
one vertex on each graph, and connect these two vertices by an edge e to
get a graph G12 . How does the chromatic polynomial of G12 relate to those
of G1 and G2 ?
Chapter 6
Groups Acting on Sets
6.1
Permutation Groups
Until now we have thought of permutations mostly as ways of listing the elements
of a set. In this chapter we will find it very useful to think of permutations as
functions. This will help us in using permutations to solve enumeration problems
that cannot be solved by the quotient principle because they involve counting the
blocks of a partition in which the blocks dont have the same size. We begin by
studying the kinds of permutations that arise in situations where we have used
the quotient principle in the past.
169
170
6.1.1
Figure 6.1: The four possible results of rotating a square but maintaining its
location.
1
2
a
c
3
2
d
2
c
3
2
3
3
= identity
= 0
In Figure 6.1 we show a square with its four vertices labeled a, b, c, and d. We
have also labeled the spots in the plane where each of these vertices falls with the
label 1, 2, 3, or 4. Then we have shown the effect of rotating the square clockwise
through 90, 180, 270, and 360 degrees (which is the same as rotating through 0
degrees). Underneath each of the rotated squares we have named the function
that carries out the rotation. We use , the Greek letter pronounced row, to
stand for a 90 degree clockwise rotation. We use 2 to stand for two 90 degree
rotations, and so on. We can think of the function as a function on the four
element set1 {1, 2, 3, 4}. In particular, for any function (the Greek letter phi,
1
What we are doing is restricting the rotation to the set {1, 2, 3, 4}.
171
usually pronounced fee, but sometimes fie) from the plane back to itself that
may move the square around but otherwise leaves it in the same location, we let
(i) be the label of the place where vertex previously in position i is now. Thus
(1) = 2, (2) = 3, (3) = 4 and (4) = 1. Notice that is a permutation on the
set {1, 2, 3, 4}.
248. The composition f g of two functions f and g is defined by f g(x) =
f (g(x)). Is 3 the composition of and 2 ? Does the answer depend on the
order in which we write and 2 ? How is 2 related to ?
249. Is the composition of two permutations always a permutation?
In Problem 248 you see that we can think of 2 as the result of first rotating
by 90 degrees and then by another 180 degrees. In other words, the composition
of two rotations is the same thing as first doing one and then doing the other. Of
course there is nothing special about 90 degrees and 180 degrees. As long as we
first do one rotation through a multiple of 90 degrees and then another rotation
through a multiple of 90 degrees, the composition of these rotations is a rotation
through a multiple of 90 degrees.
If we first rotate by 90 degrees and then by 270 degrees then we have rotated
by 360 degrees, which does nothing visible to the square. Thus we say that 4 is
the identity function. In general the identity function on a set S, denoted
by (the Greek letter iota, pronounced eye-oh-ta) is the function that takes each
element of the set to itself. In symbols, (x) = x for every x in S. Of course the
identity function on a set is a permutation of that set.
172
6.1.2
Groups of permutations
250. For any function from a set S to itself, we define n (for nonnegative
integers n) inductively by 0 = and n = n1 for every positive
integer n. If is a permutation, is n a permutation? Based on your
experience with previous inductive proofs, what do you expect n m to
be? What do you expect (m )n to be? There is no need to prove these last
two answers are correct, for you have, in effect, already done so in Chapter
2.
251. If we perform the composition for any function from S to S, what
function do we get? What if we perform the composition ?
What you have observed about iota in Problem 251 is called the identity property
of iota. In the context of permutations, people usually call the function the
identity rather than calling it iota.
Since rotating first by 90 degrees and then by 270 degrees has the same effect
as doing nothing, we can think of the 270 degree rotation as undoing what the 90
degree rotation does. For this reason we say that in the rotations of the square,
3 is the inverse of . In general, a function : T S is called an inverse of
a function : S T ( is the lower case Greek letter sigma) if = = .
For a slower introduction to inverses and practice with them, see Section A.1.3
in Appendix A. Since a permutation is a bijection, it has a unique inverse, as in
Section A.1.3 of Appendix A. And since the inverse of a bijection is a bijection
(again, as in the Appendix), the inverse of a permutation is a permutation.
173
We use 1 to denote the inverse of the permutation . Weve seen that the
rotations of the square are functions that return the square to its original location
but may move the vertices to different places. In this way we create permutations
of the vertices of the square. Weve observed three important properties of these
permutations.
(Identity Property) These permutations include the identity permutation.
(Inverse Property) Whenever these permutations include , they also include
1 .
(Closure Property) Whenever these permutations include and , they also
include .
A set of permutations with these three properties is called a permutation
group2 or a group of permutations. We call the group of permutations corresponding to rotations of the square the rotation group of the square. There is a
similar rotation group with n elements for any regular n-gon.
252. If f : S T , g : T X, and h : X Y , is
h (g f ) = (h g) f ?
2
The concept of a permutation group is a special case of the concept of a group that one
studies in abstract algebra. When we refer to a group in what follows, if you know what groups
are in the more abstract sense, you may use the word in this way. If you do not know about
groups in this more abstract sense, then you may assume we mean permutation group when we
say group.
174
175
example, if we flip the square around a diagonal, most of it moves out of the
plane during the flip, but the square ends up in the same location. Draw
a figure like Figure 6.1 that shows all the possible results of such motions,
including the ones shown in Figure 6.1. Do the corresponding permutations
form a group?
256. Let and be permutations.
(a) Why must have an inverse?
(b) Is ( )1 = 1 1 ? (Prove or give a counter-example.)
(c) Is ( )1 = 1 1 ? (Prove or give a counter-example.)
257. Explain why the set of all permutations of four elements is a permutation
group. How many elements does this group have? This group is called the
symmetric group on four letters and is denoted by S4 .
6.1.3
176
1 2 3 4
.
3 1 4 2
We call this notation the two row notation for permutations. In the two row
notation for a permutation of {a1 , a2 , . . . , an }, we write the numbers a1 through
an in one row and we write (a1 ) through (an ) in a row right below, enclosing
both rows in parentheses. Notice that
1 2 3 4
3 1 4 2
2 1 4 3
,
1 3 2 4
177
(13 21 34 42)
6.1.4
1 2 3 4 5
.
4 3 5 1 2
We found four permutations that correspond to rotations of the square. In Problem 255 you found four permutations that correspond to flips of the square in
space. One flip fixes the vertices in the places labeled 1 and 3 and interchanges
the vertices in the places labeled 2 and 4. Let us denote it by 1|3 . One flip fixes
the vertices in the positions labeled 2 and 4 and interchanges those in the positions labeled 1 and 3. Let us denote it by 2|4 . One flip interchanges the vertices
in the places labeled 1 and 2 and also interchanges those in the places labeled 3
and 4. Let us denote it by 12|34 . The fourth flip interchanges the vertices in the
places labeled 1 and 4 and interchanges those in the places labeled 2 and 3. Let
us denote it by 14|23 . Notice that 1|3 is a permutation that takes the vertex in
place 1 to the vertex in place 1 and the vertex in place 3 to the vertex in place
178
3, while 12|34 is a permutation that takes the edge between places 1 and 2 to the
edge between places 2 and 1 (which is the same edge) and takes the edge between
places 3 and 4 to the edge between places 4 and 3 (which is the same edge). This
should help to explain the similarity in the notation for the two different kinds of
flips.
259. Write down the two row notation for 3 , 2|4 , 12|34 and 2|4 12|34 .
260. (You may have already done this problem in Problem 255, in which case
you need not do it again!) In Problem 255, if a rigid motion in threedimensional space returns the square to its original location, in how many
places can vertex number one land? Once the location of vertex number
one is decided, how many possible locations are there for vertex two? Once
the locations of vertex one and vertex two are decided, how many locations
are there for vertex three? Answer the same question for vertex four. What
does this say about the relationship between the four rotations and four flips
described just before Problem 259 and the permutations you described in
Problem 255?
The four rotations and four flips of the square described before Problem 259
form a group called the dihedral group of the square. Sometimes the group is
denoted D8 because it has eight elements, and sometimes the group is denoted by
D4 because it deals with four vertices! Let us agree to use the notation D4 for the
dihedral group of the square. There is a similar dihedral group, denoted by Dn ,
of all the rigid motions of three-dimensional space that return a regular n-gon to
its original location (but might put the vertices in different places).
179
261. Another view of the dihedral group of the square is that it is the group of
all distance preserving functions, also called isometries, from a square to
itself. Notice that an isometry must be a bijection. Any rigid motion of the
square preserves the distances between all points of the square. However,
it is conceivable that there might be some isometries that do not arise from
rigid motions. (We will see some later on in the case of a cube.) Show
that there are exactly eight isometries (distance preserving functions) from
a square to itself.
262. How many elements does the group Dn have? Prove that you are correct.
263. In Figure 6.3 we show a cube with the positions of its vertices and faces
labeled. As with motions of the square, we let we let (x) be the label of
the place where vertex previously in position x is now.
(a) Write in two row notation the permutation of the vertices that corresponds to rotating the cube 90 degrees around a vertical axis through
the faces t (for top) and u (for underneath). (Rotate in a right-handed
fashion around this axis, meaning that vertex 6 goes to the back and
vertex 8 comes to the front.)
(b) Write in two row notation the permutation that rotates the cube
120 degrees around the diagonal from vertex 1 to vertex 7 and carries
vertex 8 to vertex 6.
(c) Compute the two row notation for .
180
Figure 6.3: A cube with the positions of its vertices and faces labeled. The curved
arrows point to the faces that are blocked by the cube.
b
t
6
4
r
3
1
u
f
264.
181
6.1.5
We can always figure out the composition of two permutations of the same set
by using the definition of composition, but if we are going to work with a given
permutation group again and again, it is worth making the computations once
and recording them in a table. For example, the group of rotations of the square
may be represented as in Table 6.1. We list the elements of our group, with the
identity first, across the top of the table and down the left side of the table, using
182
the same order both times. Then in the row labeled by the group element
and the column labeled by the group element , we write the composition ,
expressed in terms of the elements we have listed on the top and on the left side.
Since a group of permutations is closed under composition, the result will
always be expressible as one of these elements.
Table 6.1: The group table for the rotations of a square.
2
3
2
3
2
3
2
2
3
3
3
266. In Table 6.1, all the entries in a row (not including the first entry, the one
to the left of the line) are different. Will this be true in any group table for
a permutation group? Why or why not? Also in Table 6.1 all the entries in
a column (not including the first entry, the one above the line) are different.
Will this be true in any group table for a permutation group? Why or why
not?
267. In Table 6.1, every element of the group appears in every row (even if you
dont include the first element, the one before the line). Will this be true in
183
any group table for a permutation group? Why or why not? Also in Table
6.1 every element of the group appears in every column (even if you dont
include the first entry, the one before the line). Will this be true in any
group table for a permutation group? Why or why not?
268.
Write down the group table for the dihedral group D4 . Use the notation
described earlier to denote the flips. (Hints: Part of the table has already
been written down. Will you need to think hard to write down the last row?
Will you need to think hard to write down the last column?)
You may notice that the associative law, the identity property, and the inverse
property are three of the most important rules that we use in regrouping parentheses in algebraic expressions when solving equations. There is one property we
have not yet mentioned, the commutative law, which would say that = .
It is easy to see from the group table of the rotation group of a square that it
satisfies the commutative law.
269. Does the commutative law hold in all permutation groups?
6.1.6
Subgroups
We have seen that the dihedral group D4 contains a copy of the group of rotations
of the square. When one group G of permutations of a set S is a subset of another
group G0 of permutations of S, we say that G is a subgroup of G0 .
270. Find all subgroups of the group D4 and explain why your list is complete.
184
271. Can you find subgroups of the symmetric group S4 with two elements? Three
elements? Four elements? Six elements? (For each positive answer, describe
a subgroup. For each negative answer, explain why not.)
6.1.7
1 2 3 4
.
2 3 1 4
4
2
the rather trivial one with vertex 4 pointing to itself, and the nontrivial one with
vertex 1 pointing to vertex 2 pointing to vertex 3 which points back to vertex 1.
185
A permutation
is called a cycle
if its digraph
consists of exactly one cycle. Thus
1 2 3
2 3 1
is a cycle but
1 2 3 4
2 3 1 4
1 2 3
.
2 3 1
We can describe cycles in another way as well. A cycle of the permutation
is a list (i (i) 2 (i) . . . n (i)) that does not have repeated elements while the
list (i (i) 2 (i) . . . n (i) n+1 (i)) does have repeated elements.
272. If the list (i (i) 2 (i) . . . n (i)) does not have repeated elements but the
list (i (i) 2 (i) . . . n (i) n+1 (i)) does have repeated elements, then what
is n+1 (i)?
We say j (i) is an element of the cycle (i (i) 2 (i) . . . n (i)). Notice that the
case j = 0 means i is an element of the cycle. Notice also that if j > n, j (i) =
jn1 (i), so the distinct elements of the cycle are i, (i), 2 (i), through n (i).
We think of the cycle (i (i) 2 (i) . . . n (i)) as representing the permutation
restricted to the set of elements of the cycle. We say that the cycles
(i (i) 2 (i) . . . n (i))
and
( j (i) j+1 (i) . . . n (i) i (i) 2 (i) . . . j1 (i))
are equivalent. Equivalent cycles represent the same permutation on the set of
elements of the cycle. For this reason, we consider equivalent cycles to be equal
in the same way we consider 21 and 42 to be equal. In particular, this means that
(i1 i2 . . . in ) = (ij ij+1 . . . in i1 i2 . . . ij1 ).
186
273. Find the cycles of the permutations , 1|3 and 12|34 in the group D4 .
274. Find the cycles of the permutation
1 2 3 4 5 6 7 8 9
.
3 4 6 2 9 7 1 5 8
275. If two cycles of have an element in common, what can we say about them?
187
In Problems 273 and 274 you found the cycle decompositions of typical elements of the group D4 and of the permutation
1 2 3 4 5 6 7 8 9
.
3 4 6 2 9 7 1 5 8
The group of all rotations of the square is simply the set of the four powers
of the cycle = (1 2 3 4). For this reason, it is called a cyclic group3 and often
denoted by C4 . Similarly, the rotation group of an n-gon is usually denoted by
Cn .
277. Write a recurrence for the number c(k, n) of permutations of [k] that have
exactly n cycles, including 1-cycles. Use it to write a table of c(k, n) for k
between 1 and 7 inclusive. Can you find a relationship between c(k, n) and
any of the other families of special numbers such as binomial coefficients,
Stirling numbers, Lah numbers, etc. we have studied? If you find such a
relationship, prove you are right.
278.
3
The phrase cyclic group applies in a more general (but similar) situation. Namely the set
of all powers of any member of a group is called a cyclic group.
188
6.2
We defined the rotation group C4 and the dihedral group D4 as groups of permutations of the vertices of a square. These permutations represent rigid motions of
the square in the plane and in three-dimensional space respectively. The square
has geometric features of interest other than its vertices; for example, its diagonals, or its edges. Any geometric motion of the square that returns it to its
original location takes each diagonal to a possibly different diagonal, and takes
each edge to a possibly different edge. In Figure 6.5 we show the results on the
sides and diagonals of the rotations of a square. The rotation group permutes
Figure 6.5: The results on the sides and diagonals of rotating the square
1
s1
d13
s4
s3
d24
s2
s3
d24
4
s4
s3
s2
s4 s1
d24
s1
2
d24
d13
s1 s2
d13
s2
s3 s4
d13
s4
3
s1
d13
2
s2
d24
s3
= identity
= 0
the sides of the square and permutes the diagonals of the square as it rotates the
square. Thus we say the rotation group acts on the sides and diagonals of the
square.
189
279. (a) Write down the two-line notation for the permutation that a 90 degree
rotation does to the sides of the square.
(b) Write down the two-line notation for the permutation 2 that a 180
degree rotation does to the sides of the square.
(c) Is 2 = ? Why or why not?
(d) Write down the two-line notation for the permutation b that a 90 degree
rotation does to the diagonals d13 , and d24 of the square.
(e) Write down the two-line notation for the permutation c2 that a 180
degree rotation does to the diagonals of the square.
c2 in
b Why or why not? What familiar permutation is
(f) Is c2 = b ?
this case?
We have seen that the fact that we have defined a permutation group as the
permutations of some specific set doesnt preclude us from thinking of the elements
of that group as permuting the elements of some other set as well. In order to
keep track of which permutations of which set we are using to define our group
and which other set is being permuted as well, we introduce some new language
and notation. We are going to say that the group D4 acts on the edges and
diagonals of a square and the group R of permutations of the vertices of a cube
that arise from rigid motions of the cube acts on the edges, faces, diagonals,
etc. of the cube.
280. In Figure 6.3 we show a cube with the positions of its vertices and faces
labeled. As with motions of the square, we let we let (x) be the label of
the place where vertex previously in position x is now.
190
(a)
(b) In Problem 263 we wrote in two row notation the permutation that
rotates the cube 120 degrees around the diagonal from vertex 1 to
vertex 7 and carries vertex 8 to vertex 6. Write in two row notation
the permutation of the faces that corresponds to this member of R.
(c) In Problem 263 we computed the two row notation for . Now
compute the two row notation for ( was defined in Part 280a),
and write in two row notation the permutation of the faces that
corresponds to the action of the permutation on the faces of
the cube (for this question it helps to think geometrically about what
motion of the cube is carried out by ). What do you observe about
and ?
We say that a permutation group G acts on a set S if, for each member of
G there is a permutation of S such that
=
for every member and of G. In Problem 280c you saw one example of this
condition. If we think intuitively of and as motions in space, then following
191
the action of by the action of does give us the action of . We can also
reason directly with the permutations in the group R of rigid motions (rotations)
of the cube to show that R acts on the faces of the cube.
281. Show that a group G of permutations of a set S acts on S with = for
all in G.
282. The group D4 is a group of permutations of {1, 2, 3, 4} as in Problem 255.
We are going to show in this problem how this group acts on the twoelement subsets of {1, 2, 3, 4}. In Problem 287 we will see a natural geometric
interpretation of this action. In particular, for each two-element subset {i, j}
of {1, 2, 3, 4} and each member of D4 we define ({i, j}) = {(i), (j)}.
Show that with this definition of , the group D4 acts on the two-element
subsets of {1, 2, 3, 4}.
283.
192
6.2.1
Recall that when you were asked in Problem 45 to find the number of ways to
place two red beads and two blue beads at the corners of a square free to move
in three-dimensional space, you were not able to apply the quotient principle to
answer the question. Instead you had to see that you could divide the set of six
lists of two Rs and two Bs into two sets, one of size two in which the Rs and
Bs alternated and one of size four in which the two reds (and therefore the two
blues) would be side-by-side on the square. Saying that the square is free to move
in space is equivalent to saying that two arrangements of beads on the square
are equivalent if a member of the dihedral group carries one arrangement to the
other. Thus an important ingredient in the analysis of such problems will be how
a group can act on colorings of a set of vertices. We can describe the coloring of
the square in Figure 6.6 as the function f with
f (1) = R, f (2) = R, f (3) = B, and f (4) = B,
but it is more compact and turns out to be more suggestive to represent the
coloring in Figure 6.6 as the set of ordered pairs
(1, R), (2, R), (3, B), (4, B).
(6.1)
193
Figure 6.6: The colored square with coloring {(1, R), (2, R), (3, B), (4, B)}
2
R
B
3
This gives us an explicit list of which colors are assigned to which vertex.4
Then if we rotate the square through 90 degrees, we see that the set of ordered
pairs becomes
{((1), R), ((2), R), ((3), B), ((4), B)}
(6.2)
which is the same as
{(2, R), (3, R), (4, B), (1, B)}.
or, in a more natural order,
{(1, B), (2, R), (3, R), (4, B)}.
(6.3)
4
The reader who has studied Appendix A will recognize that this set of ordered pairs is the
relation of the function f , but we wont need to make any specific references to the idea of a
relation in what follows.
194
195
Then a coloring of the edges with 12 red, 23 blue, 34 red and 41 blue can
be represented as
{(12, R), (23, B), (34, R), (41, B)}.
(6.4)
(6.5)
We have the two bars over , because is a permutation of one set that gives us
a permutation of a second set, and then acts to give a permutation of a
third set, the set of colorings. For example, suppose we want to anlayze colorings
of the faces of a cube under the action of the rotation group of the cube as we
have defined it on the vertices. Each vertex-permutation in the group gives a
permutation of the faces of the cube. Then each permutation of the faces
gives us a permutation of the colorings of the faces.
In the special case that G is a group of permutations of S rather than a group
acting on S, Equation 6.5 becomes
((S, f )) = ({(x, f (x))|x S}) = {((x), f (x))|x S}.
196
In the case where G is the rotation group of the square acting on the vertices of the
square, the example of acting on a coloring by that we saw in 6.3 is an example
of this kind of action. In the standard notation, when we act on a coloring by ,
the color in position i moves to position (i).
285. Why does the action we have defined on colorings in Equation 6.5 take a
coloring to a coloring?
286. Show that if G is a group of permutations of a set S, and f is a coloring
function on S, then the equation
({(x, f (x))|x S}) = {((x), f (x))|x S}
defines an action of G on the colorings (S, f ) of S.
6.2.2
Orbits
197
(d) What is the multiset of two-element subsets that you get by computing
({1, 3}) for all in D4 ?
(e) Describe the two sets in parts (a) and (c) geometrically in terms of the
square.
288. This problem uses the notation for permutations in the dihedral group of the
square introduced before Problem 259. What is the effect of a 180 degree
rotation 2 on the diagonals of a square? What is the effect of the flip 1|3
on the diagonals of a square? How many elements of D4 send each diagonal
to itself? How many elements of D4 interchange the diagonals of a square?
In Problem 287 you saw that the action of the dihedral group D4 on two
element subsets of {1, 2, 3, 4} seems to split them into two blocks, one with two
elements and one with 4. We call these two blocks the orbits of D4 acting on
the two element subsets of {1, 2, 3, 4}. More generally, given a group G acting on
a set S, the orbit of G determined by an element x of S is the set
{(x)| G},
and is denoted by Gx. In Problem 287 it was possible to have Gx = Gy. In fact
in that problem, Gx = Gy for every y in Gx.
289. Suppose a group acts on a set S. Could an element of S be in two different
orbits? (Say why or why not.)
Problem 289 almost completes the proof of the following theorem.
198
199
were orbits of the rotation group or the dihedral group, and we were counting
the number of orbits of the group action. In Problem 45, we were not able to
apply the quotient principle because we had blocks of different sizes. However,
these blocks were still orbits of the action of the group D4 . And, even though
the orbits have different sizes, we expect that each orbit corresponds naturally to
a multiorbit and that the multiorbits all have the same size. Thus if we had a
version of the quotient rule for a union of multisets, we could hope to use it to
count the number of multiorbits.
291. (a) Find the orbit and multiorbit of D4 acting on the coloring
{(1, R), (2, R), (3, B), (4, B)},
or, in standard notation, RRBB, of the vertices of a square.
(b) How many group elements map the coloring RRBB to itself? What is
the multiplicity of RRBB in its multiorbit?
(c) Find the orbit and multiorbit of D4 acting on the coloring
{(1, R), (2, B), (3, R), (4, B)}.
(d) How many elements of the group send the coloring RBRB to itself?
What is the multiplicity of RBRB in its orbit?
292. (a) If G is a group, how is the set { | G} related to G?
(b) Use this to show that y is in the multiorbit Gxmulti if and only if
Gxmulti = Gymulti .
200
Problem 292b tells us that, when G acts on S, each element x of S is in one and
only one multiorbit. Since each orbit is a subset of a multiorbit and each element
x of S is in one and only one orbit, this also tells us there is a bijection between
the orbits of G and the multiorbits of G, so that we have the same number of
orbits as multiorbits.
When a group acts on a set, a group element is said to fix an element of x S
if (x) = x. The set of all elements fixing an element x is denoted by Fix(x).
293. Suppose a group G acts on a set S. What is special about the subset Fix(x)
for an element x of S?
294. Suppose a group G acts on a set S. What is the relationship of the multiplicity of x S in its multiorbit and the size of Fix(x)?
295. What can you say about relationships between the multiplicity of an element
y in the multiorbit Gxmulti and the multiplicites of other elements? Try to
use this to get a relationship between the size of an orbit of G and the size
of G.
We suggested earlier that a quotient principle for multisets might prove useful.
The quotient principle came from the sum principle, and we do not have a sum
principle for multisets. Such a principle would say that the size of a union of
disjoint multisets is the sum of their sizes. We have not yet defined the union
of multisets or disjoint multisets, because we havent needed the ideas until now.
We define the union of two multisets S and T to be the multiset in which the
201
202
297. How does the size of the union of the set of multiorbits of a group G acting
on a set S relate to the numbers |Fix(x)|?
298. In Problems 296 and 297 you computed the size of the union of the set of
multiorbits of a group G acting on a set S in two different ways, getting
two different expressions which must be equal. Write the equation that says
they are equal and solve for the number of multiorbits, and therefore the
number of orbits.
6.2.3
299. In Problem 298 you stated and proved a theorem that expresses the number
of orbits in terms of the number of group elements fixing each element of
S. It is often easier to find the number of elements fixed by a given group
element than to find the number of group elements fixing an element of S.
(a) For this purpose, how does the sum x:xS |Fix(x)| relate to the number
of ordered pairs (, x) (with G and x S) such that fixes x?
P
(b) Let () denote the number of elements of S fixed by . How can the
number of ordered pairs (, x) (with G and x S) such that
fixes x be computed from ()? (It is ok to have a summation in your
answer.)
(c) What does this tell you about the number of orbits?
300. A second computation of the result of problem 299 can be done as follows.
203
(a) Let (,
x) = 1 if (x) = x and let (,
x) = 0 otherwise. Notice
that is different from the in the previous problem, because it is a
function of two variables. Use to convert the single summation in
your answer to Problem 298 into a double summation over elements x
of S and elements of G.
(b) Reverse the order of the previous summation in order to convert it into
a single sum involving the function given by
() = the number of elements of S left fixed by .
In Problem 299 you gave a formula for the number of orbits of a group G
acting on a set X. This formula was first worked out by Cauchy in the case
of the symmetric group, and then for more general groups by Frobenius. In his
pioneering book on Group Theory, Burnside used this result as a lemma, and while
he attributed the result to Cauchy and Frobenius in the first edition of his book,
in later editions, he did not. Later on, other mathematicians who used his book
named the result Burnsides Lemma, which is the name by which it is still most
commonly known. Let us agree to call this result the Cauchy-Frobenius-Burnside
Theorem, or CFB Theorem for short in a compromise between historical accuracy
and common usage.
301. In how many ways may we string four (identical) red, six (identical) blue,
and seven (identical) green beads on a necklace?
302. If we have an unlimited supply of identical red beads and identical blue
beads, in how many ways may we string 17 of them on a necklace?
204
303. If we have five (identical) red, five (identical) blue, and five (identical) green
beads, in how many ways may we string them on a necklace?
304. In how many ways may we paint the faces of a cube with six different colors,
using all six?
305. In how many ways may we paint the faces of a cube with two colors of paint?
What if both colors must be used?
306. In how many ways may we color the edges of a (regular) (2n + 1)-gon free
to move around in the plane (so it cannot be flipped) if we use red n times
and blue n + 1 times? If this is a number you have seen before, identify it.
307. In how many ways may we color the edges of a (regular) (2n + 1)-gon free
to move in three-dimensional space so that n edges are colored red and n + 1
edges are colored blue? Your answer may depend on whether n is even or
odd.
308. (Not unusually hard for someone who has worked on chromatic polynomials.)
How many different proper colorings with four colors are there of the vertices
of a graph which is a cycle on five vertices? (If we get one coloring by rotating
or flipping another one, they arent really different.)
309. How many different proper colorings with four colors are there of the graph
in Figure 6.7? Two graphs are the same if we can redraw one of the graphs,
not changing the vertex set or edge set, so that it is identical to the other
one. This is equivalent to permuting the vertices in some way so that when
6.3. POLYA-REDFIELD
ENUMERATION THEORY
205
we apply the permutation to the endpoints of the edges to get a new edge
set, the new edge set is equal to the old one. Such a permutation is called
an automorphism of the graph. Thus two colorings are different if there is
no automorphism of the graph that carries one to the other one.
Figure 6.7: A graph on six vertices.
6.3
P
olya-Redfield Enumeration Theory
206
There is a fascinating subtle issue of what makes two molecules different. For example,
suppose we have a molecule in the form of a cube, with one atom at each vertex. If we interchange
the top and bottom faces of the cube, each atom is still connected to exactly the same atoms
as before. However, we cannot achieve this permutation of the vertices by a member of the
rotation group of the cube. It could well be that the two versions of the molecule interact with
other molecules in different ways, in which case we would consider them chemically different.
On the other hand, if the two versions interact with other molecules in the same way, we would
have no reason to consider them chemically different. This kind of symmetry is an example of
6.3. POLYA-REDFIELD
ENUMERATION THEORY
207
OH
OH
So think intuitively about some figure that has places to be colored. (Think
of the faces of a cube, the beads on a necklace, circles at the vertices of an n-gon,
etc.) How can we picture the coloring? If we number the places to be colored, say
1 to n, then we have a standard way to represent our coloring. For example, if
our colors are blue, green and red, then BBGRRGBG describes a typical coloring
of 8 such places. Unless the places are somehow naturally numbered, this idea
of a coloring imposes structure that is not really there. Even if the structure is
there, visualizing our colorings in this way doesnt pull together any common
features of different colorings; we are simply visualizing all possible colorings. We
have a group (think of it as symmetries of the figure you are imagining) that acts
on the places. That group then acts in a natural way on the colorings of the
places and we are interested in orbits of the colorings. Thus we want a picture
that pulls together the common features of the colorings in an orbit. One way
what is called chirality in chemistry.
208
to pull together similarities of colorings would be to let the letters we are using
as pictures of colors commute as we did with our pictures in Chapter 4; then our
picture BBGRRGBG becomes B 3 G3 R2 , so our picture now records simply how
many times we use each color. Think about how we defined the action of a group
on the colorings of a set on which the group acts. You will see that acting with a
group element wont change how many times each color is used; it simply moves
colors to different places. Thus the picture we now have of a given coloring is an
equally appropriate picture for each coloring in an orbit. One natural question
for us to ask is How many orbits have a given picture?
310. Suppose we draw identical circles at the vertices of a regular hexagon. Suppose we color these circles with two colors, red and blue.
(a) In how many ways may we color the set {1, 2, 3, 4, 5, 6} using the colors
red and blue?
(b) These colorings are partitioned into orbits by the action of the rotation group on the hexagon. Using our standard notation, write down
all these orbits and observe how many orbits have each picture, assuming the picture of a coloring is the product of commuting variables
representing the colors.
(c) Using the picture function of the previous part, write down the picture
enumerator for the orbits of colorings of the vertices of a hexagon under
the action of the rotation group.
In Problem 310c we saw a picture enumerator for pictures of orbits of the action
of a group on colorings. As above, we ask how many orbits of the colorings have
6.3. POLYA-REDFIELD
ENUMERATION THEORY
209
6.3.1
311. Suppose now we have a group G acting on a set and we have a picture
function on that set with the additional feature that for each orbit of the
group, all its elements have the same picture. In this circumstance we define
the picture of an orbit or multiorbit to be the picture of any one of its
members. The orbit enumerator Orb(G, S) is the sum of the pictures of
the orbits. (Note that this is the same as the sum of the pictures of the
multiorbits.) The fixed point enumerator Fix(G, S) is the sum of the
pictures of each of the fixed points of each of the elements of G. We are
going to construct a generating function analog of the CFB theorem. The
main idea of the proof of the CFB theorem was to try to compute in two
different ways the number of elements (i.e. the sum of all the multiplicities
of the elements) in the union of all the multiorbits of a group acting on a
set. Suppose instead we try to compute the sum of all the pictures of all
the elements in the union of the multiorbits of a group acting on a set. By
thinking about how this sum relates to Orb(G, S) and Fix(G, S), find an
210
We will call the theorem of Problem 311 the Orbit-Fixed Point Theorem.
In order to apply the Orbit-Fixed Point Theorem, we need some basic facts about
picture enumerators.
312. Suppose that P1 and P2 are picture functions on sets S1 and S2 in the sense
of Section 4.1.2. Define P on S1 S2 by P (x1 , x2 ) = P1 (x1 )P2 (x2 ). How
are EP1 , EP1 , and EP related? (You may have already done this problem in
another context!)
313. Suppose Pi is a picture function on a set Si for i = 1, . . . , k. We define the
picture of a k-tuple (x1 , x2 , . . . , xk ) to be the product of the pictures of its
elements, i.e.
Pb ((x1 , x2 , . . . xk )) =
k
Y
Pi (xi ).
i=1
6.3. POLYA-REDFIELD
ENUMERATION THEORY
211
coefficients of the resulting polynomial with the various orbits you found in
Problem 310.
315. Find the generating function (in variables R, B) for colorings of the faces of a
cube with two colors (red and blue). What does the generating function tell
you about the number of ways to color the cube (up to spatial movement)
with various combinations of the two colors?
6.3.2
The P
olya-Redfield Theorem
Polyas (and Redfields) famed enumeration theorem deals with situations such as
those in Problems 314 and 315 in which we want a generating function for the set
of all colorings a set S using a set T of colors, where the picture of a coloring is
the product of the multiset of colors it uses. We are again thinking of the colors
as variables. The point of the next series of problems is to analyze the solutions
to Problems 314 and 315 in order to see what Polya and Redfield saw (though
they didnt see it in this notation or using this terminology).
316. In Problem 314 we have four kinds of group elements: the identity (which
fixes every coloring), the rotations through 60 or 300 degrees, the rotations
through 120 and 240 degrees, and the rotation through 180 degrees. The
fixed point enumerator for the rotation group acting on the colorings of the
hexagon is by definition the sum of the fixed point enumerators of colorings
fixed by the identity, of colorings fixed by 60 or 300 degree rotations, of
colorings fixed by 120 or 240 degree rotations, and of colorings fixed by
212
317. In Problem 315 we have five different kinds of group elements. For each
kind of element, to the extent that you havent already done it in an earlier
problem, write down the fixed point enumerator for the elements of that
kind. Factor the enumerators as completely as you can.
318. In Problem 316, each kind of group element has a kind of cycle structure.
For example, a rotation through 180 degrees has three cycles of size two.
What kind of cycle decomposition does a rotation through 60 or 300 degrees
have? What kind of cycle decomposition does a rotation through 120 or 240
degrees have? Discuss the relationship between the cycle structures and the
factored enumerators of fixed points of the permutations in Problem 316.
Recall that we said that a group of permutations acts on a set S if, for each
member of G there is a permutation of S such that
=
for all members and of G. Since is a permutation of S, has a cycle
decomposition as a permutation of S (as well as whatever its cycle decomposition
is in the original permutation group G).
6.3. POLYA-REDFIELD
ENUMERATION THEORY
213
319. In Problem 317, each kind of group element has a kind of cycle decomposition in the action of the rotation group of the cube on the faces of the
cube. For example, a rotation of the cube through 180 degrees around a
vertical axis through the centers of the top and bottom faces has two cycles of size two and two cycles of size one. To the extent that you havent
already done it in an earlier problem, answer the following questions. How
many such rotations does the group have? What are the other kinds
of group elements, and what are their cycle structures? Discuss the relationship between the cycle decomposition and the factored enumerator in
Problem 317.
320. The usual way of describing the Polya-Redfield enumeration theorem involves the cycle indicator or cycle index of a group acting on a set.
Suppose we have a group G acting on a finite set S. Since each group element gives us a permutation of S, as such it has a decomposition into
disjoint cycles as a permutation of S. Suppose has c1 cycles of size 1, c2
cycles of size 2, ..., cn cycles of size n. Then the cycle monomial of is
z() = z1c1 z2c2 zncn .
The cycle indicator or cycle index of G acting on S is
Z(G, S) =
1 X
z().
|G| :G
(a) What is the cycle index for the group D6 acting on the vertices of a
hexagon?
214
321. How can you compute the Orbit Enumerator of G acting on colorings of S
by a finite set T of colors from the cycle index of G acting on S? (Use t,
thought of as a variable, as the picture of an element t of T .) State and prove
the relevant theorem! This is Polyas and Redfields famous enumeration
theorem.
322. Suppose we make a necklace by stringing 12 pieces of brightly colored plastic
tubing onto a string and fastening the ends of the string together. We have
ample supplies of blue, green, red, and yellow tubing available. Give a
generating function in which the coefficient of B i Gj Rk Y h is the number of
necklaces we can make with i blues, j greens, k reds, and h yellows. How
many terms would this generating function have if you expanded it in terms
of powers of B, G, R, and Y ? Does it make sense to do this expansion?
How many of these necklaces have 3 blues, 3 greens, 2 reds, and 4 yellows?
323. What should we substitute for the variables representing colors in the orbit
enumerator of G acting on the set of colorings of S by a set T of colors
in order to compute the total number of orbits of G acting on the set of
colorings? What should we substitute into the variables in the cycle index
of a group G acting on a set S in order to compute the total number of
orbits of G acting on the colorings of S by a set T ? Find the number of
ways to color the faces of a cube with four colors.
6.3. POLYA-REDFIELD
ENUMERATION THEORY
215
324. We have red, green, and blue sticks all of the same length, with a dozen
sticks of each color. We are going to make the skeleton of a cube by taking
eight identical lumps of modeling clay and pushing three sticks into each
lump so that the lumps become the vertices of the cube. (Clearly we wont
need all the sticks!) In how many different ways could we make our cube?
How many cubes have four edges of each color? How many have two red,
four green, and six blue edges?
325. How many cubes can we make in Problem 324 if the lumps of modeling clay
can be any of four colors?
Figure 6.9: A possible computer network.
326. In Figure 6.9 we see a graph with six vertices. Suppose we have three
different kinds of computers that can be placed at the six vertices of the
216
327. Two simple graphs on the set [n] = {1, 2, . . . , n} with edge sets E and E 0
(which we think of as sets of two-element sets for this problem) are said
to be isomorphic if there is a permutation of [n] which, in its action of
two-element sets, carries E to E 0 . We say two graphs are different if they
are not isomorphic. Thus the number of different graphs is the number of
orbits of the set of all sets of two-element subsets of [n] under the action of
the group Sn . We can represent an edge set by its characteristic function
(as in problem 33). That is, we define
(
E ({u, v}) =
1 if {u, v} E
0 otherwise.
Thus we can think of the set of graphs as a set of colorings with colors 0 and
1 of the set of all two-element subsets of [n]. The number of different graphs
with vertex set [n] is thus the number of orbits of this set of colorings under
the action of the symmetric group Sn on the set of two-element subsets of
[n]. Use this to find the number of different graphs on five vertices.
6.4
217
Supplementary Problems
218
219
220
Appendix A
Relations
A.1
A.1.1
328. Consider the functions from S = {2, 1, 0, 1, 2} to T = {1, 2, 3, 4, 5} defined by f (x) = x + 3, and g(x) = x5 5x3 + 5x + 3. Write down the set
of ordered pairs (x, f (x)) for x S and the set of ordered pairs (x, g(x)) for
x S. Are the two functions the same or different?
Problem 328 points out how two functions which appear to be different are
actually the same on some domain of interest to us. Most of the time when we are
thinking about functions it is fine to think of a function casually as a relationship
221
222
APPENDIX A. RELATIONS
between two sets. In Problem 328 the set of ordered pairs you wrote down for
each function is called the relation of the function. When we want to distinguish
between the casual and the careful in talking about relationships, our casual term
will be relationship and our careful term will be relation. So relation is
a technical word in mathematics, and as such it has a technical definition. A
relation from a set S to a set T is a set of ordered pairs whose first elements are in
S and whose second elements are in T . Another way to say this is that a relation
from S to T is a subset of S T .
A typical way to define a function f from a set S, called the domain of the
function, to a set T , called the range, is that f is a relationship from S to T that
relates one and only one member of T to each element of X. We use f (x) to
stand for the element of T that is related to the element x of S. If we wanted
to make our definition more precise, we could substitute the word relation for
the word relationship and we would have a more precise definition. For our
purposes, you can choose whichever definition you prefer. However, in any case,
there is a relation associated with each function. As we said above, the relation
of a function f : S T (which is the standard shorthand for f is a function
from S to T and is usually read as f maps S to T ) is the set of all ordered pairs
(x, f (x)) such that x is in S.
329. Here are some questions that will help you get used to the formal idea of a
relation and the related formal idea of a function. S will stand for a finite
set of size s and T will stand for a finite set of size t.
(a) What is the size of the largest relation from S to T ?
223
224
APPENDIX A. RELATIONS
(c) Assume for the rest of the problem that T 0 is the set of all real numbers
and h : S T 0 is given by h(x) = x2 . Is h one-to-one? Is h onto?
(d) And if the function j : S 0 T 0 is given by j(x) = x2 , is j one-to-one?
Is j onto?
A.1.2
Directed graphs
225
the set, we usually label the vertex with the set element it corresponds to, and we
draw an arrow from the vertex for a to that for b if a is related to b, that is, if the
ordered pair (a, b) is in our relation. We call such an arrow an edge or a directed
edge. We draw the arrow from a to b, for example, because a comes before b in
alphabetical order. We try to choose the locations where we draw our vertices
so that the arrows capture what we are trying to illustrate as well as possible.
Sometimes this entails redrawing our directed graph several times until we think
the arrows capture the relationship well.
332. Draw the digraph of the is a proper subset of relation on the set of subsets
226
APPENDIX A. RELATIONS
of a two element set. How many arrows would you have had to draw if this
problem asked you to draw the digraph for the subsets of a three-element
set?
We also draw digraphs for relations from a finite set S to a finite set T ; we
simply draw vertices for the elements of S (usually in a row) and vertices for the
elements of T (usually in a parallel row) and draw an arrow from x in S to y in
T if x is related to y. Notice that instead of referring to the vertex representing
x, we simply referred to x. This is a common shorthand.
333. Draw the digraph of the relation from the set {A, M, P, S} to the set {Sam,
Mary, Pat, Ann, Polly, Sarah} given by is the first letter of.
334. Draw the digraph of the relation from the set {Sam, Mary, Pat, Ann, Polly,
Sarah} to the set {A, M, P, S} given by has as its first letter.
335. Draw the digraph of the relation on the set {Sam, Mary, Pat, Ann, Polly,
Sarah} given by has the same first letter as.
A.1.3
Digraphs of Functions
336. When we draw the digraph of a function f , we draw an arrow from the
vertex representing x to the vertex representing f (x). One of the relations
you considered in Problems 333 and 334 is the relation of a function.
227
228
APPENDIX A. RELATIONS
(h) Use the digraph of the previous part to explain whether f is one-to-one.
229
The function (the Greek letter iota is pronounced eye-oh-ta) from a set S to
itself, given by the rule (x) = x for every x in S, is called the identity function
on S. If f is a function from S to T and g is a function from T to S such that
g(f (x)) = x for every x in S, we can express this by saying that g f = , where
is the identity function of S. Saying that f (g(x)) = x is the same as saying that
f g = , where now stands for the identity function on T . We use the same
letter for the identity function on two different sets when we can use context to
tell us on which set the identity function is being defined.
339. If f is a function from S to T and g is a function from T to S such that
g(f (x)) = x, how can we tell from context that g f is the identity function
on S and not the identity function on T ?
340. Explain why a function that has an inverse must be a bijection.
341. Is it true that the inverse of a bijection is a bijection?
342. If g and h are inverses of f , then what can we say about g and h?
343. Explain why a bijection must have an inverse.
Since a function with an inverse has exactly one inverse g, we call g the inverse
of f . From now on, when f has an inverse, we shall denote its inverse by f 1 .
Thus f (f 1 (x)) = x and f 1 (f (x)) = x. Equivalently f f 1 = and f 1 f = .
230
A.2
APPENDIX A. RELATIONS
Equivalence Relations
So far weve used relations primarily to talk about functions. There is another
kind of relation, called an equivalence relation, that comes up in the counting
problems with which we began. In Problem 8 with three distinct flavors, it was
probably tempting to say there are 12 flavors for the first pint, 11 for the second,
and 10 for the third, so there are 12 11 10 ways to choose the pints of ice cream.
However, once the pints have been chosen, bought, and put into a bag, there is
no way to tell which is first, which is second and which is third. What we just
counted is lists of three distinct flavorsone-to-one functions from the set {1, 2, 3}
in to the set of ice cream flavors. Two of those lists become equivalent once the
ice cream purchase is made if they list the same ice cream. In other words, two of
those lists become equivalent (are related) if they list same subset of the set of ice
cream flavors. To visualize this relation with a digraph, we would need one vertex
for each of the 12 11 10 lists. Even with five flavors of ice cream, we would need
one vertex for each of 5 4 3 = 60 lists. So for now we will work with the easier
to draw question of choosing three pints of ice cream of different flavors from four
flavors of ice cream.
344. Suppose we have four flavors of ice cream, V(anilla), C(hocolate), S(trawberry)
and P(each). Draw the directed graph whose vertices consist of all lists of
three distinct flavors of the ice cream, and whose edges connect two lists if
they list the same three flavors. This graph makes it pretty clear in how
many really different ways we may choose 3 flavors out of four. How many
is it?
231
345. Now suppose again we are choosing three distinct flavors of ice cream out of
four, but instead of putting scoops in a cone or choosing pints, we are going
to have the three scoops arranged symmetrically in a circular dish. Similarly
to choosing three pints, we can describe a selection of ice cream in terms of
which one goes in the dish first, which one goes in second (say to the right of
the first), and which one goes in third (say to the right of the second scoop,
which makes it to the left of the first scoop). But again, two of these lists
will sometimes be equivalent. Once they are in the dish, we cant tell which
one went in first. However, there is a subtle difference between putting each
flavor in its own small dish and putting all three flavors in a circle in a
larger dish. Think about what makes the lists of flavors equivalent, and
draw the directed graph whose vertices consist of all lists of three of the
flavors of ice cream and whose edges connect two lists between which we
cannot distinguish as dishes of ice cream. How many dishes of ice cream can
we distinguish from one another?
346. Draw the digraph for Problem 38 in the special case where we have four
people sitting around the table.
In Problems 344, 345, and 346 (as well as Problems 34c, 38, and 39d) we can
begin with a set of lists, and say when two lists are equivalent as representations
of the objects we are trying to count. In particular, in Problems 344, 345, and
346 you drew the directed graph for this relation of equivalence. Your digraph
had an arrow from each vertex (list) to itself (or else you want to go back and
give it these arrows). This is what we mean when we say a relation is reflexive.
232
APPENDIX A. RELATIONS
Whenever you had an arrow from one vertex to a second, you had an arrow from
the second back to the first. This is what we mean when we say a relation is
symmetric.
When people sit around a round table, each list is equivalent to itself: if List1
and List2 are identical, then everyone has the same person to the right in both
lists (including the first person in the list being to the right of the last person).
To see the symmetric property of the equivalence of seating arrangements, if List1
and List2 are different, but everyone has the same person to the right when they
sit according to List2 as when they sit according to List1, then everybody better
have the same person to the right when they sit according to List1 as when they
sit according to List2.
In Problems 344, 345 and 346 there is another property of those relations you
may have noticed from the directed graph. Whenever you had an arrow from L1
to L2 and an arrow from L2 to L3 , then there was an arrow from L1 to L3 . This is
what we mean when we say a relation is transitive. You also undoubtedly noticed
how the directed graph divides up into clumps of mutually connected vertices.
This is what equivalence relations are all about. Lets be a bit more precise in our
description of what it means for a relation to be reflexive, symmetric or transitive.
If R is a relation on a set X, we say R is reflexive if (x, x) R for every
x X.
If R is a relation on a set X, we say R is symmetric if (x, y) is in R whenever
(y, x) is in R.
If R is a relation on a set X, we say R is transitive if whenever (x, y) is in
233
234
APPENDIX A. RELATIONS
350. Another relation that you may have learned about in school, perhaps in the
guise of clock arithmetic, is the relation of equivalence modulo n. For
integers (positive, negative, or zero) a and b, we write
ab
(mod n)
235
In Problem 352 the sets Cx are called equivalence classes of the equivalence
relation R. You have just proved that if R is an equivalence relation of the set
X, then each element of X is in exactly one equivalence class of R. Recall that
a partition of a set X is a set of disjoint sets whose union is X. For example,
{1, 3}, {2, 4, 6}, {5} is a partition of the set {1, 2, 3, 4, 5, 6}. Thus another way to
describe what you proved in Problem 352 is the following:
Theorem 10 If R is an equivalence relation on X, then the set of equivalence
classes of R is a partition of X.
Since a partition of S is a set of subsets of S, it is common to call the subsets into
which we partition S the blocks of the partition so that we dont find ourselves in
the uncomfortable position of referring to a set and not being sure whether it is
the set being partitioned or one of the blocks of the partition.
353. In each of Problems 38, 39d, 43, 344, and 345, what does an equivalence
class correspond to? (Five answers are expected here.)
354. Given the partition {1, 3}, {2, 4, 6}, {5} of the set {1, 2, 3, 4, 5, 6}, define two
elements of {1, 2, 3, 4, 5, 6} to be related if they are in the same part of the
partition. That is, define 1 to be related to 3 (and 1 and 3 each related to
itself), define 2 and 4, 2 and 6, and 4 and 6 to be related (and each of 2, 4,
and 6 to be related to itself), and define 5 to be related to itself. Show that
this relation is an equivalence relation.
355. Suppose P = {S1 , S2 , S3 , . . . , Sk } is a partition of S. Define two elements
of S to be related if they are in the same set Si , and otherwise not to be
236
APPENDIX A. RELATIONS
related. Show that this relation is an equivalence relation. Show that the
equivalence classes of the equivalence relation are the sets Si .
In Problem 355 you just proved that each partition of a set gives rise to an
equivalence relation whose classes are just the parts of the partition. Thus in
Problem 352 and Problem 355 you proved the following Theorem.
Theorem 11 A relation R is an equivalence relation on a set S if and only if S
may be partitioned into sets S1 , S2 , . . . , Sn in such a way that x and y are related
by R if and only if they are in the same block Si of the partition.
In Problems 344, 345, 38 and 43 what we were doing in each case was counting
equivalence classes of an equivalence relation. There was a special structure to
the problems that made this somewhat easier to do. For example, in 344, we had
4 3 2 = 24 lists of three distinct flavors chosen from V, C, S, and P. Each list
was equivalent to 3 2 1 = 3! = 6 lists, including itself, from the point of view
of serving 3 small dishes of ice cream. The order in which we selected the three
flavors was unimportant. Thus the set of all 4 3 2 lists was a union of some
number n of equivalence classes, each of size 6. By the product principle, if we
have a union of n disjoint sets, each of size 6, the union has 6n elements. But
we already knew that the union was the set of all 24 lists of three distinct letters
chosen from our four letters. Thus we have 6n = 24, so that we have n = 4
equivalence classes.
In Problem 345 there is a subtle change. In the language we adopted for
seating people around a round table, if we choose the flavors V, C, and S, and
237
arrange them in the dish with C to the right of V and S to the right of C, then
the scoops are in different relative positions than if we arrange them instead with
S to the right of V and C to the right of S. Thus the order in which the scoops
go into the dish is somewhat importantsomewhat, because putting in V first,
then C to its right and S to its right is the same as putting in S first, then V to
its right and C to its right. In this case, each list of three flavors is equivalent to
only three lists, including itself, and so if there are n equivalence classes, we have
3n = 24, so there are 24/3 = 8 equivalence classes.
356. If we have an equivalence relation that divides a set with k elements up
into equivalence classes each of size m, what is the number n of equivalence
classes? Explain why.
357. In Problem 351, what is the number of equivalence classes? Explain in words
the relationship between this problem and the Problem 39d.
358. Describe explicitly what makes two lists of beads equivalent in Problem
43 and how Problem 356 can be used to compute the number of different
necklaces.
359. What are the equivalence classes (write them out as sets of lists) in Problem
45, and why cant we use Problem 356 to compute the number of equivalence
classes?
In Problem 356 you proved our next theorem. In Chapter 1 (Problem 42) we
discovered and stated this theorem in the context of partitions and called it the
Quotient Principle.
238
APPENDIX A. RELATIONS
Appendix B
Mathematical Induction
B.1
B.1.1
There is a variant of one of the bijections we used to prove the Pascal Equation
that comes up in counting the subsets of a set. In the next problem it will help us
compute the total number of subsets of a set, regardless of their size. Our main
goal in this problem, however, is to introduce some ideas that will lead us to one
of the most powerful proof techniques in combinatorics (and many other branches
of mathematics), the principle of mathematical induction.
360. (a) Write down a list of the subsets of {1, 2}. Dont forget the empty set!
239
240
241
242
few nonnegative integers in Problem 360 and for the first few positive integers in
Problem 361. We wanted to prove that the statement was true for all nonnegative
integers in Problem 360 and for all positive integers in Problem 361. In both cases
we used the method of proof by contradiction; for that purpose we assumed that
there was a value of n for which our formula wasnt true. We then chose k to
be the smallest value of n for which our formula wasnt true.1 This meant that
when n was k 1, our formula was true, (or else that k 1 wasnt a nonnegative
integer in Problem 360 or that k 1 wasnt a positive integer in Problem 361).
What we did next was the crux of the proof. We showed that the truth of our
statement for n = k 1 implied the truth of our statement for n = k. This
gave us a contradiction to the assumption that there was an n that made the
statement false. In fact, we will see that we can bypass entirely the use of proof
by contradiction. We used it to help you discover the central ideas of the technique
of proof by mathematical induction.
The central core of mathematical induction is the proof that the truth of a
statement about the integer n for n = k 1 implies the truth of the statement for
n = k. For example, once we know that a set of size 0 has 20 subsets, if we have
proved our implication, we can then conclude that a set of size 1 has 21 subsets,
from which we can conclude that a set of size 2 has 22 subsets, from which we
can conclude that a set of size 3 has 23 subsets, and so on up to a set of size
n having 2n subsets for any nonnegative integer n we choose. In other words,
although it was the idea of proof by contradiction that led us to think about such
1
The fact that every set of positive integers has a smallest element is called the Well-Ordering
Principle. In an axiomatic development of numbers, one takes the Well-Ordering Principle or
some equivalent principle as an axiom.
243
B.1.2
Mathematical induction
244
The first sentence of the last paragraph is called the inductive hypothesis. In
an inductive proof we always make an inductive hypothesis as part of proving that
the truth of our statement when n = k 1 implies the truth of our statement
when n = k. The last paragraph itself is called the inductive step of our proof.
In an inductive step we derive the statement for n = k from the statement for
n = k 1, thus proving that the truth of our statement when n = k 1 implies
245
the truth of our statement when n = k. The last sentence in the last paragraph
is called the inductive conclusion. All inductive proofs should have a base step,
an inductive hypothesis, an inductive step, and an inductive conclusion.
There are a couple details worth noticing. First, in this problem, our base
step was the case n = 0, or in other words, we had b = 0. However, in other
proofs, b could be any integer, positive, negative, or 0. Second, our proof that the
truth of our statement for n = k 1 implies the truth of our statement for n = k
required that k be at least 1, so that there would be an element ak we could take
away in order to describe our bijection. However, condition (2) of the principle
of mathematical induction only requires that we be able to prove the implication
for k > 0, so we were allowed to assume k > 0.
362. Use mathematical induction to prove your formula from Problem 361.
B.1.3
363. Use mathematical induction to prove the well-known formula that for all
positive integers n,
n(n + 1)
.
1 + 2 + + n =
2
364. Experiment with various values of n in the sum
n
X
1
1
1
1
1
+
+
+ +
=
.
12 23 34
n (n + 1) i=1 i (i + 1)
246
B.2
Strong Induction
247
248
249
In a curious twist of language, mathematicians have long called The Division Algorithm or
Euclids Division Algorithm. However as computer science has grown in importance, the word
algorithm has gotten a more precise definition: an algorithm is now a method to do something.
There is a method (in fact there are more than one) to get the q and r that Euclids Division
Theorem gives us, and computer scientists would call these methods algorithms. Your author
has chosen to break with mathematical tradition and restrict his use of the word algorithm to
the more precise interpretation as a computer scientist probably would. We arent giving a
method here, so this is why the name used here is Euclids Division Theorem.
250
Appendix C
Exponential Generating
Functions
C.1
Indicator Functions
When we introduced the idea of a generating function, we said that the formal
sum
ai x i
i=0
252
(1 + x) =
X
n
i=0
xi .
n
Thus
we say that (1 + x) is the generating function for the binomial coefficients
n
. The notation tells us that we are assuming that only i varies in the sum on
i
the right, but that the equation holds for each fixed integer
n. This is implicit
n
when we say that (1 + x) is the generating function for ni , because we havent
written i anywhere in (1 + x)n , so it is free to vary.
Another example of a generating function is given by
xn =
s(n, i)xi .
i=0
Thus we say that xn is the generating function for the Stirling numbers of the
first kind, s(n, i). There is a similar equation for Stirling numbers of the second
kind, namely
xn =
S(n, i)xi .
i=0
However, with our previous definition of generating functions, this equation would
not give a generating function for the Stirling numbers of the second kind, because
S(n, i) is not the coefficient of xi . If we were willing to consider the falling factorial
253
xi
i!
This example suggests that we could say that (1+x)n is the generating function
i
for the falling factorial powers ni relative to the indicator polynomials xi! . In
general, a sequence of polynomials is called a family of indicator polynomials
if there is one polynomial of each nonnegative integer degree in the sequence.
Those familiar with linear algebra will recognize that this says that a family of
indicator polynomials forms a basis for the vector space of polynomials. This
means that each polynomial can be expressed as a sum of numerical multiples of
indicator polynomials in one and only one way. One could use the language of
linear algebra to define indicator polynomials in an even more general way, but a
definition in such generality would not be useful to us at this point.
C.2
x
We say that the expression
i=0 ai i! is the exponential generating function
for the sequence ai . It is standard to use EGF as a shorthand for exponential
P
generating function. In this context we call the generating function ni=0 ai xi that
254
X
xi
i=0
i!
X
xi
i=0
i!
= ex ,
which we also denote by exp(x). Recall from calculus that the usual definition of
ex or exp(x) involves limits at least implicitly. We work our way around that by
P
xi
defining ex to be the power series
i=0 i! .
372. Find the EGF (exponential generating function) for the sequence an = 2n .
What does this say about the EGF for the number of subsets of an n-element
set?
373. Find the EGF (exponential generating function) for the number of ways to
paint the n streetlight poles that run along the north side of Main Street in
Anytown, USA using five colors.
374. For what sequence is
tion)?
375.
ex ex
2
1
For what sequence is ln( 1x
) the EGF? (The notation ln(y) stands for the
natural logarithm of y. People often write log(y) instead.) Hint: Think of
the definition of the logarithm as an integral, and dont worry at this stage
255
whether or not the usual laws of calculus apply, just use them as if they do!
We will then define ln(1 x) to be the power series you get.1
376.
377.
What is the EGF for the number of ways to arrange n people around a round
table? Try to find a recognizable function represented by the EGF. Notice
that we may think of this as the EGF for the number of permutations on n
elements that are cycles.
378.
x
What is the EGF
n=0 p2n (2n)! for the number of ways p2n to pair up 2n
people to play a total of n tennis matches (as in Problems 12a and 44)? Try
to find a recognizable function represented by the EGF.
2n
It is possible to define the derivatives and integrals of power series by the formulas
X
d X
bi xi =
ibi xi1
dx i=0
i=1
and
Z
0
xX
i=0
bi xi =
X
bi i+1
x
i+1
i=0
rather than by using the limit definitions from calculus. It is then possible to prove that the sum
rule, product rule, etc. apply. (There is a little technicality involving the meaning of composition
for power series that turns into a technicality involving the chain rule, but it neednt concern us
at this time.)
256
379. What is the EGF for the sequence 0, 1, 2, 3, . . .? You may think of this as
the EGF for the number of ways to select one element from an n element
set. What is the EGF for the number of ways to select two elements from
an n-element set?
380.
What is the EGF for the sequence 1, 1, , 1, ? Notice that we may think
of this as the EGF for the number of identity permutations on an n-element
set, which is the same as the number of permutations of n elements whose
cycle decomposition consists entirely of 1-cycles, or as the EGF for the
number of ways to select an n-element set (or, if you prefer, an empty set)
from an n-element set. As you may have guessed, there are many other
combinatorial interpretations we could give to this EGF.
381. What is the EGF for the number of ways to select n distinct elements from
a one-element set? What is the EGF for the number of ways to select a
positive number n of distinct elements from a one-element set? Hint: When
you get the answer you will either say of course, or this is a silly problem.
382.
What is the EGF for the number of partitions of a k-element set into exactly
one block? (Hint: is there a partition of the empty set into exactly one
block?)
383.
What is the EGF for the number of ways to arrange k books on one shelf
(assuming they all fit)? What is the EGF for the number of ways to arrange
k books on a fixed number n of shelves, assuming that all the books can fit
on any one shelf? (Remember Problem 122e.)
C.3
257
Applications to Recurrences.
We saw that ordinary generating functions often play a role in solving recurrence
relations. We found them most useful in the constant coefficient case. Exponential generating functions are useful in solving recurrence relations where the
coefficients involve simple functions of n, because the n! in the denominator can
cancel out factors of n in the numerator.
n
384. Consider the recurrence an = nan1 + n(n 1). Multiply both sides by xn! ,
and sum from n = 2 to . (Why do we sum from n = 2 to infinity instead
P
xi
of from n = 1 or n = 0?) Letting y =
i=0 ai i! , show that the left-hand
side of the equation is y a0 a1 x. Express the right hand side in terms of
y, x, and ex . Solve the resulting equation for y and use the result to get an
equation for an . (A finite summation is acceptable in your answer for an .)
385.
258
386.
C.3.1
tions
387.
xi
i=0 ci i! .
259
388.
x
ential equation for the EGF D(x) =
i=0 di i! . What is D(0)? Solve
your differential equation to find an equation for D(x).
(b) Use the equation you found for D(x) to find an equation for dn . Compare this result with the one you computed by inclusion and exclusion.
C.4
One of our major tools for ordinary generating functions was the product principle.
It is thus natural to ask if there is a product principle for exponential generating
functions. In Problem 383 you likely found that the EGF for the number of ways
of arranging n books on one shelf was exactly the same as the EGF for the number
1
of permutations of [n], namely 1x
or (1 x)1 . Then using our formula from
Problem 122e and the ordinary generating function for multisets, you probably
found that the EGF for number of ways of arranging n books on some fixed number
260
390.
What can you say about the relationship among the EGF for the number
of permutations whose cycle structure consists of disjoint two-cycles and
one-cycles, i.e., which are involutions, the exponential generating function
for the number of permutations whose cycle decomposition consists of disjoint two-cycles only and the EGF for the number of permutations whose
261
391.
If we multiply the EGF for derangements times the EGF for the number of
permutations whose cycle decompositions consist of one-cycles only, what
EGF do we get? For what set of objects have we found the EGF?
We now have four examples in which the EGF for a sequence or a pair of objects
is the product of the EGFs for the individual objects making up the sequence or
pair.
392.
i=0
ai xi! and
In the case of painting streetlight poles in Problem 389, let us examine the
relationship among the EGF for painting poles with two colors, the EGF for
painting poles with three colors, and the EGF for painting poles with five colors,
e5x . To be specific, the EGF for painting poles red and white is e2x and the EGF
262
for painting poles blue, green, and yellow is e3x . To decide how to paint poles
with red, white, blue, green, and yellow, we can decide which set of poles is to
be painted with red and white, and which set of poles is to be painted with blue,
green and yellow. Notice that the number of ways to paint a set of poles with red
and white depends only on the size of that set, and the number of ways to paint
a set of poles with blue, green, and yellow depends only on the size of that set.
393.
Suppose that ai is the number of ways to paint a set of i poles with red and
white, and bj is the number of ways to paint a set of j poles with blue, green
and yellow. In how many ways may we take a set N of n poles, divide it
up into two sets I and J (using i to stand for the size of I and j to stand
for the size of the set J, and allowing i and j to vary) and paint the poles
in I red and white and the poles in J blue, green, and yellow? (Give your
answer in terms of ai and bj . Dont figure out formulas for ai and bj to use
in your answer; that will make it harder to get the point of the problem!)
How does this relate to Problem 392?
n
Problem 393 shows that the formula you got for the coefficient of xn! in the
product of two EGFs is the formula we get by splitting a set N of poles into
two parts and painting the poles in the first part with red and white and the
poles in the second part with blue, green, and yellow. More generally, you could
n
interpret your result in Problem 392 to say that the coefficient of xn! in the product
P
xi P
xj
i=0 ai i!
j=0 bj j! of two EGFs is the sum, over all ways of splitting a set N of
size n into an ordered pair of disjoint sets I of size i and J of size j, of the product
ai b j .
263
There seem to be two essential features that relate to the product of exponential generating functions. First, we are considering structures that consist of a
set and some additional mathematical construction on or relationship among the
elements of that set. For example, our set might be a set of light poles and the
additional construction might be a coloring function defined on that set. Other
examples of additional mathematical constructions or relationships on a set could
include a permutation of that set; in particular an involution or a derangement,
a partition of that set, a graph on that set, a connected graph on that set, an
arrangement of the elements of that set around a circle, or an arrangement of the
elements of that set on the shelves of a bookcase. In fact a set with no additional
construction or arrangement on it is also an example of a structure. Its additional
construction is the empty set! When a structure consists of the set S plus the
additional construction, we say the structure uses S. What all the examples we
have mentioned in our earlier discussion of exponential generating functions have
in common is that the number of structures that use a given set is determined by
the size of that set. We will call a family F of structures a species of structures
on subsets of a set X if structures are defined on finite subsets of X and if the
number of structures in the family using a finite set S is finite and is determined
by the size of S (that is, if there is a bijection between subsets S and T of X, the
number of structures in the family that use S equals the number of structures in
the family that use T ). We say a structure is an F-structure if it is a member of
the family F.
394.
264
395.
265
266
267
400.
Use the product principle for EGFs to explain the results of Problems 390
and 391.
401.
Use the general product principle for EGFs or one of its corollaries to explain
the relationship between the EGF for painting streetlight poles in only one
color and the EGF for painting streetlight poles in 5 colors in Problems 373
and 389. What is the EGF for the number pn of ways to paint n streetlight
poles with some fixed number k of colors of paint?
402.
Use the general product principle for EGFs or one of its corollaries to explain
the relationship between the EGF for arranging books on one shelf and the
EGF for arranging books on n shelves in Problem 383.
403. (Optional) Our very first example of exponential generating functions used
the binomial theorem to show that the EGF for k-element permutations of
an n element set is (1 + x)n . Use the EGF for k-element permutations of
a one-element set and the product principle to prove the same thing. Hint:
Review the alternate definition of a function in Section 3.1.2.
404. What is the EGF for the number of ways to paint n streetlight poles red,
white, blue, green and yellow, assuming an even number of poles must be
painted green and an even number of poles must be painted yellow? Give a
formula for the number of ways to paint n poles. (Dont forget the factorial!)
268
405.
What is the EGF for the number of functions from an n-element set onto
a one-element set? (Can there be any functions from the empty set onto a
one-element set?) What is the EGF for the number cn of functions from an
n-element set onto a k element set (where k is fixed)? Use this EGF to find
an explicit expression for the number of functions from a k-element set onto
an n-element set and compare the result with what you got by inclusion and
exclusion.
406.
In Problem 142
you showed that the Bell Numbers Bn satisfy the equation
P
Bn+1 = nk=0 nk Bnk (or a similar equation for Bn ). Multiply both sides
n
of this equation by xn! and sum from n = 0 to infinity. On the left hand side
you have a derivative of a certain EGF we might call B(x). On the right
hand side, you have a product of two EGFs, one of which is B(x). What
is the other one? What differential equation involving B(x) does this give
you? Solve the differential equation for B(x). This is the EGF for the Bell
numbers!
408.
Pn
k=1
n
k
k by using EGFs.
In light of Problem 382, why is the EGF for the Stirling numbers S(n, k) of
the second kind (with n fixed and k allowed to vary) not (ex 1)n ? What
is it equal to instead?
C.5
269
409.
If f (x) is the EGF for the number of partitions of an n-set into one block,
and g(x) is the EGF for the total number of partitions of an n-element set,
that is, for the Bell numbers Bn , how are the two EGFs related?
410.
Let f (x) be the EGF for the number of permutations of an n-element set
with one cycle of size one or two and no other cycles, including no other onecycles. What is f (x)? What is the EGF g(x) for the number of permutations
of an n-element set all of whose cycles have size one or two, that is, the
270
411.
Let f (x) be the EGF for the number of permutations of an n-element set
whose cycle decomposition consists of exactly one two-cycle and no other
cycles (this includes having no one-cycles). Let g(x) be the EGF for the
number of permutations whose cycle decomposition consists of two-cycles
only, that is, for tennis pairings. What is f (x)? What is g(x)? How are
these two exponential generating functions related?
412.
Let f (x) be the EGF for the number of permutations of an n-element set
that have exactly one cycle. Notice that if n > 1 this means they have no
one-cycles. (This is the same as the EGF for the number of ways to arrange
n people around a round table.) Let g(x) be the EGF for the total number
of permutations of an n-element set. What is f (x)? What is g(x)? How are
f (x) and g(x) related?
There was one element that our last four problems had in common. In each
case our EGF f (x) involved the number of structures of a certain type (partitions,
telephone networks, tennis pairings, permutations) that used only one set of an
appropriate kind. (That is, we had a partition with one part, a telephone network
consisting either of one person or two people connected to each other, a tennis
pairing of one set of two people, or a permutation with one cycle.) Our EGF g(x)
was the number of structures of the same type (we put type in quotation marks
here because we dont plan to define it formally) that could consist of any number
of sets of the appropriate kind. Notice that the order of these sets was irrelevant.
271
For example, we dont order the blocks of a partition or the cycles in a cycle
decomposition of a permutation. Thus we were relating the EGF for structures
which were somehow building blocks to the EGF for structures which were sets
of building blocks. For a reason that you will see later, it is common to call the
building blocks connected structures. Notice that our connected structures were
all based on nonempty sets, so we had no connected structures whose value was
P
xi
the empty set. Thus in each case, if f (x) =
i=0 ai i! , we would have a0 = 0.
The relationship between the EGFs was always g(x) = ef (x) . We now give a
combinatorial explanation for this relationship.
413.
X
f (x)k
f (x)k
f (x)2
+ +
+ =
,
2!
k!
k!
k=0
xn
n!
xn
n!
in
f (x)k
?
k!
in ef (x) count?
In Problem 413 we proved the following theorem, which is called the exponential
formula.
Theorem 14 Suppose that F is a species of structures on subsets of a set X with
no structures on the empty set. Let f (x) be the EGF for F. Then the coefficient
272
of xn! in ef (x) is the number of sets of structures on disjoint sets whose union is a
particular set of size n.
Let us see how the exponential formula applies to the examples in Problems
409, 410, 411 and 412. In Problem 382 our family F should consist of one-block
partitions of finite subsets of a set, say the set of natural numbers. Since a partition
of a set is a set of blocks whose union is S, a one block partition whose block is
B is the set {B}. Then any nonempty finite subset of the natural numbers is
the set used by exactly one structure in F. (There is no one block partition of
the empty set, so we have no structures using the empty set.) As you showed
in Problem 382 the EGF for partitions with just one block is ex 1. Thus by
the exponential formula, exp(ex 1) is the EGF for sets of disjoint subsets of the
positive integers whose union is any particular set N of size n. This set of disjoint
sets partitions the set N . Thus exp(ex 1) is the EGF for partitions of sets of
size n. (As we wrote our description, it is the EGF for partitions of n-element
subsets of the positive integers, but any two n-element sets have the same number
of partitions.) In other words, exp(ex 1) is the exponential generating function
for the Bell numbers Bn .
414.
Explain how the exponential formula proves the relationship we saw in Problem 412.
415.
Explain how the exponential formula proves the relationship we saw in Problem 411.
416.
Explain how the exponential formula proves the relationship we saw in Problem 410.
417.
273
In Problem 373 we saw that the EGF for the number of ways to use five
colors of paint to paint n light poles along the north side of Main Street
in Anytown was e5x . We should expect an explanation of this EGF using
the exponential formula. Let F be the family of all one-element sets of light
poles with the additional construction of an ordered pair consisting of a light
pole and a color. Thus a given light pole occurs in five ordered pairs. Put no
structure on any other finite set. Show that this is a species of structures on
the finite subsets of the positive integers. What is the exponential generating
function f (x) for F? Assuming that there is no upper limit on the number
of light poles, what subsets of S does the exponential formula tell us are
counted by the coefficient of xn in ef (x) ? How do the sets being counted
relate to ways to paint light poles?
274
418.
Show that every vertex of a graph lies in one and only one connected component of a graph. (Notice that this shows that the connected components
of a graph form a partition of the vertex set of the graph.)
419.
Explain why no edge of the graph connects two vertices in different connected
components.
420.
The last sequence of problems shows that we may think of any graph as the
set of its connected component graphs. (Once we know them, we know all the
vertices and all the edges of the graph.) Notice that a graph is connected if and
only if it has exactly one connected component. Since the connected components
form a partition of the vertex set of a graph, the exponential formula will relate
the EGF for the number of connected graphs on n vertices with the EGF for the
number of graphs (connected or not) on n vertices. However, because we can draw
as many edges as we want between two vertices of a graph, there are infinitely
many graphs on n vertices, and so the problem of counting them is uninteresting.
We can make it interesting by considering simple graphs, namely graphs in
which each edge has two distinct endpoints and no two edges connect the same
two vertices. It is because connected simple graphs form the building blocks for
viewing all simple graphs as sets of connected components that we refer to the
275
building blocks for structures counted by the EGFs in the exponential formula as
connected structures.
421.
x
Suppose that f (x) =
n=0 cn n! is the exponential generating function for
P
xi
the number of simple connected graphs on n vertices and g(x) =
i=0 ai i!
is the exponential generating function for the number of simple graphs on i
vertices. From this point onward, any use of the word graph means simple
graph.
x0
0!
(f) You can now use the previous parts of the problem to find a formula
for cn that involves summing over all partitions of the integer n. (It
isnt the simplest formula in the world, and it isnt the easiest formula
in the world to figure out, but it is nonetheless a formula with which
one could actually make computations!) Find such a formula.
276
The point to the last problem is that we can use the exponential formula in
reverse to say that if g(x) is the EGF for the number of (nonempty) connected
structures of size n in a given family of combinatorial structures and f (x) is the
EGF for all the structures of size n in that family, then not only is f (x) = eg(x) ,
but g(x) = ln(f (x)) as well. Further, if we happen to have a formula for either
the coefficients of f (x) or the coefficients of g(x), we can get a formula for the
coefficients of the other one!
C.6
Supplementary Problems
1. Use product principle for EGFs and the idea of coloring a set in two colors
to prove the formula ex ex = e2x .
2. Find the EGF for the number of ordered functions from a k-element set to
an n-element set.
3. Find the EGF for the number of ways to string n distinct beads onto a
necklace.
4. Find the exponential generating function for the number of broken permutations of a k-element set into n parts.
5. Find the EGF for the total number of broken permutations of a k-element
set.
277
6. Find the EGF for the number of graphs on n vertices in which every vertex
has degree 2.
7. Recall that a cycle of a permutation cannot be empty.
(a) What is the EGF for the number of cycles on an even number of elements (i.e. permutations of an even number n of elements that form an
n-cycle)? Your answer should not have a summation sign in it. Hint:
P
x2i
If y =
i=0 2i , what is the derivative of y?
(b) What is the EGF for the number of permutations on n elements whose
cycle decomposition consists of even cycles?
(c) What is the EGF for the number of cycles on an odd number of elements?
(d) What is the EGF for the number of permutations on n elements whose
cycle decomposition consists of odd cycles?
(e) How do the EGFs in parts (b) and (d) of this problem relate to the
EGF for all permutations on n elements?
278
Index
S(k,
n), 63
n
, 12
k
n!, 9
Stirlings formula for, 21
k
n , 60
nk , 9
q-ary factorial, 91
q-binomial coefficient, 90
s(k, n), 66
Bell Number, 64
bijection, 12, 149
bijection principle, 12
binomial coefficient, 12
q-binomial, 90
Binomial Theorem, 26
binomial theorem
extended, 86
block of a partition, 6, 154
broken permutation, 62
Burnsides Lemma, 133
Cartesian product, 6
Catalan Number, 23
(Problem 306), 133
generating function for, 97
recurrence for, 97, 98
Catalan Path, 24
280
Catalan paths, 23
Cauchy-Frobenius-Burnside Theorem,
133
characteristic function, 15
chromatic polynomial of a graph, 108
Chung-Feller Theorem, 23
closure property, 113
coefficient
multinomial, 65
coloring
standard notation for, 127
standard ordering for, 127
coloring of a graph, 106
proper, 106
colorings
action of a group on, 128
combinations, 12
commutative law, 120
complement of a partition, 70
composition, 29
k parts
number of, 29
composition of functions, 112, 150
compositions
k parts, 29
INDEX
number of, 30
congruence modulo n, 153
conjugate of an integer partition, 69
connected component graph, 180
connected component of a graph, 107,
179
connected structures and EGFs, 178
constant coefficient linear recurrence,
43
contraction, 50
cost of a spanning tree, 49
cycle
element of, 121
equivalent, 122
cycle (of a permutation), 121
cycle decomposition, 122
cycle index, 140
cycle of a permutation, 121
cyclic group, 122
definition
inductive, 36
recursive, 36
degree of a vertex, 45
degree sequence of a graph, 54, 77
INDEX
ordered, 54, 77
deletion, 50
deletion-contraction recurrence, 51, 108
derangement, 103
derangement problem, 103
diagram
of a partition
Ferrers, 69
Young, 69
digraph, 10, 147
vertex of, 10
dihedral group, 117
Dijkstras algorithm, 52
directed graph, 10, 147
disjoint, 4
distance in a graph, 52
distance in a weighted graph, 52
domain (of a function), 145
double induction, 38
strong, 38
driving function, 43
Dyck path, 24
edge, 28, 45, 148
in a digraph, 148
281
of a complete graph, 28
EGF, 166
element of a cycle, 121
equivalence class, 154
equivalence relation, 153, 155
equivalent cycles, 122
exponential formula, 178
connected structures for, 180
exponential generating function, 166,
174
product principle for, 174
exponential generating functions for
connected structures, 178
extended binomial theorem, 86
factorial, 9, 36, 60
q-ary, 91
falling, 60
factorial power
falling, 9
rising, 60
falling factorial power, 9, 60
Ferrers diagram, 69
Fibonacci numbers, 96
fix, 131
282
fixed point enumerator, 137
function, 3, 145
alternate definition, 60
bijection, 12
characteristic, 15
composition of, 150
digraph of, 10
domain, 145
driving, 43
identity, 112, 150
injection, 4
inverse, 113
one-to-one, 4, 146
onto, 11, 146
and Stirling Numbers, 64
ordered, 60
onto, 60
range, 145
relation of, 145
surjection, 11, 146
functions
composition of, 112
number of, 36, 57
one-to-one
number of, 58
INDEX
onto
number of, 106
general product principle, 7, 8, 37
generating function, 82
exponential, 166, 174
ordinary, 166
product principle for, 85
geometric progression, 44
geometric series, 44, 86
graph, 45
directed, 10
chromatic polynomial of, 108
coloring of, 106
proper, 106
complete, 28
connected component of, 107, 179
coordinate, 147
directed, 147
distance in, 52
simple, 180
Gray Code, 30
greedy method, 50
grop
multiorbit of, 130
INDEX
283
group
dihedral, 117
group acting on a set, 125
group of permutations, 114
Lah number, 62
lattice path, 21
diagonal, 22
length (of a path), 52
linear recurrence, 43, 93
constant coefficient, 43
homogeneous, 43
second order, 93
284
multiplicity in a multiset, 61
multiset, 61
multisets
product principle for, 131
quotient principle for, 132
sum principle for, 131
union of, 131
one-to-one, 4
one-to-one function, 146
onto function, 11, 146
counting, 64
ordered, 60
onto functions
number of, 106
orbit, 129
orbit enumerator, 137
Orbit-Fixed Point Theorem, 137
ordered degree sequence of a graph,
54, 77
ordered function, 60
ordered onto function, 60
ordered pair, 3
ordinary generating function, 166
Polya-Redfield Theorem, 140
INDEX
pair structure, 173
pair, ordered, 3
partial fractions
method of, 94
partition
blocks of, 6
of a set, 6, 63
partition (of a set), 154
partition of a set
type vector, 64
partition of an integer, 67
conjugate of, 69
decreasing list, 68
Ferrers diagram, 69
into n parts, 67
self-conjugate, 69
type vector, 68
Young diagram, 69
partitions of a set
number of, 64
Pascals Triangle, 13
path
lattice, 21
diagonal, 22
length of, 52
INDEX
permutation
k-element, 8
as a bijection, 11
broken, 62
cycle of, 121
two row notation, 115
permutation group, 114
multiorbit of, 130
Pi notation, 9
picture enumerator, 81
picture enumerators
product principle for, 81
pigeonhole principle, 27
generalized, 27
Principle
Product
for EGFs, 174
principle
bijection, 12
product, 5, 6
general, 7
quotient, 156
sum, 5, 6
for multisets, 131
285
principle of inclusion and exclusion,
101, 105
for unions of sets, 104
principle of mathematical induction,
33, 159
probabilistic method, 39
product
Cartesian, 6
product notation, 9
product principle, 5, 6
general, 7, 8, 37
picture enumerators, 81
Product Principle for EGFs, 174
product principle for generating functions, 85
product principle for multisets, 131
progression
arithmetic, 43
geometric, 44
proper coloring of a graph, 106
quotient principle, 19, 156
quotient principle for multisets, 132
range (of a function), 145
286
recurrence, 41
constant coefficient, 93, 94
deletion-contraction, 51
linear, 43, 93
linear homogeneous, 43
second order, 93
solution to, 41
two variable, 63
recurrence relation, 41
recursive definition, 36
reflexive, 152
relation, 145
equivalence, 153, 155
of a function, 145
recurrence, 41
reflexive, 152
transitive, 152
rising factorial power, 60
rotation group, 114
second order recurrence, 93
self-conjugate partition, 69
series
arithmetic, 43
geometric, 44, 86
INDEX
set
colorings of
action of a group on, 128
sets
disjoint, 4
mutually disjoint, 5
simple graph, 180
space of polynomials, 66
spanning tree, 48
cost of, 49
minimum cost, 50
species, 173
exponential generating function for,
174
standard notation for a coloring, 127
Stirling Number
first kind, 66
second kind, 63, 106
Stirlings formula for n!, 21
Stirlings triangle
first kind, 66
second kind, 63
strong double induction, 38
structure
pair, 173
INDEX
using a set, 173
subgroup, 120
sum principle, 5, 6, 101
surjection, 11, 146
surjections
number of, 106
symmetric, 152
symmetric group, 115
transitive, 152
tree, 46
spanning, 48
cost of, 49
minimum cost, 50
Twentyfold Way, 56
two row notation, 115
type vector for a partition of an integer, 68
type vector of a partition of a set, 64
union of multisets, 131
uses
a structure using a set, 173
vertex, 28, 45, 148
degree of, 45
287
of a complete graph, 28, 148
vertex of a digraph, 10
Young diagram, 69