Shahriari 2022 Introduction
Shahriari 2022 Introduction
Shahriari 2022 Introduction
Introduction
Accurate reckoning. The entrance into the knowledge of all existing things and all
obscure secrets.
–The Ahmes–Rhind Papyrus
What is Combinatorics?
Combinatorics is a collection of techniques and a language for the study of (inite or
countably ininite) discrete structures. Given a set of elements (and possibly some structure
on that set), typical questions in combinatorics are:
• Does a speciic arrangement of the elements exist?
• How many such arrangements are there?
• What properties do these arrangements have?
• Which one of the arrangements is maximal, minimal, or optimal according to some
criterion?
Unlike many other areas of mathematics – e.g., analysis, algebra, topology – the core of
combinatorics is neither its subject matter nor a set of “fundamental” theorems. More than
anything else, combinatorics is a collection – some may say a hodgepodge – of techniques,
attitudes, and general principles for solving problems about discrete structures. For any given
problem, a combinatorist combines some of these techniques and principles – e.g., the
pigeonhole principle, the inclusion–exclusion principle, the marriage theorem, various
counting techniques, induction, recurrence relations, generating functions, probabilistic
arguments, asymptotic analysis – with (often clever) ad hoc arguments. The result is a fun
and dificult subject.
In today’s mathematical world, in no small part due to the power of digital computers,
most mathematicians ind much use for the tool box of combinatorics. In problems of pure
mathematics, often, after deciphering the layers of theory, you ind a combinatorics problem
at the core. Outside of mathematics, and as an example, combinatorial problems abound in
computer science.
Typical Problems
To whet your appetite, here is a preliminary sample of problems that we will encounter in the
course of this text.
2 Introduction
• How many sequences a1,a2, . . . ,a12 are there consisting of four 0’s and eight 1’s, if no two
consecutive terms are both 0’s?
• A bakery has eight kinds of donuts, and a box holds one dozen donuts. How many different
boxes can you buy? How many different boxes are there that contain at least one of
each kind?
• A bakery sells seven kinds of donuts. How many ways are there to choose one dozen donuts
if no more than three donuts of any kind are used?
• Determine the number of n-digit numbers with all digits odd, such that 1 and 3 each occur
a positive even number of times.
• We are trying to reconstruct a word that is made from the letters A, B, C, D, and R. We are
given a frequency table that shows the number of times a speciic triple occurs in the word:
triple frequency
ABR 2
ACA 1
ADA 1
BRA 2
CAD 1
DAB 1
RAC 1
For example, ABR occurs twice while ACA appears once. We want to know all words with
the same triples and with the same frequency table. The answer may be that there are no
such words. Note that by a word we mean an ordered collection of letters and we are not
concerned with meaning.
• A particular signaling network consists of six pieces of communications equipment:
x1,x2,y1,y2,z1,z2
We can choose various pairs of these and link each pair through an intermediate facility
(e.g., microwave towers, trunk groups). Intermediate facilities are expensive to build but
if one fails, then all the links through them become inoperative. So, if we build just one
intermediate facility and route all of our connections through it, then its failure will
disconnect everything. However, the design speciication requires that if one intermediate
facility fails, then there will remain at least one link between at least one of the x’s and one
of the y’s and between one of the x’s and one of the z’s, as well as between one of the y’s
and one of the z’s. What is the minimum number of facilities that we need and how should
the connections be designed?
• A soccer ball is usually tiled with 12 pentagons and 20 hexagons. Are any other combina-
tions of pentagons and hexagons possible?
How Do We “Count”?
Counting the number of conigurations of a certain type is an important part of combi-
natorics. In all of the examples in the previous section, it is clear what kind of an answer
How Do We “Count”? 3
2 × 2 × · · · × 2 = 2n .
n
This proof gives a closed formula for the answer, and, in fact, gives more than was
asked. It also tells us how to construct all the subsets.
(b) Assume n people give their n hats to a hat-check person. Let f (n) be the number of ways
that the hats can be returned, so that everyone has one hat, but no one has their own hat.
If we list the hats on the left and their owners on the right, then the igure below shows
three ways of returning hats to four people so that none of them gets their own hat back.
1 1 1 1 1 1
2 2 2 2 2 2
3 3 3 3 3 3
4 4 4 4 4 4
You should check that f (1) = 0, f (2) = 1, and f (3) = 2. You should also try to ind
f (4).
We will show in Section 8.3 that
n
(−1)i
f (n) = n! .
i!
i=0
This is a formula – and you should check your answers for n = 1, . . . ,4 using it – but
we would have preferred a “nice” closed formula. While you may not ind this formula
pleasing, it does work, and will become even more meaningful when we understand the
signiicance of each term in the sum.
It is also possible to show that f (n) is the nearest integer to n!e . This is, of course, easier
to use. But this formula may not have a combinatorial signiicance, and hence, it may be
argued, that it gives us less insight. It is, however, fascinating that in answering a question
about hats, the number e would make an appearance.
(c) Let [n] = {1, . . . ,n}. Let f (n) be the number of subsets of [n] that do not contain two
consecutive integers. For example, if n = 4, then the subsets of {1,2,3,4} that do not
contain two consecutive integers are
4 Introduction
We see that we could continue and, step by step, calculate the terms of the sequence.
This is quite tedious. An alternative way to approach this problem is through generating
functions. If we want to ind a formula for some function f (n) where n is a natural number,
then we can form the generating function of f (n):
f (n)xn = f (0) + f (1)x + f (2)x2 + · · · + f (n)xn + · · · .
n≥0
Here we are concerned with formal power series, and questions of convergence do not
come up (at least for elementary applications). Sometimes this power series has a nice
closed form and then we can manipulate this function and get information about f (n).
So for our problem, let
F(x) = a0 + a1 x + a2 x2 + · · · .
How Do We “Count”? 5
Now
F(x)F(x) = (a0 + a1 x + a2 x2 + · · · )(a0 + a1 x + a2 x2 + · · · )
= a20 + (a0 a1 + a1 a0 )x + (a0 a2 + a1 a1 + a2 a0 )x2 + · · ·
= 1 + x + x2 + · · ·
1
= .
1−x
1
We have (F(x))2 = 1−x and so
1
F(x) = √ .
1−x
Now an is the coeficient of xn in the Taylor series expansion of F(x). So, we can use a
symbolic algebra software such as SageMath , Maple , or Mathematica to ind any
desired value of an .
As an example, in Maple, we irst deine the function by > F := √ 1 , and
1−x
then get the coeficient of x47 in the Taylor polynomial expansion of F at x = 0 by
>coeftayl(F,x=0,47). We get
50803160635786570329644235
a47 = .
618970019642690137449562112
It is amazing that calculus can help in solving such a discrete problem. In fact, the
generating function F(x) can actually be used to get
1 · 3 · 5 · · · (2n − 1)
an = .
2n n!
However, it is not clear that this formula is any better than the generating function.
As the examples show, we will not only use a myriad of techniques for solving counting
problems, but we will also reine our sense of what a good solution should look like. This all
will (hopefully) become clear as we get our hands dirty and start solving problems.