Beruflich Dokumente
Kultur Dokumente
Available soon:
List of illustrations
List of tables
1 What is combinatorics?
2 Four types of problem
3 Permutations and combinations
4 A combinatorial zoo
5 Tilings and polyhedra
6 Graphs
7 Square arrays
8 Designs and geometry
9 Partitions
Further reading
Index
List of illustrations
16 Pascal’s triangle
21 The Tower of Hanoi problem, and its solution for three discs
25 Colouring 2 × 2 chessboards
26 A floor tiling with triangles and hexagons and a polyhedron with triangles
and squares
66 Square 1
67 Square 2
First of all, unlike many mathematical problems that involve much abstract and
technical language, they’re all easy to understand, even though some of them
may prove to be frustratingly difficult to solve. This is one of the delights of the
subject.
Secondly, although they may appear diverse and unrelated, they mainly involve
selecting, arranging, or counting objects of various types. In particular, they can
all be expressed as:
Does such-and-such exist? If so, how can we construct it, and how many of them are there? And
which one is the ‘best’?
To clarify our ideas, let’s see how various dictionaries define combinatorics.
the branch of mathematics concerned with the theory of enumeration, or combinations and
permutations, in order to solve problems about the possibility of constructing arrangements of objects
which satisfy specified conditions.
Thus the subject involves finite sets or discrete elements that proceed in separate
steps (such as the numbers 1, 2, 3, … ), rather than continuous systems such as
the totality of numbers (including π, , etc.) or ideas of gradual change as
found in the calculus. The Encyclopaedia Britannica extends this distinction by
defining combinatorics as
the field of mathematics concerned with problems of selection, arrangement, and operation within a
finite or discrete system … One of the basic problems of combinatorics is to determine the number of
possible configurations (e.g., graphs, designs, arrays) of a given type.
adding that
Mathematicians sometimes use the term ‘combinatorics’ to refer to a larger subset of discrete
mathematics that includes graph theory. In that case, what is commonly called combinatorics is then
referred to as ‘enumeration’.
The subject of combinatorics can be dated back some 3000 years to ancient
China and India. For many years, especially throughout the Middle Ages and the
Renaissance, it consisted mainly of problems involving the permutations and
combinations of certain objects, topics we meet in Chapter 3. Indeed, one of the
earliest works to introduce the word ‘combinatorial’ was a Dissertation on the
Combinatorial Art by the 20-year-old Gottfried Wilhelm Leibniz in 1666 (see
Figure 1). This work mainly discussed permutations and combinations, even
claiming on its front page to ‘prove the existence of God with complete
mathematical certainty’. We make no such claim for this book.
1. Leibniz’s Dissertation on the Combinatorial Art.
Undoubtedly part of the reason for the subject’s recent importance has arisen
from the growth of computer science and the increasing use of algorithmic
methods for solving real-world practical problems. These have led to
combinatorial applications in a wide range of subject areas, both within and
outside mathematics, including network analysis, coding theory, probability,
virology, experimental design, scheduling, and operations research.
For example, suppose that we wish to fly from London (England) to London
(Ontario). Does a suitable route exist? If so, can we construct one? How many
routes are there? Which route is best, according to some agreed criterion (such as
shortest time taken, shortest distance, or least cost incurred)?
As we’ll see, these types of problem are not unrelated; for example, the easiest
way to prove that something exists may be to construct it explicitly.
Existence problems
We now introduce some existence problems. Several of these will reappear later
in the book.
Tilings
Figure 2 shows a tiled floor pattern constructed from squares and regular
octagons that match up exactly without any gaps or overlaps. What other tiling
patterns are possible? For example, does there exist a tiling pattern with both
squares and regular hexagons?
We can easily answer this by looking at angles. For the tiling in Figure 2 the
angles appearing at each meeting point of squares and octagons are 90° (for the
square) and 135° (for each of the two octagons), giving a total of
.
Similarly, if there existed a tiling with both squares and hexagons, then each
meeting point would have a combination of 90° angles (for the squares) and
120° angles (for the hexagons) adding up to 360°. But this is impossible, for if
there were only one hexagon (120°) then the remaining 240° couldn’t be made
up of right angles, if there were two hexagons (240°) the remaining 120°
couldn’t be made up from right angles, and if there were three hexagons (360°)
there’d be no room for any squares. So no combination of both 90° and 120°
angles can make up the desired 360° and no such tiling can exist.
It’s easy to see that we can cover all the sixty-four squares of a chessboard with
dominoes, each covering two squares of the board—there are many ways of
doing so. If we remove a single corner square, then this is no longer possible,
since an odd number of squares remains. But what happens if we remove two
opposite corner squares? Does there exist a domino covering of the remaining
sixty-two squares?
At first sight it may seem as though much experimentation will be needed. But
the answer is very simple once we notice that every domino must cover a black
square and a white square. Since the two removed corner squares have the same
colour, there are now thirty-two squares of one colour and thirty of the other
colour, so no covering by dominoes can exist.
The knight’s tour problem
Knight’s-tour problem: Does there exist a ‘knight’s tour’ in which a knight visits all sixty-four
squares just once and returns to its starting point?
Figure 4 shows the medieval city of Königsberg in Eastern Prussia. In the 18th
century the four regions of the city separated by the River Pregel were joined by
seven bridges.
Königsberg bridges problem: It is said that the citizens of Königsberg wished to take a walk,
crossing each bridge exactly once before returning to their starting point. Does such a route exist?
This problem was answered by the Swiss mathematician Leonhard Euler, who
extended his solution to any arrangement of regions connected by bridges. We
present his answer in Chapter 6 when we discuss Eulerian graphs.
4. Königsberg with its seven bridges.
The Gas–Water–Electricity problem
Figure 5 shows the problem with eight of the nine possible connections drawn
in. Can we now insert the missing link, connecting Mr Beastly to Water? We
answer this question when we discuss planar graphs in Chapter 6.
A student of mine asked me today to give him a reason for a fact which I did not know was a fact—
and do not yet. He says that if a figure be anyhow divided and the compartments be differently
coloured so that figures with any portion of common boundary line are differently coloured—four
colours may be wanted, but not more … Query cannot a necessity for five or more be invented?
Four-colour problem: Can the countries of every map be coloured with just four colours so that
neighbouring countries receive different colours, or do there exist maps that require five or more
colours?
It might seem that the more complicated a map is, the more colours should be
needed to colour its countries. Certainly four colours are needed for some maps,
such as the one in Figure 6. But do four colours suffice for all maps? We answer
this question in Chapter 6.
Suppose that we’re stuck in the middle of a maze. We know that there must be a
way of escaping from the maze (after all, we got into it!), but we need to find a
method for doing so.
If we have a drawing of the whole maze it’s much easier to find our way out—
for example, Figure 7(a) shows the well-known maze at Hampton Court with the
various junctions marked with letters. We can then replace the maze by Figure
7(b) which shows the direct routes between successive junctions—for example,
junction D leads directly to junctions B, E, and F. After eliminating the dead-
ends at C, I, K, and M, we can then spot all the direct ways of escaping from the
maze. There are four of them, one of which is shown in Figure 7(c).
7. The Hampton Court maze.
But this is of no help if we’re stuck in the middle of a maze without access to a
map. One suggestion for getting out was given by the French mathematician
Gaston Tarry in 1895:
Don’t return along a passage that led you to a junction in the first place unless you have no
alternative.
Tarry also formalized this rule in the form of an algorithm. Named after the 9th-
century Persian mathematician al-Khwārizmī, an algorithm is a finite procedure
for solving a problem step by step—somewhat like a recipe in a cookery book or
a set of road directions for driving from one location to another. When we insert
the appropriate input data (the ingredients or the two locations) and ‘turn the
handle’, we should obtain the required solution as our output. In this book we’ll
meet a number of algorithms for solving combinatorial problems.
Enumeration problems
Ever since earliest times people have needed to count the objects around them.
We’re used to such questions as:
Some problems may involve both counting and listing; for example:
How many times does the number 7 appear in the first fifty digits of π?
Since no theoretical methods are known for answering the counting problem,
we’re forced to list the digits explicitly as
3.1415926535897932384626433832795028841971693993751
Different alkanes can have the same formula—Figure 8 depicts the three
molecules with formula (where )—and we may ask:
In 1875 the English mathematician Arthur Cayley showed how to answer this,
but no simple formula exists for the result, and as n increases it soon becomes
impossible to list them all.
Polyominoes
Figure 9 lists the first few: there are just one for and , two for ,
five for , and twelve for . No answer to our question is known in
general, but n-ominoes have been counted at least as far as where the
number is 153,511,100,594,603.
It’s useful to have some basic counting rules, and the ones we describe here are
fairly self-evident. In what follows, all the sets are finite.
If we wish to count all the books in a bookcase we can count the books on each
shelf and add the numbers together. If we want to find the number of days in the
last three months of the year, we count the days in October (thirty-one),
November (thirty), and December (thirty-one), and add the results together,
giving ninety-two. Or if we wish to find the number of words on this page, we
can count the words in each line and add the results together.
In general we have the following rule; here, subsets are disjoint if they have no
objects in common:
Addition rule: To find the number of objects in a set, split the set into disjoint subsets, count the
object in each subset, and add the results.
In these examples, the subsets are the books on each shelf, the days in each
month, and the words in each line.
If there are just two subsets, we can turn the problem around:
Subtraction rule: If a set of objects can be split into two subsets A and B, then the number of objects
in B is obtained by subtracting the number of objects in A from the number in the whole set.
For example, if a class of thirty children contains fourteen boys, then it must
contain girls, and we can find the number of days in the first nine
months of a non-leap year by subtracting the number of days in the last three
months (ninety-two) from the total number of days in the year (365), giving 273
as the answer.
The subtraction rule extends easily to sets that are split into more than two
subsets with no elements in common. For example, if we have a hundred red,
white, or blue flags, and if fifty flags are red and thirty flags are blue, then the
number of white flags is . In Chapter 4 we present the inclusion–
exclusion principle, which extends this simple idea to the situation where the
subsets may have objects in common.
A restaurant menu has two starters (soup or pâté), four main courses (beef, chicken, fish, or
vegetarian) and three desserts (pudding, fruit, or cheese). How many different meals can we have?
For each of the two starters there are four main courses, giving a total of
possibilities for the first two courses:
There are then three desserts for each of these eight options, giving a total of
possibilities for the three courses. More briefly, the number of possible
meals is .
Multiplication rule: If a counting problem can be split into stages with several options at each stage,
then the total number of possibilities is the product of the numbers of options at each stage.
The number is the product of three 2s, two 3s, and one 7. Since
has four factors (1, 2, 4, 8), has three factors (1, 3, 9), and 7 has two factors
(1, 7), any factor is made up from these—for example, . It follows
from the multiplication rule that the number of factors of 504 is .
A binary word consists only of 0s and 1s. How many 4-digit binary words are there?
There are two possibilities for the first digit (0 or 1) and similarly two
possibilities for the second digit, the third digit, and the fourth digit. So, by the
multiplication rule, the number of 4-digit binary words is . They
are:
0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111,
1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111.
Correspondence rule: We can solve a counting problem if we can put the objects to be counted in
one-to-one correspondence with the objects of a set that we have already counted.
Suppose that the set S has four elements, a, b, c, and d. We’ll associate a four-
digit binary word with each subset of S (including the whole set S and the empty
set ∅ with no elements) as follows:
For example, the subset {a, c, d} corresponds to the binary word 1011, the
subset {b} corresponds to 0100, the whole set S corresponds to 1111, and the
empty set ∅ corresponds to 0000.
Division rule: If a set of n elements can be split into m disjoint subsets, each of size k, then
.
This follows immediately from the multiplication rule, since if m disjoint subsets
are each of size k, then the total number n of objects is .
Two simple examples that use the division rule are:
Suppose that a number of packs of fifty-two cards become muddled up. If there are 260 cards in total,
then the number of packs is .
To find the number of edges of a cube, we can count the edges around the six square faces, giving
edges, by the multiplication rule. But each edge bounds two faces and is counted twice.
So, by the division rule, the number of edges is .
Optimization problems
We wish to drive from New York City to Chicago in the shortest possible time. Which of the many
available routes should we choose, given the travel times between pairs of neighbouring cities on the
various routes?
Two optimization problems that we’ll meet again in Chapter 6 are the minimum
connector problem and the travelling salesman problem.
Minimum connector problem: We wish to connect a number of cities by links, such as canals,
railway lines, or air routes, but the cost of the connections is high. How can we minimize the total
cost while ensuring that we can still get from each city to every other one?
Travelling salesman problem: A travelling salesman wishes to visit a number of cities to sell his
wares, and return to his starting point. If the costs of travelling between the cities are known, how
should he plan his route so as to minimize the total cost?
Figure 12(a) gives an example of the travelling salesman problem. Again, some
experimentation gives the solutions in Figure 12(b) with total costs 29, 29, and
28. But is 28 the best solution, or is there a smaller one—and is there an efficient
algorithm that always produces an optimal solution? We answer these questions
in Chapter 6.
12. The travelling salesman problem.
The efficiency of algorithms
In the previous section we mentioned the efficiency of an algorithm. What do we
mean by this?
Every algorithm has a running time, which we’ll call T—this may be the time
that a computer needs to carry out all the necessary calculations, or the actual
number of such calculations. Each problem has an input size, which we’ll call n
—it may be the number of cities in a network or a number that we wish to
factorize. In any case, the running time T usually depends on the input size n.
Particularly important, because they’re the most efficient, are the polynomial-
time algorithms, where the maximum running time is proportional to a power of
the input size—say, to n2 or n5. The collection of all polynomial-time algorithms
is called P. An example is the efficient algorithm we give in Chapter 6 for the
minimum connector problem, where the maximum running time is proportional
to n2, the square of the number of cities. In contrast, there are inefficient
algorithms that don’t take polynomial time, such as the exponential-time
algorithms whose running times may grow like 2n or 10n.
To see the difference look at Table 1, which compares the running times of a
polynomial-time algorithm and an exponential-time algorithm with input sizes
, , and , for a computer performing one million operations per
second. Clearly, exponential-time algorithms can quickly become impractical as
the input size increases.
Big question: Is ?
Few people believe that the answer is ‘yes’, but no one has been able to prove
that .
Permutations and combinations have been studied for thousands of years. Our
concern here is with selecting objects from a collection, either in a particular
order (such as when ranking breakfast cereals) or without concern for order
(such as when dealing out a bridge hand).
For example, suppose that we have four cards, the Jack (J), Queen (Q), King
(K), and Ace (A) of Spades. In how many different ways can we select just two
of them?
If we select the cards in order and replace the first card before making our
second selection, there are sixteen possibilities:
JJ, JQ, JK, JA, QJ, QQ, QK, QA, KJ, KQ, KK, KA, AJ, AQ, AK, AA.
If the order still matters but we don’t replace the first card after selecting it, there
are twelve possibilities:
JQ, JK, JA, QJ, QK, QA, KJ, KQ, KA, AJ, AQ, AK.
Finally, if the order doesn’t matter and we replace the first card, there are ten
possibilities:
JJ, JQ, JK, JA, QQ, QK, QA, KK, KA, AA.
In this chapter we investigate these four types of selection and show how they’re
related to permutations, combinations, Pascal’s triangle, binomial coefficients,
and distributions.
Ordered selections
In the Chinese classic I Ching (Book of Change) each chapter is symbolized by a
‘hexagram’ of six horizontal lines, each either solid (yang) or broken (yin).
Figure 13 shows sixteen of these hexagrams. How many are there altogether?
Since each hexagram has six lines and there are two choices of lines, the total
number of hexagrams is:
by the multiplication rule (see Chapter 2). This is an ordered selection with
repetition, since in each hexagram the order of the lines matters and the yins and
yangs can appear more than once.
In general, we have the following rule, which follows from the multiplication
rule:
Ordered selections with repetition: If we select k items from a set of n objects, and if the selections
are ordered and repetition is allowed, then the number of possible selections is nk.
For example, the number of k-digit binary words made from 0s and 1s is 2k, and
if we select five cards from a pack of fifty-two cards, replacing each card once
we’ve chosen it, then the total number of selections is .
Another example concerns nucleotides, the building blocks for the DNA
molecule. These are composed of four compounds, adenine (A), cytosine (C),
guanine (G), and thymine (T), linked to a sugar called deoxyribose. On one of
the two DNA strands, the ‘coding strand’, these compounds combine in order in
sequences of three (called codons), such as ACT or CGG, which then act as
‘codewords’ for specifying which amino-acid to use when constructing the
corresponding protein; by the rule, there are different triplet codons.
More fancifully, since the twenty-three chromosomes that make up the haploid
human genome together comprise 3.2 billion of these four nucleotides, there
could be at least different human genomes, a number with over a billion
digits. Even this is an underestimate, since chromosomes generally double up in
pairs, and it ignores the sex chromosomes. By comparison, the number of
humans who have ever lived since the dawn of the human race is tiny, around
107 billion.
Arrangements
How many are the variations of form of the ten-handed god Śambhu by the exchange of his ten
attributes held reciprocally in his several hands—namely, the rope, the elephant’s hook, the serpent,
the tabor, the skull, the trident, the bedstead, the dagger, the arrow, and the bow?
Since his first hand can hold any of the ten objects, the next hand can hold any of
the remaining nine, the next hand can hold any of the remaining eight, and so on,
the multiplication rule tells us that the total number of possible arrangements is
The French Minimite Friar Marin Mersenne is remembered mainly for the
Mersenne primes—prime numbers of the form , such as 3, 7, and 31. In
1636 he displayed all the arrangements of four musical notes in his Book of
Harmonic Principles (see Figure 14) and continued with those of six notes. By
calculations similar to that given for Śambhu, we see that the total number of
arrangements of four notes is and of six notes is
.
14. Mersenne’s arrangements of four musical notes.
So there are 10! arrangements for Śambhu, and 4! and 6! for Mersenne.
Table 2 gives the factorials up to 10!. Notice how fast these numbers increase—
this phenomenon is known as the combinatorial explosion and you will meet it
several times in this book. For reasons that will become clear later, we also
define .
Table 2 Factorials
If you want to know the number of the permutations of 8 letters, multiply the 5040 that you got from
7 by 8 and you will get 40,320 words, and if you search for the number of permutations of 9 letters,
multiply 40,320 by 9 and you will get 362,880; and if you search for the number of permutations of
10 letters, multiply 362,880 by 10 and you will get 3,628,800 words, and if you search for the number
of permutations of 11, multiply these 3,628,800 by 11 and you will get 39,916,800 words.
We can also obtain an approximate value for n! from the following result of
James Stirling, published in 1730:
The word permutation is used in different ways. We’ll use it to mean an ordered
selection without repetition, while others may use it to mean an arrangement (as
already mentioned). In the football pools an expression such as ‘perm any 8 from
10’ refers to choosing combinations of eight matches from 10, rather than
permutations!
In how many ways can a President, Secretary, and Treasurer be selected from a committee of seven
people if no one can hold more than one position?
Here the President can be selected in seven ways, the Secretary can then be
selected in six ways, and the Treasurer can be selected in five ways. So the total
number of ways is , by the multiplication rule.
Ordered selections without repetition (permutations): If we select k items from a set of n objects, and
if the selections are ordered and repetition is not allowed, then the number of possible selections is
Since
We conclude this section with a result that many people find surprising.
Birthday paradox: If we choose any twenty-three people at random, it’s more likely than not that at
least two of them share the same birthday.
For simplicity, we’ll ignore leap years and assume that there are 365 days in the
year. With no restrictions on the birthdays, there would be 365 possibilities for
each person, giving
possibilities altogether. But if no birthday is repeated, then the first person could
have any of 365 birthdays, the second person could have any of 364 birthdays,
and so on, down to the twenty-third person who could have any of 343 birthdays.
So the total number of possibilities is
He also found that there are six combinations when taken one at a time, twenty
combinations when taken three at a time, fifteen combinations when taken four
at a time, and six combinations when taken five at a time.
Years later, in the 6th century AD, the Indian astronomer and mathematician
Varāhamihira obtained the number of ways of selecting four ingredients from a
collection of sixteen, obtaining the correct answer of 1820. He surely didn’t list
them all, so how might he have found this number?
Such unordered selections without repetition are called combinations, giving rise
to the words combinatorial and combinatorics. To investigate them, as with
permutations we begin with a simple question:
In how many ways can a subcommittee of three people be selected from a committee of seven people
if no one can hold more than one position?
Unordered selections without repetition (combinations): If we select k items from a set of n objects,
and if the selections are unordered and repetition is not allowed, then the number of possible
selections is
We can prove this algebraically from the previous formula by noting that
But a more revealing way of seeing this is to note that each selection of k objects
leaves objects behind, so , the number of ways of choosing these k
objects, is the same as , the number of ways of choosing which n − k
objects to leave behind.
Again, we can prove this by algebra, but the following combinatorial proof gives
us more insight. We first mark one of the n objects in some way. Then any
choice of k of the n objects either excludes the marked one (so we have to select
our k objects from the remaining n – 1 objects), or includes it (in which case we
still need to select just k − 1 of the remaining n − 1 objects). Thus, C(n, k), the
total number of choices, is equal to , the number of choices that exclude
the marked one, plus , the number of choices that include it.
For if S is any set with n elements, then C(n, k), the number of ways of choosing
k of its elements, is simply the number of subsets of S of size k. So the
expression on the left-hand side of Combination rule 3 is the total number of
subsets of any size. But the number of subsets of a set with n elements is , by a
result of Chapter 2, giving the result.
Manhattan problem: A grid of streets has k west–east blocks and m north–south blocks. How many
south–east routes are there from the top-left corner of the grid to the bottom-right corner?
Figure 15(a) shows a grid with k = 4 blocks and m = 2. Here, always heading
either one block east (E) or one block south (S), we find fifteen possible routes
from A to B; these are as follows, with the route EESESE marked on the
diagram:
EEEESS, EEESES, EEESSE, EESEES, EESESE, EESSEE, ESEEES, ESEESE, ESESEE, ESSEEE,
SEEEES, SEEESE, SEESEE, SESEEE, SSEEEE.
Each of these six-step routes has four Es and two Ss, so the number of possible
south-east routes from A to B is the number of ways of choosing where to place
the four Es, which is C(6, 4). It is also the number of ways of choosing where to
place the two Ss, which is . So .
More generally, if there are k Es and m Ss in each route, then the number of
possible south-east routes from A to B is (for the Es) and is also
(for the Ss). So
Furthermore, each of the C(n, k) routes from A to B must pass through either the
point X or the point Y in Figure 15(b). But the number of routes via X
, and the number of routes via Y is
. So
Pascal’s triangle has a long history. Figure 17 shows three earlier versions: (a) its
first known appearance by the Islamic scholar al-Karajī around the year 1007,
(b) a Chinese version of 1303 from Zhu Shijie’s Siyuan yujian (Jade Mirror of
Four Elements) in which the penultimate row contains an error (34 instead of
35), and (c) Blaise Pascal’s own version in a posthumous work of 1665. It was
Pascal who gave the first ‘modern’ treatment of the subject, explaining the
various ways in which the triangle can arise.
17. Three earlier versions of Pascal’s triangle.
By Combination rule 3, the sum of the numbers in row n is 2n—for example, the
numbers in the row labelled n = 6 add up to .
We note also that the diagonal k = 1 contains the natural numbers, while the
diagonal k = 2 contains the triangular numbers 1, 3, 6, 10, 15, 21, … , known to
the Ancient Greeks. The triangular number in row n is , and the
sum of any two consecutive triangular numbers is a perfect square:
In Chapter 4 we show how to find the Fibonacci numbers from Pascal’s triangle.
The binomial theorem
The combination numbers C(n, k) in Pascal’s triangle are usually called binomial
coefficients, since they arise when we multiply out powers of the ‘binomial’
expression x + y, as follows:
To see why the combination numbers arise in this way, we consider the product
Each term of this product combines x or y from the first bracket with x or y from
each succeeding bracket, and so contains six letters, each x or y; for example, if
we choose x from brackets 1 and 5 and y from the rest, we get the term xyyyxy.
So the coefficient of in the product is the number of ways of choosing x
from two of the six brackets and y from the rest: this is , giving the
term in the product. In general:
with the plus sign if n is even and the minus sign if n is odd.
Distributions
We still have to count unordered selections with repetition, and one way of doing
this is to think of them in terms of distributing balls into boxes. Here, instead of
choosing k elements from a set of n elements, we place k balls into n boxes. Let’s
review the types of selection we’ve seen so far; they’re illustrated in Figure 19 in
the case , , where the balls are 1, 2, 3, 4 and the boxes are a, b, c, d, e,
f.
Ordered selection with repetition: Here we distribute k balls in order into n boxes, allowing more
than one ball in any box—the number of ways of doing this is nk.
Ordered selection without repetition (permutation): Here we distribute k balls in order into n boxes,
allowing at most one ball in any box—the number of ways of doing this is .
Unordered selections with repetition: If we select k items from a set of n objects, and if the
selections are unordered and repetition is allowed, then the number of possible selections is
.
Now that we have met all four types of selection problem, let’s return to the
beginning of the chapter, where we found the number of ways of selecting two
cards from the Jack, Queen, King, and Ace of Spades:
If we select the cards in order and replace the first card after selecting it, the
number is .
If the order matters but we don’t replace the first card, the number is
.
If the order doesn’t matter and we don’t replace the first card, the number is
.
If the order doesn’t matter and we replace the first card, the number is
.
Much more likely was receiving a small prize for selecting exactly three winning
numbers. Since there were ways of choosing three winning numbers and
ways of choosing three non-winning numbers, the chance of receiving
such a prize was
those not containing the number n: these consist of k numbers from with no two
consecutive;
those containing the number n: since n − 1 (being next to n) cannot be included, these consist of the
number n and k − 1 numbers from with no two consecutive.
by Combination rule 2.
It follows that the probability that no two winning lottery numbers were
consecutive was
which is the same as the probability that no winning number exceeded 44. This
probability is
and so the probability that at least two winning numbers were consecutive is
So in about half of the possible cases, two of the winning balls had consecutive
numbers. Many people found this surprising.
Chapter 4
A combinatorial zoo
This chapter presents a menagerie of combinatorial topics, ranging from the box
(or pigeonhole) principle, the inclusion–exclusion principle, and the
derangement problem, to the Tower of Hanoi problem, Fibonacci numbers, the
marriage theorem, generators and enumerators, and counting chessboards.
The box principle
There are at least thirty-three people in Greater London with the same number of hairs on their head.
How can we assert this without counting them all? Let’s start with some simpler
examples.
It’s obvious that if we place eight or more objects into seven boxes in any way
whatever, then some box must receive more than one object. It follows, on
taking the seven days of the week as the boxes, that:
Any group of eight or more people must include at least two with birthdays on the same day of the
week.
Similarly, by taking the twelve months of the year as boxes, we see that:
Any group of thirteen or more people must include at least two with birthdays in the same month of
the year.
These are existence results for which we can construct no specific solutions in
general. They’re special cases of the following simple observation, known as the
pigeonhole principle, or Dirichlet’s box principle, after the 19th-century German
mathematician Lejeune Dirichlet:
Box principle: If more than n objects are placed into n boxes, then some box must receive more than
one object.
Extended box principle: If more than kn objects are placed into n boxes, then some box must receive
more than k objects.
For, if each of the n boxes contained k objects or fewer, then the total number of
objects would be at most kn, which is not the case.
It follows on taking and that any group of fifteen or more people must
include at least three people with birthdays on the same day of the week, and on
taking and that any group of thirty-seven or more people must
include at least four people with birthdays in the same month of the year.
If we now assume that the population of Greater London is over eight million,
and that everyone has at most 250,000 hairs on their head, then it follows from
the extended box principle with and (so that million) that
at least thirty-three of them must have the same number of hairs on their head.
Inclusion and exclusion
Among twenty-two students, ten have visited Austria, eleven have visited Belgium, and four have
visited both countries. How many have visited at least one of these countries, and how many have
visited neither?
It follows from the addition rule (see Chapter 2) that if A and B are sets with no
elements in common, then the total number of elements in A and B is obtained
by adding the number of elements in A to the number of elements in B. But what
happens if A and B overlap? We simply add the number in A to the number in B,
as before, and then subtract the number of elements common to both of them,
which we initially counted twice. This idea underlies the inclusion–exclusion
principle, or the method of over- and under-counting.
We’ll use the notations |S| for the number of elements in a set S, (‘A union
B’) for the set of elements in either A or B (or both), and (‘A intersect B’)
for the set of elements in both A and B. Then the result is:
The situation is shown in Figure 20(a), sometimes called a Venn diagram after
the 19th-century Cambridge mathematician John Venn. If S is the set of students,
A is the subset of those who’ve visited Austria and B is the subset of those
who’ve visited Belgium, then , , , and . It follows
that the number of students who’ve visited at least one of the countries is
, and that the number of students who’ve visited neither
country is .
Suppose further that among these students nine have visited Croatia, three have visited both Austria
and Croatia, five have visited both Belgium and Croatia, and two students have visited all three. How
many students have visited at least one of the countries, and how many have visited none of them?
—that is, we include the sets one at a time, then remove them two at a time, and
add them in again three at a time.
and if S is the set of all students, then the number of students who’ve visited
none of these countries is
The inclusion–exclusion principle also has applications in number theory, as the
following example shows.
Here we let S = {1, 2, … , 300}, and let A, B, and C contain the multiples of 2, 3,
and 5, respectively. Then
How many arrangements of the numbers 1, 2, … , n leave no number in its original position?
Such rearrangements are known as derangements; for example, only nine of the
arrangements of 1, 2, 3, 4 are derangements:
If a number of letters are randomly placed into addressed envelopes, what’s the probability that no
letter ends up in the correct envelope?
In how many ways can a manager reassign a number of workers to new jobs so that no one receives
the same job as before?
If we turn over one card from each of two packs of cards simultaneously, what’s the likelihood that no
two identical cards turn up?
Each of the four single sets (such as A) fixes one element and rearranges the other three, so
each of the six pair-intersections (such as ) fixes two elements and rearranges the other two, so
each of the four triple-intersections (such as A ∩ B ∩ C) fixes three elements, and so the fourth also,
so
By the inclusion–exclusion formula for four sets, given at the end of the previous
section, the number of derangements of 1, 2, 3, 4 is therefore
as expected.
so
(the power series expansion of ex, where e is the base of natural logarithms), we
have
In the great temple of Benares a brass plate supports three large diamond needles on one of which are
sixty-four gold discs. The largest disc rests on the brass plate and the others are piled on top of it in
decreasing order of size, with the smallest at the top. The priests are required to transfer these discs
one at a time to other needles in such a way that at no stage may a larger disc rest on top of a smaller
one. The aim is to transfer the whole pile to the second needle, at which time the world will end. How
many moves are needed before this will happen?
As simpler examples, suppose that there are just one, two, or three discs. With
one disc a single move transfers it to the second needle. With two discs three
moves are needed: move the smaller disc to needle 3, the larger one to needle 2,
and finally the smaller one on to needle 2. With three discs seven moves are
needed (see Figure 21). So, if H(n) is the number of moves required to transfer n
discs, then , and .
21. The Tower of Hanoi problem, and its solution for three discs.
Each of these numbers is one less than a power of 2, and in general we have
. If each move takes one second, then the task of transferring all
sixty-four discs will take seconds, so about 585 billion years will
elapse before the world ends.
Poetry, pavings, and rabbits
Indian poets and musicians have long been concerned with metre and rhythm,
distinguishing between long syllables (two beats, denoted here by —) and short
ones (one beat, denoted by ᴗ); musicians can think of these as minims (half-
notes) or crotchets (quarter-notes). The 11th-century poet and musician
Hemachandra answered the following question:
In how many ways can we lay a path of length n with 2 × 1 rectangular paving stones which can be
laid horizontally in pairs or vertically?
Figure 22 shows the five pavings of length 4 (corresponding to the five metres
above) and two pavings of length 8. But how many pavings of length 8 are there
altogether?
Let be the number of different rhythms with n beats (or the number of
pavings of length n). It’s easy to check that , and , and
we’ve seen that .
To find P(n) we look at the end of the rhythm: this must be either ᴗ or —. In the
first case, each n-beat rhythm arises by adding a short syllable ᴗ to one of the
rhythms with n − 1 beats. In the second case, each n-beat rhythm arises
by adding a long syllable — to one of the rhythms with n − 2 beats. It
follows that the total number of rhythms satisfies the equation
There are thus thirty-four rhythms with eight beats and thirty-four pavings with
eight paving stones.
The numbers
in which each successive number is the sum of the previous two, are known as
Hemachandra numbers in the East, and in the West as Fibonacci numbers after
Leonardo of Pisa (Fibonacci) who discussed them in his book Liber Abaci of
1202 in connection with a problem on the breeding of rabbits:
Fibonacci’s ‘rabbits’ problem: How many pairs of rabbits are produced in one year if every month
each pair produces a new pair which then becomes productive from the second month onwards?
Finally, we can even find the Fibonacci numbers from Pascal’s triangle: just add
the numbers along the marked diagonals in Figure 23.
Job assignments and marriage
In Chapter 2 we met the following job assignment problem:
Job assignment problem: A number of applicants apply for several jobs for which they’re variously
qualified. Under what conditions can we assign all the applicants to jobs for which they’re qualified?
Marriage problem: There are a number of girls, each of whom knows several boys. Under what
conditions can every girl marry a boy she knows?
For example, if the girls are Amanda, Betty, Carrie, and Debbie and the boys are
Arthur, Bob, Charlie, David, and Edward, and if
Amanda knows Bob, David, and Edward, Betty knows Arthur, Charlie, and Edward, Carrie knows
only Bob, and Debbie knows Bob and David,
then one solution is for Amanda to marry Edward, Betty to marry Arthur, Carrie
to marry Bob, and Debbie to marry David. But if Amanda now quarrels with
Edward, then Amanda, Carrie, and Debbie together have only Bob and David as
possible partners, and so the marriages cannot take place. These two situations
are shown in Figure 24.
For the marriages to take place, each girl must know at least one boy, each pair
of girls must together know at least two boys—and in general every k girls must
collectively know at least k boys, for all values of k. In 1935 the English
mathematician Philip Hall showed that this necessary requirement is also
sufficient:
Marriage theorem: The marriage problem has a solution if and only if every k girls collectively
know at least k boys, for all values of k.
Job assignment theorem: The assignment problem has a solution if and only if every k applicants
are collectively qualified to do at least k jobs, for all values of k.
It’s useful to write Hall’s theorem more formally. Let be the set of n
girls, and let be the sets of boys known by each girl (for example, S2
consists of Arthur, Charlie, and Edward). A transversal of the family
, corresponding to a solution to the marriage problem, is a set of n
different elements, one chosen from each set; for example, if and F
consists of the four sets , , and , then one
transversal is 5 (from S1), 1 (from S2), 2 (from S3), and 4 (from S4),
corresponding to the solution we had before, with Arthur = 1, Bob = 2, etc. We
can now state Hall’s theorem:
Hall’s theorem: Let E be a set, and let be subsets of E. Then the sets in F have a
transversal if and only if the union of any k of the sets Si contains at least k distinct elements, for each
k.
To prove Hall’s theorem, we’ll revert to the language of marriage and will
assume the ‘marriage condition’, that every k girls collectively know at least k
boys, for each value of k. We’ll assume that the theorem is true whenever the
number of girls is less than n, and show that it must also be true whenever there
are n girls. Then, since it’s clearly true with just one girl, it must also be true
with two girls, and then with three girls, four girls, etc. It’s therefore true for any
number of girls, as required. (This is called a proof by induction.)
So assume that there are n girls. There are two cases to consider.
Case 1: If every k girls (where k < n) collectively know at least k + 1 boys, so that the condition is
always true ‘with one boy to spare’, then we choose any girl and marry her to any boy she knows. The
marriage condition then remains true for the other n − 1 girls, who can be married to boys they know,
by our assumption. So all n girls can be married to boys they know.
Case 2: If now there’s a set of k girls who collectively know exactly k boys (where k < n), then these
k girls can be married to these k boys, by our assumption, leaving n − k girls still to be married. But
any collection of h of these n − k girls (for ) must know at least h of the remaining boys,
since otherwise these h girls, together with the k girls, would collectively know fewer than h + k boys,
contrary to the marriage condition. So the marriage condition applies also to these n − k girls, who can
then be married (by our assumption). So the n girls can all be married to boys they know.
So in both cases we can marry the n girls to boys they know, as we wanted to
prove.
where the terms on the right remind us of the subsets of the set {a, b, c}, with the
term ab corresponding to the subset {a, b} and the term 1 corresponding to the
empty set ∅. Moreover, the expressions , and abc give us the
combinations of one, two, and three elements selected from the set {a, b, c}.
Similar expressions give us the combinations of objects selected from any set.
The given product is sometimes called the symbolic generator of the subsets of a
set, or of combinations without repetition.
The following list gives the number of tiles for each letter, according to their
frequency in normal English usage:
Any letter that appears on only one tile (J, K, Q, X, or Z) has enumerator 1 + x.
and so on, up to the letters A and I that each appear nine times with enumerator
The enumerator for the whole alphabet is the product of these, which is
If we multiply this out, we get
In how many different ways can we colour the squares of an 8 × 8 chessboard black and white?
(Here we don’t insist on keeping the alternating pattern of black and white, or
even of having thirty-two squares of each colour.)
Since there are sixty-four squares and two choices of colour, the number is 264,
by the multiplication rule. But suppose we now regard two chessboard
colourings as the same if we can rotate the board from one colouring to the other.
How many essentially different colourings are there then?
To answer this, let’s look first at 2 × 2 chessboards, where the total number of
colourings is ; these colourings are shown in Figure 25. But colourings 2,
3, 4, and 5 can be obtained from each other by rotations, as can colourings 6, 7,
8, and 9, colourings 10 and 11, and colourings 12, 13, 14, and 15. There are
therefore just six essentially different chessboard colourings, as exemplified by
colourings 1, 2, 6, 10, 12, and 16.
Another way of obtaining this result is to use a result from an area of algebra
called group theory. Without going into great theoretical detail, we count the
number of colourings left unchanged by each of the possible rotations, as
follows:
Clockwise rotation through 90°: Here, the only colourings left unchanged by such a rotation are the
all-black and all-white colourings (1 and 16)—there are 2 of these.
Clockwise rotation through 270°: This is similar to rotation through 90°, so again 2 colourings
remain unchanged.
Clockwise rotation through 180°: Here, diagonally opposite squares must have the same colour,
with two choices of colour for the top-left/bottom-right squares and two choices for the other two, so
22 colourings remain unchanged.
Clockwise rotation through 360°: This is the same as leaving the square in its original position, so
there are two choices of colour for each square and all 24 colourings remain unchanged.
Clockwise rotation through 90° or 270°: Here we can arbitrarily choose how to colour each of the
top-left sixteen squares, and these must then be replicated in the other quarters of the board, so the
number of colourings that remain unchanged in each case is 216.
Clockwise rotation through 180°: Here we can arbitrarily choose any colouring for the thirty-two
squares in the top half of the board, and these must be replicated in the lower half, so the number of
colourings that remain unchanged is 232.
Clockwise rotation through 360°: This is the same as leaving the square in its original position, so
there are two choices of colour for each square and all 264 colourings remain unchanged.
26. A floor tiling with triangles and hexagons and a polyhedron with
triangles and squares.
A floor tiling is constructed from equilateral triangles and regular hexagons. Can any other tilings be
made from these shapes? What other tilings can be made from regular polygons? Which of them use
just one type of tile?
A polyhedron is constructed from equilateral triangles and squares. Can any other polyhedra be made
from these shapes? What other polyhedra can be made from regular polygons? Which of them use
just one type of polygon?
In this chapter we consider such tilings and polyhedra. How many are there, and
can we construct and classify them?
Tilings
A tiling of the plane (sometimes called a tessellation) is a covering of the whole
plane with tiles so that no tiles overlap and there are no gaps. A familiar
example, in which all the tiles are squares of the same size, is the square tiling in
Figure 27.
The tilings we’ll consider all have the property that the edges of each tile match
exactly the edges of its neighbours. For simplicity the tiles are usually regular
polygons, where all the sides and all the angles are the same: usually triangles,
squares, pentagons, hexagons, octagons, decagons (ten sides), and dodecagons
(twelve sides). Since we want to fit them together without gaps, we’ll need to
know their internal angles (the angles between adjacent sides); these are listed in
Table 4.
To calculate these angles, we split the polygon into triangles, as illustrated for a
pentagon in Figure 28. The sum of the angles in each triangle is 180°, and the
sum of all the angles at the centre is 360°, so the sum of all the internal angles is
Our first task is to find all the regular tilings—those whose tiles are regular
polygons of the same type with the same arrangement of polygons at each
meeting point, such as the square tiling. Since the internal angles must divide
exactly into 360°, the only possibilities are the triangle (60°), the square (90°),
and the hexagon (120°), giving:
the triangular tiling, with six equilateral triangles around each meeting point;
the square tiling, with four squares around each vertex;
the hexagonal tiling (or honeycomb), with three hexagons around each meeting point.
Note that other tilings are possible if we permit polygons that are not regular; for
example, Figure 30 shows a tiling with irregular pentagons.
30. A tiling with irregular pentagons.
We’ll now relax the condition that the regular polygons must all be of the same
type, but we’ll still require the same arrangement of polygons at each meeting
point; for example, in Figure 26 there are four triangles and a hexagon at the
meeting points. Such arrangements are called semi-regular tilings; Figure 31
shows semi-regular tilings with squares and octagons and with squares,
hexagons, and dodecagons.
It’s convenient to specify such a tiling by listing the number of sides of the
polygons appearing at each meeting point. For
example, the tilings in Figure 31 are described by the symbols 4.8.8 (since a
square and two octagons appear at each meeting point) and 4.6.12 (with a
square, a hexagon, and a dodecagon). We list these polygons in clockwise order,
so the symbols 3.3.4.3.4 and 3.3.3.4.4, with three triangles and two squares at
each meeting point, correspond to different tilings.
In fact, only eight combinations give rise to tilings of the whole plane:
3.3.3.3.6, 3.3.3.4.4, 3.3.4.3.4, 3.4.6.4, 3.6.3.6,3.12.12, 4.6.12, and 4.8.8.
We can also use irregular tiles of different types: an example is the attractive
tiling in Figure 33(a), with squares, pentagons, hexagons, heptagons, and
octagons.
33. Two irregular tilings.
All of the above tilings are ‘periodic’, in that the same patterns repeat however
far out we go. In the 1970s, Roger Penrose produced some infinite irregular
tilings that are not periodic. Figure 33(b) shows part of a Penrose tiling
constructed from two diamond shapes; these tile the whole plane, but not in a
periodic way. Such tilings arise in certain types of crystal.
Polyhedra
Let’s now move up to three dimensions and look at the solids that are bounded
by plane faces, called polyhedra (meaning ‘many faces’). Perhaps the most
familiar of these are cubes (with six square faces) and the pyramids of Ancient
Egypt (with a square base and four triangular faces).
We’ll start with the regular polyhedra, whose faces are regular polygons of the
same type with the same arrangement of polygons around each vertex (corner).
There are five of these, shown in Figure 34:
These regular polyhedra are often called the Platonic solids after Plato’s
description of them in his book Timaeus, where he associated them with the four
ancient elements of fire (tetrahedron), earth (cube), air (octahedron), and water
(icosahedron), and with the cosmos (dodecahedron).
In his celebrated Elements, written around 250 BC, Euclid proved geometrically
that these five regular polyhedra are the only ones. We’ll deduce the same result
from a formula that Leonhard Euler included in a letter of 1750; it was Euler
who first specifically introduced the idea of an edge:
Euler’s polyhedron formula: For any polyhedron with F faces, V vertices, and E edges,
The following list gives the numbers of faces, vertices, and edges for the five
regular polyhedra—it’s easy to check that Euler’s polyhedron formula holds for
each one:
tetrahedron:
cube:
octahedron:
dodecahedron:
icosahedron:
To explain why these are the only regular polyhedra, we’ll suppose that we have
a polyhedron in which each face is a k-sided regular polygon and where d edges
meet at each vertex, and we’ll use Euler’s polyhedron formula to find the
possible values of k and d. We can assume that k and d are at least 3.
Counting the k edges around each of the F faces, we get ; the factor 2
arises since each edge has two sides and so is counted twice: so .
Similarly, counting the d edges at each of the V vertices, we get : here the
factor 2 arises since each edge has two ends and so is counted twice: so
.
Putting these values of F and V into Euler’s polyhedron formula and
doing some algebra gives
(triangular faces)
Here , which must be greater than 0, so d = 3, 4, or 5.
If , then , and : this gives the tetrahedron.
If , then , and : this gives the octahedron.
If d = 5, then , and : this gives the icosahedron.
(square faces)
Here , which must be greater than 0, so .
So E = 12, V = 8, and F = 6: this gives the cube.
(pentagonal faces)
Here , which must be greater than 0, so d = 3.
So E = 30, V = 20, and F = 12: this gives the dodecahedron.
k = 6 or more
Here some algebra gives
,
which cannot be greater than 0, so this case doesn’t arise.
Let’s now relax the condition that all the polygons are of the same type, but we’ll
still require the same arrangement of polygons at each vertex. These give the
semi-regular polyhedra, or Archimedean polyhedra since they were discussed by
Archimedes.
First come two infinite families—the prisms, with two congruent polygons and a
central band of squares joining them, and the antiprisms, where one polygon is
rotated so that the central band becomes one of equilateral triangles. Figure 35
shows a hexagonal prism and a hexagonal antiprism.
35. A prism and an antiprism.
It turns out that, apart from these, there are just thirteen Archimedean polyhedra,
some with delightful names (see Figure 36). Note that Euler’s polyhedron
formula holds for each one. As before, we use symbols to describe the
arrangement of polygons at each vertex; for example, the truncated tetrahedron
with symbol 3.6.6 has a triangle and two hexagons at each vertex.
36. The thirteen semi-regular polyhedra.
truncated tetrahedron (3.6.6):
cuboctahedron (3.4.3.4):
truncated cube (3.8.8):
truncated octahedron (4.6.6):
small rhombicuboctahedron (3.4.4.4):
great rhombicuboctahedron (4.6.8):
icosidodecahedron (3.5.3.5):
truncated dodecahedron (3.10.10):
truncated icosahedron (5.6.6):
snub cube (3.3.3.3.4):
small rhombicosidodecahedron (3.4.5.4):
great rhombicosidodecahedron (4.6.10):
snub dodecahedron (3.3.3.3.5):
Interestingly, it turns out that: Any polyhedron made from pentagons and
hexagons, and with three faces meeting at each vertex, must have exactly twelve
pentagons.
To see why, suppose that such a polyhedron has p pentagons and h hexagons. We
can then write down the total number of faces, the total number of edges around
the faces, and the total number of vertices around the faces, in terms of p and h:
faces:
edges: (the 2 arises since each edge meets two polygons)
vertices: (the 3 arises since three polygons meet at each vertex).
The h-terms cancel, and the remaining terms can then be arranged to give p = 12,
as desired.
So every soccer ball has exactly twelve pentagonal faces—a thought to ponder
next time you watch a game of soccer.
Chapter 6
Graphs
In Chapter 2 we met the Königsberg bridges problem, the knight’s tour problem,
the Gas–Water–Electricity problem, the map-colour problem, the minimum
connector problem, and the travelling salesman problem. We’ll now revisit all
these problems and explain how they can all be considered as problems in graph
theory.
What is a graph?
A graph consists of a number of points, called vertices, and lines joining them in
pairs, called edges; the edges can be drawn straight or curved. Figure 38 shows a
graph with five vertices, v, w, x, y, z, and seven edges, vw, vx, vz, wx, wy, xy and
yz; note that the order of the vertices doesn’t matter, so wv is the same as vw, and
that the point where the edges vx and wy meet is not a vertex. We’ll usually
assume that no edge joins a vertex to itself and that there’s only one edge
between any pair of vertices—such a graph is sometimes called a simple graph.
38. A simple connected graph with five vertices and seven edges.
Note that this graph is connected—it’s in one piece—and that it contains several
cycles, such as the triangles vwx and wxy, the quadrilaterals vxyz and vwyz, and
the pentagon vwxyz.
Some important simple graphs that we’ll meet are the complete graph K(n) with
n vertices all joined in pairs, the complete bipartite graph K(r,s) with r
unconnected vertices joined in all possible ways to s unconnected vertices, and
the cycle graph C(n) consisting of a single cycle with n vertices. Figure 39
shows the complete graphs K(4) and K(5), the complete bipartite graphs K(3,3)
and K(3,4), and the cycle graph C(5).
39. Complete graphs, complete bipartite graphs, and a cycle graph.
The degree of a vertex is the number of edges emerging from it; for example, in
Figure 38 the vertices v, w, x, and y have degree 3 and the vertex z has degree 2.
We note a result of Leonhard Euler that:
The sum of the degrees of all the vertices in a graph is twice the number of edges.
This is because each edge contributes exactly 2 to the sum of the degrees (1 at
each end). For example, in Figure 38,
For example, no graph can have seven vertices, all of degree 3, since the sum of
the degrees would then be 21 and the graph would have edges!
At least two people must shake hands the same number of times
For suppose that n people are present. If the numbers of handshakes are all
different, then they must be 0, 1, 2, 3, … , n − 2, and n – 1,
each occurring just once. But the person with n − 1 handshakes must shake
hands with everyone else, including the person with none. This contradiction
gives the result.
Every simple graph has at least two vertices with the same degree.
Our last party problem introduces an area of mathematics called Ramsey theory,
which says roughly that if we’re given a large enough set, then there’s always a
subset of a specified type. In the context of party problems, the best-known
example asserts:
In any party of six or more people, there are either at least three mutual friends (who all know each
other) or at least three mutual non-friends (who know neither of the other two).
To see why, we take a graph with six vertices (representing six of the people)
and join two vertices by a solid edge if the corresponding people are friends and
by a dashed edge if they’re non-friends. We must show that there’s always a
solid triangle (three mutual friends) or a dashed one (three mutual non-friends).
Let v be any vertex. Then there must be five edges out of v (either solid or
dashed) and at least three of them must be of the same type (say, vw, vx, and vy).
We’ll assume they’re all solid—the argument is similar if they’re all dashed (see
Figure 40(a)).
40. Six people at a party.
Now if w and x are friends, then vwx is a solid triangle (Figure 40(b)). Similarly,
if w and y, or x and y, are friends, we get the solid triangles vwy and vxy (Figures
40(c) and (d)). Finally, if no two of w, x, and y are friends, then wxy is a dashed
triangle (Figure 40(e)). Thus, in every case there’s a solid or a dashed triangle.
If the number of people attending the party increases, we can prove more:
In any party of eighteen or more people there are either at least four mutual friends or four mutual
non-friends.
How large must a party be so as to guarantee at least five mutual friends or five mutual non-friends?
The answer to this question lies somewhere in the range 43 to 49, but its exact
value is unknown. Although this area of graph theory has been much studied, by
Paul Erdős and others, many easy-to-state questions remain to be answered.
Trees
We’re all familiar with the idea of a family tree, a diagram that shows the
interconnections between the members of a family. In graph theory, a tree is
defined as a connected graph with no cycles. The trees with six vertices are
shown in Figure 41.
We can build any tree step by step from a single vertex by adding a new edge
joined to a new vertex at each stage. Since we start with one vertex and no edge
and add one vertex and one edge at each stage, the number of vertices is always
one more than the number of edges—that is:
Clearly the desired network linking the cities must be a tree, since if there were a
cycle we could remove any one of its edges without disconnecting the network,
thereby reducing the total cost. But which of the many possible trees should we
choose?
By the result of Arthur Cayley, the number of different trees connecting n cities
is , a number that increases very fast with n; for example, there are
trees linking five cities and million trees linking ten cities (the
combinatorial explosion again!). In Chapter 2 we found trees with total costs 23,
21, and 20 in the network of Figure 42(a), but can we improve on this without
looking at all 125 trees?
We cannot now choose either of the next cheapest edges AB and EB with cost 6
since each would complete a cycle.
We now have a tree linking all the cities, so we stop. The resulting tree in Figure
42(b) has total cost , a great improvement on the trees we found by
experimentation in Chapter 2. It is the best possible solution in this case.
If such a route in a graph can be found, we say that the graph is Eulerian. For
example, the graph in Figure 43(c) is Eulerian—one of the many possible routes
is
43. The Königsberg bridges problem and graph, and an Eulerian graph.
Euler observed that whenever we enter a region we must be able to leave it, so
that an even number of bridges must surround each region. In the language of
graphs this means that each vertex must have even degree. This necessary
condition turns out to be sufficient, giving us the following result:
A connected graph is Eulerian if and only if every vertex has even degree.
For example, the vertices in Figure 43(c) all have degrees 2 and 4, so this graph
is Eulerian. However, the vertices in the Königsberg graph have degrees 3, 3, 3,
and 5, which are all odd, so the Königsberg bridges problem has no solution—
there’s no route of the required type.
Euler’s account of the Königsberg bridges problem (and of any other problem of
the same type) is often described as ‘the first paper in graph theory’, although he
never drew the Königsberg graph in Figure 43(b).
A problem that sounds somewhat similar is to find a route that passes through
each vertex of a graph just once before returning to the starting point. For the
graph in Figure 43(c) such a route is
The difference between the two problems is rather like the difference between an
explorer who wishes to explore every possible route between a number of cities,
thereby visiting each city several times, and a traveller who wishes to visit every
city but may miss out several routes between them.
Such problems were of interest to the Irish mathematician and astronomer Sir
William Rowan Hamilton who in the 1850s invented a puzzle called the Icosian
game, or A Voyage Round the World. In this puzzle the vertices of a
dodecahedron are labelled with the twenty consonants of the alphabet (B =
Brussels, C = Canton, D = Delhi, … , Z = Zanzibar), and we’re asked to travel
around the world, visiting each place just once before returning to our starting
point (see Figure 44). One solution is to visit the places in alphabetical order.
44. The Icosian game.
To make the puzzle more difficult Hamilton then asked how many routes there
are if we’re required to start with five given places, such as BCPNM (there are
two) or LTSRQ (there are four).
A graph that allows such a route through each vertex is called a Hamiltonian
graph and the corresponding route is a Hamiltonian cycle, even though Hamilton
wasn’t the first to present such a puzzle; the Rev. Thomas Kirkman, a Lancashire
vicar and accomplished mathematician who involved himself with combinatorial
problems and who reappears in Chapter 7, had considered a more general
problem a few months earlier.
A simple graph with n vertices is Hamiltonian if each vertex has degree at least n/2.
Another problem that involves Hamiltonian cycles is the knight’s tour problem in
chess, also introduced in Chapter 2, which asks whether a knight can visit all the
squares of an 8 × 8 chessboard by knight’s moves and return to its starting point.
We can think of this as a problem in graph theory by taking the sixty-four
squares as vertices and joining two vertices whenever the corresponding squares
are separated by a knight’s move. A knight’s tour, such as the one shown in
Chapter 2, is then a Hamiltonian cycle in this graph.
Do knight’s tours exist for chessboards of other sizes? For a 4 × 4 board let’s
start to insert some knight’s moves. For the tour to include the top-left and
bottom-right squares in Figure 45(a) we must include the four knight’s moves
shown. But this closes up the route so that no moves to other squares can be
added. So no knight’s tour exists for a 4 × 4 chessboard.
A similar argument shows that no knight’s tour can exist for a 5 × 5 chessboard
(see Figure 45(b)), but in this case, there’s a simpler approach. Since the squares
visited by a knight must alternate in colour between black and white, the total
number of squares must be even. But a 5 × 5 board has an odd number of
squares, so no knight’s tour can exist. Similarly, no knight’s tours exist for a 7 ×
7 chessboard or for any other n × n board when n is odd. When n is even, there’s
no knight’s tour for a 4 × 4 chessboard, but knight’s tours exist for all larger
boards. As a challenge, try to construct one for a 6 × 6 chessboard.
with total cost 26 (see Figure 46(b)), as we discover after some experimentation.
If there are n cities, then the number of possible routes is easily seen to be
or half this number if the route can be travelled in either direction. This number
increases exceedingly fast as n increases, and so it would be highly desirable to
find an efficient algorithm as we did for the minimum connector problem. But
none is known, although there are heuristic methods that achieve nearly the best
solution in practice: the travelling salesman problem is one of the NP-complete
problems mentioned in Chapter 2.
Planar graphs
In the Gas–Water–Electricity problem from Chapter 2, Mr Angry, Mr Beastly,
and Mr Cross wish to be connected to the three utilities in such a way that no
two of the nine possible connections should cross. In graph theory terms this
problem asks whether the complete bipartite graph K(3,3) in Figure 47(a) can be
drawn in the plane without any edges crossing.
To see why the answer is ‘no’, we note that if there were a solution, then (with
the neighbours and utilities labelled by their initials) the six edges that form the
cycle
must appear as a hexagon in the plane as in Figure 47(b). Can we now insert the
remaining three edges AW, BE, and CG without creating a crossing?
Another non-planar graph is the complete graph K(5), shown in Figure 49(a): if
we draw a road network linking five towns, then at least two of the roads must
cross. To see why, we argue as above. If K(5) were planar then the cycle
must appear as a pentagon in the plane, as shown in Figure 49(b). Can we now
insert the five remaining edges? If BE is drawn inside the pentagon, as shown,
then AC and AD cannot cross it and so must lie outside the pentagon. So BD
must lie inside the pentagon and we cannot then draw CE without crossing an
edge. A similar
49. Proving that K(5) is non-planar.
What is remarkable about these results is that K(5) and K(3,3) are essentially the
only non-planar graphs, in the sense that any non-planar graph must ‘contain’ at
least one of them, as was proved by the Polish mathematician Kazimierz
Kuratowski in 1930. More precisely, since we don’t alter the planarity or
otherwise of a graph if we insert vertices of degree 2 into its edges, as shown in
Figure 50, we have the following result:
Kuratowski’s theorem: A graph is planar if and only if it doesn’t contain K(5) or K(3,3) or any graph
obtained from them by inserting vertices of degree 2.
Any plane graph divides the plane into regions called faces (including an
unbounded region called the infinite face); for example, the plane graph in
Figure 48(b) has eight faces. A consequence of Euler’s polyhedron formula
, which we met in Chapter 5, is that however we draw a connected
planar graph in the plane, the number of faces is always the same:
Euler’s formula for plane graphs: If a connected plane graph with V vertices and E edges is drawn
without crossings in a plane, then the number F of faces is .
The connection between this result and the polyhedron formula becomes
apparent when we project the polyhedron on to a plane to give a plane graph
with the same numbers of faces, edges, and vertices (see Figure 51).
If a plane graph is simple, then each face is surrounded by at least three edges
and so, on counting up the number of edges around each face, (the 2
arises since edge bounds two faces and so is counted twice). Combining this
inequality with Euler’s formula yields . Moreover, if the graph has no
triangles, then each face is surrounded by at least four edges and a similar
argument yields the inequalities and .
Using these inequalities we can give another proof that K(5) and K(3,3) are non-
planar. For if K(5) were planar, then the first inequality with and
would give , which is a contradiction, and if K(3,3) (which has no
triangles) were planar, then the second inequality with and would
give , which is also a contradiction.
For if each vertex has degree 6 or more then, on counting up the edges around
each vertex, we get (here the 2 arises since each edge has two ends and
so is counted twice). It follows that , and combining this with our earlier
inequality gives , which is a contradiction. So there must be a
vertex of degree 5 or less.
Every plane graph G gives rise to a dual graph G*, drawn as follows:
Inside each face of G we choose a point—these points are the vertices of G*.
Across each edge of G we draw a line joining the vertices in the two faces on either side of it—these
lines are the edges of G*.
We illustrate this construction in Figure 52; to get the third diagram we’ve
rearranged the vertices and straightened the edges.
52. Constructing a dual graph G* from a plane graph G.
We’ve seen that every simple planar graph contains a vertex of degree 5 or less.
Using duality we deduce the following result:
‘Every plane graph with no vertices of degree 1 or 2 has a face bounded by at most 5 edges—that is, a
triangle, quadrilateral, or pentagon.’
The missing region
An unusual application of Euler’s formula for plane graphs concerns dividing a
circle into regions:
Dividing a circle: Given n points on the circumference of a circle, what is the maximum number R
of regions that can be formed when they are joined in pairs?
Let’s regard the divided circle as a plane graph with faces (including the
infinite face).
How many vertices are there? There are n vertices on the circle, and each
interior vertex arises by selecting four vertices on the circle (in C(n, 4) ways)
and joining them in pairs. So .
How many edges are there? Each of the n vertices on the circle has degree n + 1
(two edges along the circumference and n − 1 edges inside the circle) and each
of the C(n, 4) interior vertices has degree 4, so the sum of the degrees is
. By the handshaking lemma the number of edges is half this
number, so .
which is the sum of the first five numbers in row n − 1 of Pascal’s triangle. So
when , we get regions, as before.
The four-colour theorem
We conclude this chapter with one of the most famous problems in mathematics
—the four-colour problem, which we met in Chapter 2. It asks whether the
countries of every map can be coloured with just four colours so that
neighbouring countries are coloured differently.
To see the connection with graph theory we note that a map is a plane graph and
so we can form its dual as described earlier. The problem then becomes one of
colouring the vertices of the dual graph so that any two vertices joined by an
edge are coloured differently (see Figure 54).
later, in 1976, that it was finally proved that four colours suffice for all maps.
The proof, by Wolfgang Haken and Kenneth Appel of the University of Illinois,
involved over 1200 hours of computer time and the detailed investigation of
1482 configurations of countries. It is too complicated to be described here, but
we can prove a weaker result:
Six-colour theorem: Every map can be coloured with at most six colours so that neighbouring
countries are coloured differently.
To prove this, we’ll assume that there are maps whose countries cannot be
coloured with six colours, and we’ll let M be such a map with the smallest
possible number of countries. By an earlier result, M contains a triangle,
quadrilateral, or pentagon, which we’ll call C. Removing an edge from C, as in
Figure 55, we obtain a map with fewer countries which, by our assumption, can
be coloured with six colours. After so colouring it, we then reinstate C. Since at
most five colours surround C and six colours are
Four-colour theorem: The vertices of every planar graph can be coloured with four colours so that
any two vertices joined by an edge are coloured differently.
Chapter 7
Square arrays
According to Chinese legend, around the year 1100 BC Emperor Yu was standing
on the banks of the river Luo, a tributary of the Yellow River, when a sacred
turtle emerged from the river with the numbers 1 to 9 on its back. These were
arranged in a 3 × 3 square array with the ‘magic’ property that the sum of the
numbers in each row, column, or main diagonal, was 15 (see Figure 56(a) and
(b)). Over the centuries this arrangement of numbers, called the Luoshu (Luo
river writing), came to acquire great religious and mystic significance.
In the 16th century the German artist Albrecht Dürer featured a 4 × 4 magic
square in his engraving Melencolia I, with the property that the sum of the
numbers in each row, column, and diagonal is 34 (see Figure 56(c)). The date of
this engraving, 1514, appears in the two squares in the middle of the bottom row.
In this chapter we present several magic squares with interesting properties, and
then turn to their ‘cousins’, the latin squares, of which sudoku puzzles provide a
well-known example.
Magic squares
An n × n magic square, or a magic square of order n, is a square array of
numbers—usually (but not necessarily) the numbers from 1 to n2—arranged in
such a way that the sum of the numbers in each of the n rows, each of the n
columns, or each of the two main diagonals is the same. A semi-magic square is
a square array in which the sum of the numbers in each row or column, but not
necessarily the diagonals, is the same.
We note that if the entries are 1 to n2, then the sum of the numbers in the whole
array is
on summing the arithmetic progression. Because the n rows and columns have
the same ‘magic sum’, the numbers in each single row or column add up to
(1/n)th of this, which is ; for example, if the magic sum is 15, if
the sum is 34, and if n = 8 it is 260.
Over the next few centuries Chinese and Islamic mathematicians constructed
magic squares of increasing size and complexity. Figure 57 shows two of these:
the first, due to Yang Hui (1275), is a 9 × 9 magic square which splits into nine 3
× 3 magic squares, while the second, due to al-Antāki (10th century), is a magic
square of order 15 containing within it magic squares of orders 13, 11, 9, 7, 5,
and 3, with the numbers arranged so that all the odd numbers appear within the
central diamond and all the even numbers appear outside it.
57. Two remarkable magic squares.
The Victorians also enjoyed recreational puzzles of this kind. Several enthusiasts
produced magic squares arising from knight’s tours on a chessboard (see
Chapters 2 and 6), where the order of the squares visited yields a semi-magic
square of order 8. Here the numbers in each row or column, but not the
diagonals, add up to 260 (see Figure 58(a)). Unfortunately no 8 × 8 magic
squares have this knight’s tour property.
58. Two remarkable semi-magic squares.
the numbers in each row or column add up to the magic sum, 2056;
the numbers in each half-row or half-column add up to half this sum, 1028;
the four corner numbers and the four middle squares add up to 1028;
if we place a 4 × 4 hole over any part of this magic square, then the sixteen visible numbers add up to
2056.
Latin squares
Leonhard Euler was also interested in magic squares, constructing them from
‘latin squares’, as we shall see. An n × n latin square, or a latin square of order
n, is a square array with n symbols arranged so that each symbol appears just
once in each row and each column. Figure 59 shows latin squares of orders 3, 4,
and 5, from various
sources. Examples can be traced back through 1000 years to when they appeared
on amulets designed to ward off evil spirits.
Given a latin square, we can obtain others by rearranging the rows or the
columns, or by permuting the symbols. For an n × n latin square with symbols 1,
2, … , n, we can thereby arrange that the numbers in the first row and the first
column appear in order as 1, 2, … , n. Such a latin square is called normalized;
an example is
A familiar form of latin square is the sudoku puzzle, where we’re required to
complete a partially filled 9 × 9 square array of numbers so that each row, each
column, and each of the nine main 3 × 3 blocks contains all the numbers from 1
to 9 (see Figure 60).
60. A sudoku puzzle and its solution.
Latin squares have been widely used in the design of agricultural experiments,
notably by R. A. Fisher and F. Yates in the 1930s and their successors. Suppose
that we wish to test five types of fertilizer on a field of wheat. A simple method
for comparing them might be to divide the field into five parallel strips and test
one type of fertilizer on each strip. But this could give inaccurate results if a row
of trees gave shade along one side of the field or there was a waste tip in the
middle, as shown in Figure 61(a). Such inaccuracies may be lessened by
dividing the field into small squares in the pattern of a latin square, as shown in
Figure 61(b).
How many latin squares are there for a given order n? The answer is
known only for If we normalize them, so that the first row and column are
1, 2, … , n, then there are just one 2 × 2 latin square, one 3 × 3 latin square, and
four 4 × 4 latin squares, as shown in what follows.
After this the numbers increase rapidly, with fifty-six normalized latin squares of
order 5, 9408 of order 6, and over sixteen million of order 7. The number of
normalized latin squares of order 11 has an impressive forty-eight digits. (This is
another example of the combinatorial explosion.)
Sudoku patterns have also been counted. If we ignore symmetry, the total
number is 6,670,903,752,021,072,936,960; this was shown by B. Felgenhauer
and F. Jarvis in 2005. But when they took account of the various symmetries—
for example, the numbers 1–9 can be permuted in 9! ways, and certain rows or
columns can be rearranged without affecting the 3 × 3 block structure—then the
number of essentially different patterns reduced to a mere 5,472,730,538.
Latin squares of order n are easily constructed for any given number n. A
particular type of latin square is the cyclic square, where the symbols appear in
the same cyclic order, moving one place to the left in each successive row, so
that the entry at the beginning of each line appears at the end of the next one;
this is illustrated by the first latin square:
An extension of this idea is where the symbols move more places to the left in
each successive row: the last three of these 5 × 5 latin squares arise from two,
three, and four moves to the left. Note that in each square every row is a cyclic
permutation of the first one, and similarly for the columns. However, this cyclic
construction produces a latin square only when the number of moves is
relatively prime to the size of the square, since otherwise it would lead to rows
and columns being repeated.
We can construct a latin square row by row from its first row, always taking care
that no symbol appears twice in any column. For example, if the first row is A B
C D E, then we could choose D C E B A as the second row, E A D C B as the
third row, and so on, as follows.
More generally, two n × n latin squares are orthogonal if, when superimposed,
each of the n2 possible pairings of a symbol from each square appears exactly
once. For example, these two 3 × 3 latin squares are orthogonal because
superimposing them gives an arrangement in which each pairing of two numbers
1, 2, or 3 appears just once:
We can extend the idea of orthogonality beyond pairs of latin squares, since
three or more latin squares of the same order can be mutually orthogonal in
pairs. A set of mutually orthogonal latin squares (sometimes abbreviated to
MOLS) is a set of latin squares, any two of which are orthogonal; for example,
the four 5 × 5 latin squares constructed earlier are mutually orthogonal, as are
the following three 4 × 4 latin squares:
Note that there can be at most n – 1 MOLS of order n. To see why, we renumber
the top row of each square with the symbols 1, 2, … , n (which does not affect
their orthogonality) and look at the first symbol in the second row of each
square. These symbols must all be different (since the squares are orthogonal)
and none can be 1 (which appears in the first row), so there are at most n − 1
possibilities for this symbol. So there can be at most n − 1 mutually orthogonal
latin squares of order n. A full set of n − 1 MOLS is called a complete set; for
example, the three 4 × 4 and four 5 × 5 MOLS given earlier are both complete
sets.
For which values of n does there exist a complete set of n × n mutually orthogonal latin squares?
As several authors have shown, a complete set exists whenever n is a prime
number (other than 2) or a power of a prime—that is, when
In his paper, Euler showed how to construct magic squares from pairs of
orthogonal latin squares. Here’s an example, where he started with two
orthogonal latin squares of order 3. If we add the corresponding symbols, as
shown, and then put and a = 0, c = 3, b = 6 (so ,
etc.), we obtain the Luoshu magic square.
36 officers problem: Arrange thirty-six officers, of six different ranks and from six different
regiments, in a square array so that each row and column includes officers of all six ranks and all six
regiments.
Euler believed the task to be impossible, and further conjectured that orthogonal
pairs of n × n latin squares cannot exist when
—that is, when n is of the form for some integer k. (Here MacNeish’s
result doesn’t help us: since one of the prime-powers is 21, the number of
orthogonal latin squares is at least 2 − 1 = 1, which tells us nothing.)
Was Euler right? He was correct that there is no pair of orthogonal latin squares
of order 6, a fact eventually verified after an exhaustive search by Gaston Tarry
in 1900, but he was spectacularly wrong about all the others. In 1959, almost
three centuries after Euler had posed his officers problem, three
combinatorialists, R. C. Bose and S. S. Shrikhande from India and E. T. Parker
from the US, later known as ‘Euler’s spoilers’, surprised the world by proving
that pairs of orthogonal latin squares exist for all these other orders, a
spectacular achievement that made the front page of the New York Times. We
conclude this chapter with a pair of 10 × 10 orthogonal latin squares; the capital
letters form one latin square and the lower-case letters form the other:
Chapter 8
Designs and geometry
A consumer organization wishes to compare seven brands of detergent and arranges a number of tests.
But since it may be uneconomic or inconvenient for each tester to compare all seven brands it is
decided that each tester should compare just three brands. How should the trials be organized if each
brand is to be tested the same number of times and each pair of brands is to be compared directly?
A farmer wishes to compare eleven varieties of pig-feed and, again for reasons of economy or
convenience, needs to arrange an experiment in which each trial involves just five varieties. How
should the trials be organized if each pair of varieties is to be compared directly the same number of
times?
For the first problem we’ll call the seven brands A, B, C, D, E, F, and G. Then an
arrangement involving seven testers is as follows:
Here each tester compares just three brands (for example, tester 2 compares
brands B, C, and E), and each brand is tested by three testers (for example, brand
E is tested by testers 2, 4, and 5). Moreover, any two brands are compared
directly by one tester (for example, brands B and F are compared by tester 6).
For the second problem, where five of the eleven varieties of pig-feed are
compared at each stage, we can construct an experiment with eleven trials:
Here each trial involves just five varieties, and each variety appears in five trials
(for example, variety E appears in trials 3, 5, 7, 8, and 9). Moreover, any two
different varieties are directly compared in two trials (for example, varieties B
and F are compared in trials 2 and 7).
The order in which the varieties appear in each block is irrelevant, but we’ll
assume, as before, that the blocks are incomplete, in the sense that they don’t
contain every variety—that is, k < v. The two previous designs have parameters
v = 7, b = 7, k = 3, r = 3, and v = 11, b = 11, k = 5, r = 5.
For both of these designs and , but this is not always the case. For the
following design v = 9, b = 6, k = 3, and r = 2:
Note that this last design would be a poor one to use in an experiment. For a
start, blocks 4 and 5 compare exactly the same varieties. Also, the varieties A
and G are compared twice, while A and E are compared just once and A and F
are never compared. Worse still, none of the varieties A, B, E, F, G, and I is
compared with any of the varieties C, D, and H.
To see why, choose a variety A, look at the blocks that contain A, and count in
two different ways the total number of varieties (other than A) appearing in these
blocks. Each of these r blocks has k – 1 varieties other than A, so this number is
. But there are v − 1 varieties other than A, and each of them appears λ
times with A, so the number is —so these are equal.
Initially it wasn’t known whether triple systems exist for all these values, but in
1846 the Rev. Thomas Kirkman (whom we met in Chapter 6) showed how to
construct a triple system for each one. We now know that there is essentially just
one triple system when v = 7 or 9 (these are the example that opens the chapter
and the one just given), two different systems when v = 13, eighty systems when
v = 15, and no fewer than 11,084,874,829 different systems when v = 19—the
combinatorial explosion strikes again!
A block design with v varieties is resolvable if its blocks can be rearranged into
subdesigns, called replicates, each of which contains every variety just once. For
example, the triple system with v = 9 at the beginning of the chapter is a
resolvable design, as the following rearrangement of blocks into four replicates
shows; note that each replicate contains all nine varieties A–I:
We can think of this design as the result of an experiment that has taken place
over four years, with each three-block replicate corresponding to a single year. In
the first year we compare A with B and C, D with E and F, and G with H and I;
in the next year we compare A with D and G, B with E and H, and C with F and
I; and so on.
In a triple system each block has three varieties. It follows that if a triple system
is resolvable, then the number of varieties must be divisible by 3—that is,
for some integer n, so v = 9, 15, 21, 27, … The number of blocks in
such a design is then
Of particular historical interest are the resolvable triple systems with fifteen
varieties and thirty-five blocks, corresponding to n = 2. In the 1850 issue of The
Lady’s and Gentleman’s Diary, Kirkman proposed the following problem which
asks for a resolvable triple system with fifteen varieties, A, B, … , O, and seven
replicates, corresponding to the days of the week; it is now known as Kirkman’s
schoolgirls problem:
Fifteen young ladies in a school walk out three abreast for seven days in succession: it is required to
arrange them daily, so that no two shall walk twice abreast.
fit it into the diagram, but it counts as a line nonetheless.) Note that there are
exactly three points lying on each line, and that exactly three lines pass through
each point. In what follows, we’re not concerned with whether the lines are
straight, or in what order the points appear on a line: all that matters is which
points lie on which lines, and which lines pass through which points.
Can we construct similar diagrams with any given number of points and lines?
Note that this differs from our usual Euclidean geometry, where any two lines
pass through exactly one point unless they’re parallel. Omitting these italicized
words produces a completely different type of geometry from the one we’re used
to, since there’s now a ‘duality’ or symmetry between points and lines, according
to which any statement about points lying on lines gives rise to a statement about
lines passing through points, and vice versa.
There are at least four points, no three of which lie on the same line.
We introduce this assumption to avoid trivial cases, such as when all the points
lie on just one line. By duality we can deduce that:
There are at least four lines, no three of which pass through the same point.
If L1 and L2 are any two lines, then there is a point that lies on neither L1 nor L2.
For if we choose two points A and B on the line L1 and two points C and D on
the line L2, as shown in Figure 63(a), then the lines through A and C and through
B and D (which exist by the first property) must meet at a point O (by the second
property). This point O lies on neither L1 nor L2.
For if the two lines L1 and L2 and the point O are as described here, then the line
from O to each point A1 on L1 meets the line L2 at a point A2, and similarly the
line joining O and A2 meets the line L1 at the point A1 (see Figure 63(b)). This
gives a one–one correspondence between the points on L1 and those on L2, and
so L1 and L2 must contain the same number of points.
We say that the finite projective plane has order n if each line contains n + 1
points. (The reason for writing n + 1, rather than n, will become clear later.) So
the seven-point projective plane with three points on each line has order 2, and
the thirteen-point projective plane with four points on each line has order 3. We
can then ask the following question:
How many points and lines does a projective plane of order n have in total?
There are n + 1 lines through the point O—that is, one line from O to each of the
n + 1 points on L1, as shown in Figure 64. But each of these lines has n points on
it other than O, so the total number of points is , plus 1 for the point O
itself. This gives points in total—and by duality, there are also
lines. For example, the plane of order 2 has points and lines,
and the plane of order 3 has points and lines, as we’ve seen.
64. Counting the points in a projective plane.
So a projective plane can exist only when the number of points and lines is
, for some number n; for example, there are projective planes with
and points and lines. But is there one with
points and lines? More generally:
This process is reversible. If we start with an affine plane of order n and add
another line joined up appropriately, we get a projective plane of order n.
Tying things together
There are close links between projective planes and some of our earlier topics.
For a start:
Each line has three points and each point lies on three lines, so each block has
three varieties (k = 3) and each variety lies in three blocks (r = 3). Also, any two
points lie on a unique line, so any two varieties appear together in exactly one
block and the design is balanced with .
In general, a finite projective plane of order n, with points and lines and
with n + 1 points on each line and n + 1 lines through each point, gives rise to a
balanced symmetric design with parameters
We next show that:
Recall that we obtain an affine plane from a projective plane by removing a line
and the points on it. For example, removing the first block WXYZ and the
varieties W, X, Y, Z from the thirteen-point projective plane gives the following
design, whose blocks are the lines of the nine-point affine plane:
Every finite affine plane corresponds to a complete set of orthogonal latin squares.
As an example, look first at the last two replicates of the design which arose
from a nine-point affine plane. These are repeated here, together with a square
pattern with A–I in the corners (Figure 66 ):
66. Square 1.
We now fill in the square pattern using the first of these replicates.
Corresponding to block 7 write the number 1 into positions A, E, and I;
similarly, for block 8 write the number 2 in positions B, F, G, and for block 9
write the number 3 in positions D, H, C. This gives the first 3 × 3 latin square.
We then repeat the process with the blocks of the second replicate, writing the
number 1 in positions G, E, C of the square pattern, the number 2 in positions D,
B, I, and the number 3 in positions H, F, A. This gives the second latin
square.
This process works in general and is reversible. For, consider the following
complete set of latin squares of order 4, and a square pattern containing the
letters A–P (Figure 67):
We’ll construct a resolvable block design with sixteen varieties and twenty
blocks, as follows.
For the first replicate (blocks 1–4) we take the columns of the square (AEIM,
BFJN, CGKO, DHLP).
For the second replicate (blocks 5–8) we take the rows of the square (ABCD,
EFGH, IJKL, MNOP).
To construct the third replicate (blocks 9–12) we use the first latin square.
Number 1 appears in positions A, F, K, P of the square and we’ll take these as
block 9. Similarly, number 2 appears in positions B, E, L, O giving block 10,
number 3 appears in positions C, H, I, N giving block 11, and number 4 appears
in positions D, G, J, M giving block 12.
The fourth and fifth replicates (blocks 13–16 and 17–20) are constructed from
the second and third latin squares in a similar way.
The replicates of this block design are the columns, rows and three sets of curvy
diagonals of an affine plane of order 4 with 16 points A–P and 20 lines 1–20, as
required.
But although there’s a pair of orthogonal latin squares of order 10, no three of
them have ever been found, let alone a complete set of nine, so we cannot expect
there to be a projective plane of order 10. This was confirmed in 1988 by
Clement Lam and others after a complicated and lengthy computer search:
It is known that there are no projective planes of orders 14, 21, 22, and certain
other values, but we still don’t know whether there are projective planes of order
12 or 15. The following existence question remains unanswered:
In 1699, Leibniz wrote a letter to Johann Bernoulli asking for the number of
‘divulsions’ of integers, now called partitions:
Have you ever considered the number of partitions or divulsions of a given number, namely, the
number of ways it may be split up into two, three, etc., pieces? It seems to me that this is not an easy
problem, and yet it would be worth knowing.
For example, there are five ways of splitting the number 4 into smaller ones:
Note that one way is just 4 itself, and that the order of the parts doesn’t matter—
so 1 + 3 is the same as 3 + 1. Similarly, there are seven ways of splitting the
number 5:
To see why, we recall the idea of an enumerator from Chapter 4, noting that:
and so on. For example, since , there are just five ways of combining
terms, one from each bracket, to give the term 5x4:
Euler then summed all the geometric series in the above expression for P(x),
using the identity
In how many ways can we give change for £1 using only 10p, 20p, and 50p coins?
This is the problem of finding the number of partitions of 100 using only the
numbers 10, 20, and 50. Here,
the enumerator for the 10p coins is 1 + x10 + x20 + x30 + … ,
the enumerator for the 20p coins is 1 + x20 + x40 + x60 + … ,
the enumerator for the 50p coins is 1 + x50 + x100 + … .
So there are ten ways of giving change for £1, using only 10p, 20p, and 50p
coins.
Euler was originally led to consider partitions when he received a letter from the
Berlin-based French mathematician Philippe Naudé the younger asking:
In how many ways can the number 50 be written as the sum of seven different positive integers?
For example, .
He observed that the answer to Naudé’s question is the coefficient of x50 in the
row beginning with z7, a number that he quickly calculated as 522.
In a similar way Euler answered another of Naudé’s questions, which asked for
the corresponding number of ways when the seven numbers were not required to
be different—for example, . Again, he obtained the
correct answer, 8496. These solutions were published in 1748 in his Introductio
in Analysin Infinitorum (Introduction to the Analysis of Infinities), a celebrated
work that contains a whole chapter on partitions, the first extended treatment of
the subject.
Euler’s pentagonal number formula
was as far as he got in the Introductio, but soon after this he discovered how to
multiply out the terms in the denominator, giving the following series which
we’ll call Q(x):
here the successive terms of the series alternate between two minus terms and
two plus terms, and the powers 1, 2, 5, 7, 12, 15, … are the so-called ‘pentagonal
numbers’ of the form . This result is known as Euler’s pentagonal
number formula.
Euler then multiplied the expressions for P(x) and Q(x) together. Since each is
the reciprocal of the other, we have , and so
By multiplying out the left-hand side and finding the coefficient of each power
of x, he found an expression involving the corresponding partition number p(n):
for example, the coefficient of x5 on the left-hand side is and
on the right-hand side is 0, so
giving
By similarly examining the coefficient of xn he obtained the following iterative
formula in which each partition number p(n) is written in terms of earlier ones:
for example, we can calculate p(11) if we know the values of p(1), p(2), … ,
p(10) given earlier:
Euler used this iterative formula many times over to calculate all the partition
numbers up to . Even now, 250 years later, it’s still the most
efficient method for finding these numbers.
An odd partition is one whose parts are all odd; for example, the number 9 has
eight odd partitions:
As Euler discovered:
for distinct partitions, where each term can appear only once, the enumerator is
and for odd partitions, where only odd factors can appear, the enumerator is
He then expanded both of these expressions, found that they contain exactly the
same terms, and deduced the surprising result that, for any positive integer, the
number of distinct partitions is equal to the number of odd partitions.
Enter Hardy and Ramanujan
Throughout the 19th century many English mathematicians worked on
partitions, including Augustus De Morgan, Arthur Cayley, Thomas Kirkman,
and James Joseph Sylvester, names that we met earlier in other contexts.
Sylvester in particular waxed lyrical about them:
Partitions constitute the sphere in which analysis lives, moves, and has its being; and no power of
language can exaggerate or paint too forcibly the importance of this till recently almost neglected, but
vast, subtle, and universally permeating, element of algebraic thought and expression.
The first 158 of the numbers in MacMahon’s table were checked by the
Cambridge mathematician G. H. Hardy and his collaborator Srinivasa
Ramanujan. In 1913 Ramanujan had written to Hardy from India enclosing some
of his mathematical results: these were so revolutionary that Hardy asserted that
they had to be true since no one could have had the imagination to invent them.
Hardy invited Ramanujan to Cambridge and the two of them made mathematical
history over the next five years by producing some spectacular papers.
While examining the values of p(n), Ramanujan noticed that when n has the
form for some integer k, the values of p(n) are all divisible by 5:
Hardy and Ramanujan also obtained some asymptotic formulas for p(n), such as
Although there has since been further work on the subject, Hardy and
Ramanujan’s formula for the partition numbers remains a truly spectacular
result, and provides a fitting climax to this book.
Further reading
Parts of the present book follow the general approach taken in the Open
University’s former course TM361: Graphs, Networks and Design, which was
written by a course team under the direction of the author and was presented
from 1981 to 1994.
The following texts, some classic and others much newer, provide useful
introductions to the various areas of combinatorics and graph theory introduced
in this book.
Jonathan L. Gross, Jay Yellen, and Ping Yang (eds.), Handbook of Graph
Theory, 2nd edn, CRC Press, 2014.
Kenneth H. Rosen (ed.), Handbook of Discrete and Combinatorial Mathematics,
2nd edn, Chapman & Hall/CRC, 2015.
A
addition rule 19
affine plane 133–8
agriculture 114–15, 126
al-Antāki 110
algorithm 14
efficient 24
exponential-time 25
greedy 92
polynomial-time 25
alkane 16, 91
al-Karajī 41
al-Khwārizmī 14
Appel, K. 107
arrangement 31–3
B
Bachet de Méziriac 117–18
balanced block design (BIBD) 126
Bernoulli, J. 140
Bhaskarachārya 31
binary word 21
binomial theorem 44–5
birthday paradox 1, 34
block design 124–6
Bose, R. C. et al. 121
box principle 50
buckyball 84, 85
Burnside’s lemma 71
C
card puzzle 118
Cayley, A. 17, 92, 147
chemistry 16–17, 91
chess 1, 9–10, 68–70, 96–7
colouring maps 13, 106–7
colouring vertices 107
combination 35–45
combination rules 36–8, 40
combinatorial explosion 32, 92, 115, 127
combinatorics 2–3
complete bipartite graph 87
complete graph 87
complete set of MOLS 119–20, 136–8
connected graph 87
construction problem 7, 14
Cook, S. 26
correspondence rule 21
counting
chessboards 68–70
derangements 55–8
latin squares 113–17
partitions 140–1
problem 15
rules 18–22
subsets 19, 21
sudoku patterns 1, 114–15
cube 22, 80
cycle 87
cycle graph 87
cyclic latin square 116
D
De Morgan, A. 13, 146
degree of vertex 88, 95
derangement problem 1, 55–8
design 124–6
balanced 126
equireplicate 125
resolvable 127, 135–6
symmetric 126
Dirac, G. 96
Dirichlet, L. 51
disjoint subsets 19
distinct partition 146
distribution 45–6
dividing a circle 105
division rule 22
dodecahedron 80
dominoes 9
dual graph 103
Dürer, A. 109
E
edge of graph 86
edge of polyhedron 80
efficiency of algorithm 24–6
Emperor Yu 109
enumeration problem 7, 15–22
enumerator 67–8, 142–4
equireplicate design 125
Erdős, Paul 6, 90
Euclid 79
Euler, L. 11, 79, 88, 120–1, 141
Euler’s formula for plane graphs 102
Euler’s 36 officers problem 120–1, 138
Euler’s pentagonal number formula 144–5
Euler’s polyhedron formula 80, 102
Eulerian graph 93–4
existence problem 7–13
exponential-time algorithm 25
extended box principle 51
F
face of plane graph 102
face of polyhedron 80
factorial 31
family tree 90
Fano plane 129
Felgenhauer B. and Jarvis, F. 116
Fibonacci number 62–3
finite projective plane 129–5, 138–9
Fisher, R. A. 114, 126
Fisher’s inequality 126
four-colour problem 13, 106–7
four-colour theorem 108
Franklin, B. 113
Frobenius, G. 71
fullerene 84, 85
G
Gas–Water–Electricity problem 12, 99–100
generating function 141–3
geodesic dome 84
graph 86–107
complete 87
complete bipartite 87
connected 89
cycle 89
Eulerian 93
Hamiltonian 93
planar 100
plane 100
simple 86
greedy algorithm 92
H
Haken, W. 107
Hall, Philip 64
Hall’s theorem 65, 117
Hamilton, W. R. 13, 95
Hamiltonian cycle 96
Hamiltonian graph 96–8
handshaking lemma 88
Hardy, G. H. 147, 149
Hemachandra 61, 62
hexagonal tiling 75
I
I Ching 29
icosahedron 79
Icosian game 95
induction proof 65
inclusion–exclusion principle 52–5
incomplete block 126
infinite face 102, 105
input size 24, 25
irregular tiling 78–9
J
job assignment problem 7, 63–4
K
Kirkman, T. P. 96, 127–9, 147
Kirkman’s schoolgirls problem 128
knight’s tour problem 1, 9–10, 96–7
Königsberg bridges problem 11–12, 93–5
Kuratowski’s theorem 101
L
Lam, C. 138
latin square 113–22, 136–8
cyclic 116
normalized 114–15
orthogonal 117–22, 136–8
Leibniz, G. W. 4, 140
listing problem 16
lottery 1, 47–9
Loyd, S. 12
Luoshu magic square 109
M
MacMahon, P. A. 147–8
MacNeish, H. L. 120, 121
magic square 109–13
Manhattan problem 39–40
map-colouring 13, 107–8
marriage problem 63
marriage theorem 64
maze 1, 14–15
Mersenne, M. 31
metre 60
minimum connector problem 23, 25, 92–4
missing region problem 105
MOLS 119
Montmort, P. de 55
multiplication rule 20, 22
mutually orthogonal latin squares 119–20
N
Naudé, P. 143
n-omino 17
non-deterministic polynomial-time problem 25
normalized latin square 115
NP 25–7
NP-complete problem 27
nucleotide 30
number theory 20, 54
O
octahedron 80–1
odd partition 146
officers problem 120–1, 138
optimization problem 7, 22–4
order of projective plane 132–3, 138–9
ordered selection 28–35, 45
with repetition 29, 30, 45
without repetition 29, 33, 36, 45
orthogonal latin squares 117–22, 136–8
P
P 25–7
Pappus 75
partition 140–50
distinct 146
formula 149–50
number 141–2, 145, 148–50
odd 146
party problem 89–90
Pascal, B. 41
Pascal’s triangle 40–4, 62
paving 60–1
Penrose, R. 78
pentagonal number formula 144–5
periodic tiling 78
permutation 33–4, 45
pi 16
pigeonhole principle 50
planar graph 99–100
plane graph 100
Platonic solid 79–80
poetry 60
Polya, G. 71
polyhedron 72, 80–5
polyhedron formula 81, 102
polynomial-time algorithm 25
polyomino 17–18
problem
birthday 1, 34
card 118
counting 16
construction 7, 14
derangement 1, 55–8
dividing a circle 105
domino 9
enumeration 7, 15–22
existence 7–13
four-colour 13, 106–7
Gas–Water–Electricity 12, 99–100
job assignment 7, 63–4
knight’s tour 1, 9–10, 96–7
Königsberg bridges 11–12, 93–5
listing 16
Manhattan 39–41
marriage 63
minimum connector 23–4, 91–3
missing region 105
NP-complete 26–7
36 officers 120–1, 138
party 89–90
rabbits 62
satisfiability 26
schoolgirls 128–9
Tower of Hanoi 58–60
travelling salesman 23–4, 97–8
Voyage Round the World 95
projective plane 129–36, 138–9
R
rabbits problem 62
Ramanujan, S. 148, 150
Ramanujan’s congruences 148
Ramsey theory 89
Redfield, H. 71
regular polygon 72–5
regular polyhedron 80–5
regular tiling 74–6
replicate 127, 135–6
resolvable design 128, 135–6
rhythm 60
rules for counting 18–22
S
Saadia Gaon 32
Śambhu 31
satisfiability problem 26
schoolgirls problem 128–9
Scrabble 67–8
semi-magic square 110
semi-regular polyhedron 82–4
semi-regular tiling 75–7
simple graph 86
six-colour theorem 107
Snow White 16
square tiling 73
Steiner triple system 127
Stirling’s formula 33
subtraction rule 19
sudoku 1, 114–16
Suśruta 35
Sylvester, J. J. 129, 147
symbolic generator 66–7
symmetric design 126
T
Tarry, G. 14, 121
tessellation 73
tetrahedron 79–81
theorem
binomial 44–5
Hall’s 64–6, 117
four-colour 106–8
Kuratowski’s 101
marriage 64
job assignment 64
six-colour 107–8
tiling 4, 8–9, 72–9
Tower of Hanoi 58–60
transversal 64–5, 117
travelling salesman problem 23–4, 97–8
tree 90–3
triangular number 43
triangular tiling 74
triple system 127
truncated icosahedron 83–4
U
unordered selections 35–6
with repetition 29–30, 45–6
without repetition 29, 36, 45–6
V
Varāhamihira 36
Venn diagram 52
vertex of graph 86
vertex of polyhedron 79
Voyage Round the World 95
W
Wilf, H. 141
Y
Yang Hui 110
Yates, F. 114
Z
Zhu Shijie 41
SOCIAL MEDIA
Very Short Introduction