Exploring Mathematics - Problem-Solving and Proof (PDFDrive)
Exploring Mathematics - Problem-Solving and Proof (PDFDrive)
Daniel Grieser
Exploring
Mathematics
Problem-Solving and Proof
Springer Undergraduate Mathematics Series
Advisory Board
M. A. J. Chaplain, University of St. Andrews
A. MacIntyre, Queen Mary University of London
S. Scott, King’s College London
N. Snashall, University of Leicester
E. Süli, University of Oxford
M. R. Tehranchi, University of Cambridge
J. F. Toland, University of Bath
More information about this series at http://www.springer.com/series/3423
Daniel Grieser
Exploring Mathematics
Problem-Solving and Proof
123
Daniel Grieser
Institut für Mathematik
Carl von Ossietzky Universität Oldenburg
Oldenburg
Germany
Translation from the German language edition: Mathematisches Problemlösen und Beweisen by Daniel
Grieser, © Springer Fachmedien Wiesbaden 2013. All Rights Reserved.
This Springer imprint is published by the registered company Springer International Publishing AG
part of Springer Nature
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
For Ricarda and Leonard
Preface to the English edition
7
8 Preface to the English edition
Introduction 13
1 First explorations 23
1.1 Cutting up a log . . . . . . . . . . . . . . . . . . . . . . . 23
1.2 A problem with zeroes . . . . . . . . . . . . . . . . . . . 24
1.3 A problem about lines in the plane . . . . . . . . . . . . 28
1.4 Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3 Mathematical induction 71
3.1 The induction principle . . . . . . . . . . . . . . . . . . 71
3.2 Colourings . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.3 Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4 Graphs 83
4.1 The Euler formula for plane graphs . . . . . . . . . . . 83
4.2 Counting in two ways for graphs . . . . . . . . . . . . . 90
4.3 Handshakes and graphs . . . . . . . . . . . . . . . . . . 94
4.4 Five points in the plane, all joined by edges . . . . . . . 95
9
10 Contents
5 Counting 107
5.1 The basic principles of counting . . . . . . . . . . . . . 107
5.2 Counting using bijections . . . . . . . . . . . . . . . . . 117
5.3 Counting in two ways . . . . . . . . . . . . . . . . . . . 123
5.4 Going further: double sums, integrals and infinities . . 128
5.5 Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Glossary 295
References 317
Introduction
13
14 Introduction
present day. The four colour problem, whether four colours suffice to
colour every conceivable map assuming that neighbouring countries
always get different colours, led to a new mathematical theory in the
19th century: graph theory. These are big mathematical problems.
But there are also countless smaller interesting problems which are
accessible for everyone, which you can explore for yourself and thus
experience what mathematics is about. You will find such problems
in this book.
Problem-solving is fun and creative.
Initially you are in the dark. You look at examples, make a sketch,
observe patterns, and by and by you realise what matters and what
doesn’t. Slowly the darkness lifts, you feel your way forward, develop
ideas, and suddenly: Eureka – I’ve found it! Understanding is deeply
satisfying. Being creative makes you happy.
Problem-solving can be learned.
During your voyage you will learn many problem-solving strategies.
Some of them are so general that they can also be used outside of
mathematics. Others are specific to mathematics. With every problem
that you solve you develop your creativity and enlarge your pool of
experience.
Problem-solving makes you curious about mathematical theories.
Theories give answers. You will really appreciate an answer only if
you have asked the question beforehand, and even more if you have
tried to answer it yourself and experienced difficulties. If you learn
new theories (like algebra or analysis) in this way, then you will be
able to use them well, and advance beyond them.
Proofs
1 SeeExercises E 1.10 and E 5.24 and the beginning of Chapter 7.2 for good
examples of this.
16 Introduction
This book is for everyone who likes mathematics and who likes to
think about problems that cannot be solved by simply applying a
given method. For all who want to improve their problem-solving
skills. For mathematically interested high school or secondary school
students. For students in colleges and universities who would like to
get a different view of mathematics, supplementing their standard
maths courses. For teachers in high or secondary schools, colleges and
universities who want to teach problem-solving in a more systematic
way than just by giving homework problems, maybe even to offer a
course that is method-oriented rather than topic-oriented. For leaders
of maths clubs or math circles.
As prerequisites you only need to know a bit about numbers, basic
geometry, how to rearrange equations. You learn these ideas quite
early on at high or secondary school. But even if you know some
higher mathematics already you will get your money’s worth: at many
places in the book you will find material on how the elementary ideas
introduced here are used in higher mathematics, including present-
day research.
Contents
The core of the book is the problems. Lots of problems, their investiga-
tion and solution. In the investigation we approach each problem step
Introduction 17
Here you can use the various types of proof to answer interesting
questions about numbers. Number theory also provides useful tools
and pretty examples for the following chapters. In Chapter 9 you
learn about the pigeonhole principle, a simple idea which spawns
amazing consequences when used aptly. Chapters 10 and 11 intro-
duce the extremal principle and the invariance principle. These are
versatile tools for solving mathematical problems, and also turn up
again and again in all exact sciences. Here you also learn about the
fundamental notions of permutations and their signature.
Sections titled Going further at the end of Chapters 4, 5, 6, 10 and
11 encourage you to delve deeper into the matters touched upon
in these chapters and give you a glimpse of the higher summits of
mathematics. Occasionally you may find here an unfamiliar term
without detailed explanation, but you should read on, just to get an
idea of what else mathematics has to offer. The references at the end
of the book guide you to literature that will be useful for further
exploration.
The mathematical topics treated in the book are elementary, that
is, they can be understood with very few prerequisites. However, we
take a higher perspective than you may be used to: often problems
are formulated in greater generality than is common at school, we
pay attention to logically complete arguments, and although the
tone is generally informal, we use modern mathematical terminology,
in particular the language of sets and maps. This is explained in
Appendix B.
The chapters are mostly independent of each other, so you may
read them in a different order. However, later chapters tend to be
more demanding than earlier chapters.
4. Review
This book arose from a course whose main aims were to let students
see mathematics from a new perspective (not rules to be followed
but a world to be discovered), to give them confidence that they can
discover mathematics for themselves and to lead them to appreciate
proofs.2 Along the way students acquire tools for problem-solving,
get to know the main types of proofs, learn to write solutions and
proofs properly, learn about fundamental ideas that occur everywhere
in mathematics, and also pick up important concepts like graphs,
congruences, permutations and their signatures. These are introduced
in informal, often playful contexts, so they can be shared with friends
and will be remembered more vividly than if learned in more abstract
ways.
If you want to teach such a course my main piece of advice is: Less
is more. Don’t try to ‘cover’ a certain curriculum. Take time to solve
problems together with the students in class, to develop ideas for
solutions, to try out different approaches, to suffer the frustration
of getting stuck and enjoy the satisfaction of success together. Share
with the students your experience of how to approach a mathematical
problem, rather than presenting prefabricated solutions. Always start
with an easy problem. There will be enough challenges for everyone.
I got from many students, colleagues and readers of the first Ger-
man edition. I want to thank especially the student tutors Stefanie
Arend, Simone Barz, Karen Johannmeyer, Marlies Händchen, Stefanie
Kuhlemann, Roman Rathje, Kathrin Schlarmann, Steffen Smoor and
Eric Stachitz, and my colleague Andreas Defant. Sunke Schlüters
contributed many excellent ideas for additional problems and helped
me with many of the pictures in the book. Sophy Darwin made many
valuable suggestions beyond her thorough language editing. My
deepest gratitude is due to my wife Ricarda Tomczak for continuous
encouragement and innumerable discussions and suggestions.
Now I wish you many joyful hours of solving problems and think-
ing about proofs, of discovering the beauty of mathematics. If you
have any comments or suggestions please write me an email at
[email protected].
Oldenburg,
February 2018 Daniel Grieser
1 First explorations
? Problem 1.1
You have a log which is 7 metres long. How long does it take to cut the log
into pieces one metre long, assuming that a single cut takes half a minute?
! Solution
You need six cuts, therefore it takes six times half a minute, that is
three minutes. !
Review
Let us have a look at our solution. We observe some basic strategies.
J We first found the number of pieces (seven) and then the number
of cuts (six). This is a simple example of an interim goal.
You should keep an eye out for shifts by one. See exercise E 1.1 for
more examples.
Figure 1.1 The number of cuts is one less than the number of parts
J We could save some cuts by cutting first into parts 3 and 4 metres
long, putting these two pieces next to each other and then cutting
both simultaneously, and then continuing in a similar manner.
Although loggers certainly wouldn’t do this, it is still an interesting
problem what the smallest number of cuts is in this case. See
exercise E 1.5.
? Problem 1.2
How many zeroes are at the end of 1 · 2 · 3 · · · · · 99 · 100?
1 Also for a million pieces, for example; we cannot draw a picture for this.
Although the problem was not worded in this generality, it is satisfying to recognize
general patterns.
1.2 A problem with zeroes 25
One writes 100! (in words: one hundred factorial) for the product
1 · 2 · 3 · · · · · 99 · 100. Zeroes at the end of a number we call trailing
zeroes.
Investigation
G
We cannot calculate the product, it is too big even for a calculator.2 We
need an idea how to do it a different way. For a moment you might
think the answer is two: the two zeroes of the factor 100. Looking
more closely, you might discover that the product also contains the
factor 10, and also 20, 30 and so on, each contributing another trailing
zero. So we get 11 zeroes. Have we found them all? Can we be sure
that 11 is the solution?
To answer this we need to understand where the trailing zeroes
come from. We could proceed as follows.
n 1 2 3 4 5 6
n! 1 2 6 24 120 720
How about two trailing zeroes? Before reading on, try to predict
which is the smallest n whose factorial has two trailing zeroes. Use
the insight above.
To have two trailing zeroes, a number must be divisible by 100,
which is 10 · 10 = 2 · 5 · 2 · 5 = 22 · 52 . So we need two factors 5 and
two factors 2. Let us imagine continuing the table, without actually
doing any calculation. We only need to watch for fives and twos.
Where is the next factor 5? Not in 6, 7, 8, 9, but in 10 since 10 = 2 · 5.
There is a surplus of factors 2; each one of 2,4,6,. . . contributes
at least one. Just two of them would be enough. Therefore 10!
has two trailing zeroes. How does this continue? Try to solve the
problem now.3
J From the simpler problem work towards the original problem step
by step (when does the next trailing zero appear – at 10!); here we
focus on what matters (factors 5 and 2).
28 1 First explorations
You might like to look at the general question now: How many
trailing zeroes does n! have for an arbitrary natural number n? See
exercise E 1.6.
? Problem 1.3
Suppose you draw n straight lines in the plane, no two of which are parallel
and no three of which meet at a point4 . These lines subdivide the plane into
regions. How many regions are there?
In this problem, we write n for an arbitrary natural number: n =
1, 2, 3, . . . . You might think that it is harder to consider the general
problem (any n) than the special problem (one fixed value of n, for
example n = 20).
But we will see that the more general problem is easier! Why?
Recall that in Problem 1.2 we made progress by first considering the
same problem with 100 replaced by 1,2,3,4,. . . Then we were able to
solve the special problem by understanding the general mechanism
which produces trailing zeroes. Here things will be similar.
For this reason we will pose many problems in a general form from
now on.
Investigation
G
Let us have a close look at the problem: Do we understand the
assumptions? Which configurations of lines are permitted, which
4 If
both of these conditions are satisfied then we say that the lines are in general
position.
1.3 A problem about lines in the plane 29
n 1 2 3 4
an 2 4 7 11
a n = a n −1 + n for n = 2, 3, 4. (1.1)
5 Actually
these descriptions are closely related. Convince yourself that the first
two say essentially the same thing, and that the third one can also be related to them.
1.3 A problem about lines in the plane 31
Insight: The new regions arise because the new line cuts through
some of the previously existing regions.
How many previously existing regions are cut by ? Well, three,
but can we relate this to other aspects of the figure (remember to
look for general rules; ’three’ is not a general rule)? Is there another
’three’ in the picture? Yes: is cut into three segments by the black
lines. And clearly this is a general rule: The number of regions
cut by is the same as the number of segments of .
What’s next? Remember what we are after: Adding a new line to
32 1 First explorations
6 This is just like the cuts and pieces of the log in Problem 1.1.
1.3 A problem about lines in the plane 33
an = an−1 + n = an−2 + (n − 1) + n.
a n = a n −2 + ( n − 1 ) + n = a n −3 + ( n − 2 ) + ( n − 1 ) + n = . . .
= a1 + 2 + 3 + · · · + n
= 2+2+3+4+···+n.
(How do we know what to put in the second line? The previous two
expressions exhibit a pattern: The first number added is one more
than the index of the a before it, for example an−2 + (n − 1) + . . . ,
an−3 + (n − 2) + . . . . So when we are down to a1 then we start
a1 + 2 + . . . .)
This last expression is still not satisfying because of the dots: For
example, if n = 100 then we would have to add one hundred
numbers to get a100 . So in a second step we use the following
famous trick9 10 for calculating 1 + · · · + n =: s which then yields
7 And, incidentally, it shows that the number of regions depends only on the
number of lines, not on their (permitted) position.
8 We are allowed to do this since (1.1) is true for all numbers n, so in particular
last summand to obtain n + 1, then add the second and second to last summand to
get 2 + (n − 1) = n + 1 again and so on. This works fine except that you have to
think about what happens when you get to the middle, and this is different for even
and odd n. Doing each of these cases separately you get the formula in the text also.
But the method in the text is better since you don’t need to distinguish two cases.
34 1 First explorations
1 + 2 + ... + ( n − 1) + n = s
n + ( n − 1) + ... + 2 + 1 = s
( n + 1) + ( n + 1) + ... + ( n + 1) + ( n + 1) = 2s
How many times does n + 1 appear in the last line? The first line
shows that the answer is n. Hence n(n + 1) = 2s, so
n ( n + 1)
1+2+···+n = , (1.2)
2
and to get an we simply add one. This is the closed formula we
were looking for.
G
Let us write up the solution properly.
1.4 Toolbox
J What is essential?
36 1 First explorations
J Introduce notation11
3. Write up your solution properly
Pay particular attention to:
J Complete arguments
J Sensible structure
Exercises
1 E 1.1 .Here are some examples of shifts by one. Or aren’t they? You
may use fingers to count, but also try to find a good argument.
• You see a row of five trees, each one 20 meters from the next.
How long is the row? What if there are 20 trees?
• I booked a hotel room from May 20 (arrival) to May 23 (depar-
ture). That’s how many nights? How many from May 3 to May
29?
11 That is, short identifiers, for example an for the number of regions in Problem
1.3.
12 Many people think that mathematical texts consist only of equations and
symbols. This is far from true. Explanations are as important as equations, and in
some mathematical texts there are no equations at all.
Exercises 37
• You see a row of 5 trees. The row is 100 meters long. What’s
the distance between successive trees, supposing it’s always the
same?
• I start work at 8 am, I work until 5 pm. That’s how many hours?
• The clock on my office wall chimes every hour, on the hour.
How often do I hear it chime during a working day?
• How many three digit natural numbers are there?
• How many integers n satisfy the inequalities 15 ≤ n ≤ 87 ? How
many satisfy −10 ≤ n ≤ 10 ?
1 2 n
1 + 3 + 5 + · · · + (2n − 1) .
Calculate the sum for some values of n. Can you see a pattern? Make
a conjecture and prove it.
E 1.5 .Modify Problem 1.1 as follows: suppose that before any cut 3
you are allowed to put an arbitrary number of pieces obtained in
earlier cuts next to each other, and to make one straight cut through
all of them. Now how many cuts do you need? How many cuts for
a log of length 4, 8, 16, 32, 27, n? Give a reason why your answer is
best possible, i.e. why it cannot be done with fewer cuts.
E 1.7 T. he strategy ‘special cases, looking for patterns’ can be useful 2–3
for finding formulas. Here are some examples.
a) Find a closed formula for the sum
1 · 1! + 2 · 2! + · · · + n · n!
1 2 3 n
+ + +···+
2! 3! 4! ( n + 1) !
1 1 1 1 1 1
1+ + , 1+ 2 + 2 , 1+ 2 + 2 ,...
12 22 2 3 3 4
1-2 E 1.8 .For each of these sequences find a pattern and formulate it in
words, then as a formula, where the numbers are a1 , a2 , . . . . Invent
more such problems.
Example: 1, 4, 9, 16, 25: square numbers, an = n2
Example: 7, 9, 12, 16, 21: the difference increases by one at each
step, starting at 2 from a1 to a2 ; formula: an = an−1 + n with
n ( n +1)
a1 = 7. Another (closed) formula is an = 2 + 6.
a) 3, 4, 5, 6, 7
b) 3, 9, 36, 180, 1080
c) 1, −1, 1, −1, 1
d) 1, 1, 1, 3, 5, 9, 17, 31
e) 2, 8, 24, 64, 160
Exercises 39
2 = 1 + 1 and 3 = 1 + 2 = 2 + 1 = 1 + 1 + 1,
Have you ever seen a Russian Matryoshka doll? When you open up
this wooden figure then you will find a smaller figure inside which
looks just like the first one. You can open this figure again and find a
yet smaller one, and so on.
Some mathematical problems can be tackled in a similar way: solve
the problem by reducing it to a smaller problem of the same kind.
This technique is called recursion. It is frequently used for counting
problems, and the equation which expresses this reduction is called a
recurrence relation. You have encountered this already in Problem
1.3. We will now explore the method systematically and see some
more examples.
For any given problem there are typically two tasks: First, find a
recurrence relation. Second, solve the recurrence relation; that is, find
a closed, non-recursive formula. In this chapter you will learn about
ways to tackle both steps.
a n = a n −1 + a n −2
an = nan−1
a n = 1 + a 1 + · · · + a n −1
When writing such equations we always mean that they should hold
for all n where all occurring indices are at least one. So the first
equation means
a3 = a2 + a1 , a4 = a3 + a2 , a5 = a4 + a3 etc.
Technique: Recursion
Remark
When you are given a problem for some fixed number of objects
(for example, 100 lines in the plane), it may be useful to generalize
it (n lines in the plane). Only then you will be able to use the
recursion technique!
This is a curious phenomenon, typical for mathematics, and for
science in general:
44 2 Recursion – a fundamental idea
Imagine you have three photographs and want to give some selection
of them to a friend. You have not decided yet how many and which
photos you want to give her. How many possibilities are there? You
could give away one photo (3 possibilities: photo 1 or 2 or 3) or two
(3 possibilities: photos 1,2 or 1,3 or 2,3), or all three or none at all
(one possibility each). That’s 3 + 3 + 1 + 1 = 8 possibilities all in all.
How many possibilities would you have with 4 or 5 or more photos?
Mathematically speaking, we want to find the number of subsets of a
set with three or more elements (your photos).
We will use the language of sets. If you are not familiar with this,
read Appendix B first.
? Problem 2.1
How many subsets does the set {1, 2, . . . , n} have?
We always count the empty set ∅ and the full set {1, . . . , n} among the
subsets1 . For example, the set {1, 2} has four subsets: ∅, {1}, {2}, {1, 2}.
Investigation
G
We first need to get a feel for the problem. Therefore we look at
a few examples and make a table. For simplicity we write, for
1 This may seem artificial at first. But you will see that in this way the solution
will be simpler and more elegant. If you don’t want to count the empty set then
simply subtract one from the result.
2.2 The number of subsets 45
example, 12 for the subset {1, 2}.2 We denote the desired number
by an .
n subsets of {1, 2, . . . , n} an
1 ∅, 1 2
2 ∅, 1, 2, 12 4
3 ∅, 1, 2, 3, 12, 13, 23, 123 8
Why should this be true? How can we be sure that this is still
true for n = 100, say? As a first attempt at an understanding let us
order the subsets by their size and see how many subsets there are
for each fixed size. For n = 2 the numbers of subsets with 0,1,2
elements are 1,2,1, respectively; for n = 3 the numbers of subsets
with 0,1,2,3 elements are 1,3,3,1, respectively. Adding up, we get 4
and 8 subsets; but there is no clear pattern which would help us
explain why we always (for all n) get a power of 2. We need a new
idea.
Second attempt: Can we solve the problem recursively? Can we
reduce the problem of size n to the same problem of size n − 1?
Can we find a recurrence relation?
Let us check the example n = 3: Can we relate the subsets of
{1, 2, 3} to the subsets of {1, 2}? Look at the table above.
Observation: The subset of {1, 2} are among the subsets of {1, 2, 3}:
They are precisely those subsets of {1, 2, 3} which don’t contain
the element 3.
2 Such short notation can be very useful. It should be explained when it is used
the first time.
46 2 Recursion – a fundamental idea
∅, 1, 2, 12 (2.2)
Do you notice anything? Stare at these two lines until you notice
something (beyond the fact that each line has four items, of course).
Of course! Each set in row (2.1) arises from a set in row (2.2) by
adding the digit 3 to it.
Let us summarize: We have divided the subsets of {1, 2, 3} in two
classes: those that contain 3 and those that do not. For each class
we showed that it has as many subsets in it as there are subsets of
{1, 2}. Therefore a3 = a2 + a2 = 2a2 .
The main virtue of this argument is that it generalizes to any n: We
divide the subsets of {1, . . . , n} in two classes: those that contain n,
and those that don’t. Each class contains an−1 subsets, by the same
reasoning as above. Therefore we get the recursion
an = 2an−1 .
Proof.
We divide the subsets of {1, . . . , n} in two classes: the first class
contains those subsets that contain n, the second class contains
those subsets that do not contain n.
The subsets that don’t contain n are precisely the subsets of
{1, . . . , n − 1}. So the second class contains precisely an−1 sub-
sets.
For any subset A ⊂ {1, . . . , n} which contains n we consider
the subset B = A \ {n} of {1, . . . , n − 1}. Now any subset B ⊂
{1, . . . , n − 1} arises in this way from some A: simply set A =
B ∪ {n}. In fact, this is clearly the only choice of A which results
in B. Therefore the first class contains as many subsets A as there (*)
are subsets B of {1, . . . , n − 1}, i.e. an−1 subsets.
Summing up, we get an = an−1 + an−1 = 2an−1 for all n = 1, 2, . . . .
q. e. d.
The factor 2n−1 arises since each time the index of a goes down by
1 we get another factor of 2. The index of a is reduced from n to 1
over all, hence by n − 1, hence there are n − 1 factors of 2, so we
get 2n−1 . !
We now write up the same solution again, but in very formal
mathematical language. This language is most useful when writing
up complex arguments, so for our problem it is really a bit of overkill.
So you may skip this part unless you want to practice formal language.
In the second part of the proof we use mathematical induction. This
will be introduced in Chapter 3.
Un = { A ∈ Tn : n ∈ A}
Vn = { A ∈ Tn : n ∈ A} .
Then
Tn = Un ∪ Vn (disjoint union) . (2.4)
u : Un → Tn−1 , A → A \ {n} .
v : Tn−1 → Un , B → B ∪ { n }.
Here the first two equality signs are the definitions of v and u, and
the third one follows from n ∈ B. The second equation in (2.5)
follows from
an = 2an−1 = 2 · 2n−1 = 2n ,
which was to be shown. q. e. d.
!
Remarks
? Problem 2.2
In how many ways can you tile a rectangle of size 2 × n with dominoes of
size 1 × 2?
Investigation
G
To get a feel for the problem, sketch a few examples and try to
discover a rule. Squared paper is useful.
n 1 2 3 4 5
an 1 2 3 5 8
Do you see a pattern? – How about this one: Each number in
the lower row is the sum of its two predecessors. That is, an =
a n −1 + a n −2 .
Does it go on like this? If yes, why?
Based on the table we conjecture that the recursion an = an−1 +
an−2 holds for all n. How could we prove this? How can we relate
the tilings of the 2 × n rectangle (corresponding to an ) to tilings of
the 2 × (n − 1) and 2 × (n − 2) rectangles (corresponding to an−1
and an−2 )?
n=1
n=2
n=3
n=4
Either 2 ···
or 2 ···
How many tilings of the first type are there? To the left of the
vertical domino there is a 2 × (n − 1) rectangle, and any tiling of
this rectangle yields a tiling of the 2 × n rectangle of the first type.
So there are an−1 tilings of the first type.
Similarly, for a tiling of the second type we are left with a 2 × (n −
2)-rectangle, and any tiling of this rectangle yields a tiling of the
2 × n rectangle of the second type. So there are an−2 tilings of the
second type.
Therefore, we get an = an−1 + an−2 .
If you are not convinced, check the argument step by step for n = 4.
G
We have obtained the following solution.
2 × (n − 1) rectangle R
. The type-1 tilings of R correspond precisely
to all the tilings of R
: Any tiling of R
yields a type-1 tiling of R, by
simply adding the vertical domino at the right-hand end. Conversely,
removing the right-most vertical domino from a type-1 tiling of R
yields a tiling of R
.
Therefore, R has an−1 type-1 tilings.
Similarly, for any type-2 tiling of R a 2 × (n − 2) rectangle R
.
Therefore, R has an−2 type-2 tilings.
Altogether there are an−1 + an−2 tilings of the 2 × n rectangle, so
a n = a n −1 + a n −2 . q. e. d.
n 1 2 3 4 5 6 7 8 9 10 · · ·
an 1 2 3 5 8 13 21 34 55 89 · · ·
a n = a n −1 + a n −2 (R)
? Problem 2.3
Find a closed formula for the sequence a0 , a1 , . . . which is defined by the
recurrence relation (R) (valid for n ≥ 2) and the initial conditions
a0 = 1, a1 = 1. (IC)
α2 = α + 1 . (2.6)
4 Let’s do it: Plug an = rn + s into the recursion; this yields rn + s = r (n −
1) + s + r (n − 2) + s. A little algebra yields rn = 3r − s. Can this be true for all n?
Obviously not, unless r = 0 and s = 0. But then an = 0 for all n – indeed a solution
but an uninteresting one.
5 The German word Ansatz means attempt or approach. In this mathematical
n 0 1 ...
known: bn 1 β ...
(2.8)
known: cn 1 γ ...
wanted: an 1 1 ···
We see that bn , cn satisfy the initial condition for n = 0 but not for
n = 1.
We need another idea. Did we find all solutions of (R)? Or can we
produce more solutions from the two that we found?
2.4 Solving the Fibonacci recurrence relation 57
New from old! There are two simple ways to produce new solu-
tions from old ones:
1. Multiply by a constant: If b0 , b1 , . . . solves (R) and B is any
real number then Bb0 , Bb1 , . . . also solves (R), because
bn = bn−1 + bn−2 ⇒ Bbn = Bbn−1 + Bbn−2
for all n ≥ 2.
2. Add: If b0 , b1 , . . . and c0 , c1 , . . . both solve (R) then so does
d0 , d1 , . . . defined by dn = bn + cn , because we can simply add
the equations:
bn = bn − 1 + bn − 2
cn = c n −1 + c n −2
+
bn + c n = ( bn − 1 + c n − 1 ) + ( bn − 2 + c n − 2 )
so dn = dn−1 + dn−2 for all n ≥ 2.
We can also combine both ideas: First apply 1. to the bn and the
cn , with two constants B and C, then add the results. This is called
the6
Superposition principle: If b0 , b1 , . . . and c0 , c1 , . . . solve (R)
and B, C are any real numbers then a0 , a1 , . . . defined by
an = Bbn + Ccn for all n
also solves (R).
The point is that since B and C are arbitrary, we get quite many
solutions of (R), so there is a chance that among them there is one
which also satisfies (IC).
So now we need to find the numbers B, C such that these an also
satisfy (IC)7 . We write out the equation an = Bbn + Ccn for n = 0
and n = 1 and plug in the values from the table (2.8):
n=0: 1 = B + C
n=1: 1 = Bβ + Cγ
6 The word originates from physics where it describes, for example, the superpo-
sition of two waves to form a total wave. The superposition principle is always valid
for linear equations.
7 Before jumping into calculations let us think why this might work: We have to
satisfy two initial conditions (equations), and we have to determine two numbers B, C
(unknowns). So the number of equations is the same as the number of unknowns.
Rule of thumb: usually this will work.
58 2 Recursion – a fundamental idea
where p, q are real numbers, with any two given initial val-
ues for a0 , a1 . These are called linear recurrence relations with
constant coefficients.
However, for some values of p, q the method needs to be
modified slightly, see the exercises.
The method also works for linear recurrence relations with
constant coefficients and length greater than two, for example,
an = an−1 − an−2 + an−3 . But now instead of the quadratic
equation for α you need to solve an equation of higher degree
(in the example α3 − α2 + α − 1 = 0), which may be difficult.
Of course one needs to give three initial values.
60 2 Recursion – a fundamental idea
The two big Pi’s are short notation for ‘product’. They tell us to plug
in all possible values of j and k in the parentheses and multiply all
the results. For example, if n = 2, m = 3 then this is a product of 6
factors.
This formula is very mysterious: Why do cosines appear? Why is
the product an integer? The reason why Kasteleyn and Temperley-
Fisher were interested in this problem is that it appears in theoretical
physics.8
8 You
can find more on this, and a guide to the literature, on the Wikipedia page
on domino tilings.
2.5 Triangulations 61
2.5 Triangulations
? Problem 2.4
Let n ≥ 3 and P ¸be a convex n-gon.9 A triangulation of P is a subdivision
of P into triangles, using non-intersecting lines connecting vertices of P,
see Figure 2.3. How many triangulations does P have? Find a recurrence
relation.
Not a
Triangulation Triangulation Triangulation
triangulation
n 3 4 5 6
Tn 1 2 5 14
we also say polygon. A polygon is convex if all lines connecting two of its vertices
lie in the polygon.
62 2 Recursion – a fundamental idea
There are many ways to approach this. Maybe you had one of the
following ideas.
First attempt: We observe that the pattern shown in Figure 2.4
appears in all triangulations – ‘cutting off’ a vertex.
After cutting off the vertex we are left with a polygon that has n − 1
vertices, which we can triangulate in Tn−1 ways. Since we can cut
off any of the n vertices and then, in each case, have Tn−1 ways to
triangulate the rest, we conjecture the recurrence relation
?
Tn = n · Tn −1 (2.11)
−→ ←−
10 If you want to know more about how to deal with such multiple counts
−→ ←−
dividing the problem into classes then the classes must be disjoint.11
We need a disjoint subdivision of the problem.
Here is a new idea: We focus on one side of the n-gon, say the
bottom side in Figure 2.8. Any triangulation must have precisely
one triangle which contains this side. So we can classify the trian-
gulations according to which triangle this is. For n = 6 there are
4 possibilities for this triangle as in the figure, therefore there are
4 classes. Note that the triangle is determined by the location of
its third vertex, and this can be any vertex except the two bottom
ones; this explains why there are 6 − 2 = 4 possibilities.
common elements. Here this means that each triangulation must lie in precisely one
class.
2.5 Triangulations 65
To the left and the right of the dashed triangle we get convex
polygons with fewer than 6 vertices. By counting their triangula-
tions and combining them we can count the triangulations of the
hexagon.
G
We now carry out this idea for general n.
Pk
P2 Pn−1
P1 Pn
Figure 2.9 One of the classes into which we subdivide the problem
The first two ideas for such a reduction (cutting off a vertex, con-
sidering diagonals from a fixed vertex) did not work since they led to
multiple counts.
We finally found a recurrence relation by shifting focus from ver-
tices to sides, which allowed us to subdivide the problem into dis-
joint classes and express the number of triangulations in each class
using triangulation numbers of smaller polygons.
Remarks
2.6 Toolbox
In this chapter you learned a few special strategies which are useful
for problems of the kind “For all n find the number an of objects or
configurations of a certain kind”:
Exercises
1-2 E 2.2 S. how that the method for solving the Fibonacci recurrence
relation works for all recurrence relations (2.10) for which the equation
α2 − pα − q = 0 has two different solutions. Solve the recurrence
relation an = 2an−1 + 3an−2 with the initial condition a0 = 1, a1 = 3
and with the initial condition a0 = 1, a1 = 2.
13 You
can check this by direct calculation. But it is nicer to prove it geometrically
using the geometric meaning of complex numbers and their multiplication.
Exercises 69
E 2.6 F. old a paper strip n times, halving its length every time. Then 1
unfold again. How many folding edges do you get?
E 2.7 .Suppose that n people meet and shake hands, every person 1-2
exactly once with every other person. That’s how many handshakes?
Solve the problem recursively.
E 2.11 F. ind a recurrence relation for the number of possible bracket- 2-3
ings of n factors abc · · · . Here a bracketing must be such that when
evaluating the expression only two factors are multiplied in each
70 2 Recursion – a fundamental idea
3 E 2.12 I.n how many ways can you tile a rectangle of size 3 × n with
dominoes of size 1 × 2?
3 E 2.13 H
. ow many natural numbers are there that have n digits, where
only the digits 1, 2 and 3 occur and where consecutive digits differ by
at most one?
3 E 2.14 N
. im is a game for two players. At the start, n matches are on
the table. Players take turns, and in each move a player can take 1, 2
or 3 matches. The player who takes the last match wins. For which
n can the first player force victory, that is play in such a way that
he/she wins, whatever the second player does?
3 = 1 + 1 + 1 and 4 = 1 + 1 + 1 = 1 + 3 = 3 + 1
Induction principle
Proof.
We use mathematical induction. Here A(n) is the statement that the
formula holds for the value n.
Base case: The statement A(1) is: 1 = 1·2/2. This is obviously true.
Inductive hypothesis: Let n be arbitrary, and assume A(n) is true, so
∑nk=1 k = n(n+1)/2 holds.
+1
Inductive claim: A(n + 1) is true, that is ∑nk= 1 k =
(n+1)(n+2)/2.
Proof (inductive step): We use A(n) and compute:
n +1 n
∑k= ∑k + ( n + 1)
k =1 k =1
n ( n + 1)
n n+2
= + ( n + 1) = + 1 ( n + 1) = ( n + 1)
2 2 2
(n + 1)(n + 2)
= ,
2
which was to be shown. q. e. d.
3.2 Colourings
? Problem 3.1
A number of lines are given in the plane. They subdivide the plane into
regions. Prove that you can colour the regions using two colours so that
adjacent regions always have different colours.
Here we call two regions adjacent if they have a common border. A
common vertex is not enough. See Figure 3.2.
Investigation
G
Let us call a colouring proper if adjacent regions always have different
colours. Also, let us call a colouring by two colours a 2-colouring.
Draw a few examples in order to check that the claim has a chance
of being true, and to get a feel for the problem. Try to find a
reason why it always works.
Proof: The lines of M are divided into segments by other lines. Any
border between two regions is one such segment. We check for each
segment that the two adjacent regions have different colours in the
colouring C. There are three types of segments:
3.3 Toolbox
Exercises
E 3.1 .Prove that you can put infinitely many pins into a suitcase :-). 1
E 3.3 .Prove that any triangulation of an n-gon (cf. Problem 2.4) has 2
precisely n − 2 triangles and n − 3 diagonals.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
an · an (∗) 1 · 1
a n +1 = a n · a = = = 1,
a n −1 1
where (∗) follows from the inductive hypothesis.
By induction the claim follows for all natural numbers n.
3 E 3.8 .The ‘Tower of Hanoi’ is a puzzle. You have three vertical rods
A, B, C and several disks of different sizes which have holes so you
can slide them onto the rods. In the beginning all disks are on rod A,
Exercises 81
ordered by size, the largest one at the bottom. Your goal is to move
all disks to rod C. In one move you can take a single disk from one
rod and put it on another – but only if the disk is smaller than all the
disks which are already present on the new rod.
Find a formula for the smallest number of moves which is needed
to accomplish this when you have n disks. Prove the formula by
induction.
E 3.9 . Give another solution for Problem 3.1 by working out the 3
following idea: We choose any region, call it A, and colour it red.
Then we colour the other regions as follows: Let B be any region.
Choose a path from a point in A to a point in B which does not meet
any vertices. Count how often the path intersects one of the given
lines (boundaries of regions). If this number is even then B will be
coloured red, otherwise blue.
Remark: In this way you can also prove a generalisation of the state-
ment of Problem 3.1: If every vertex of a plane graph has even degree
then the faces of the graph can be coloured properly with two colours.
(The notions graph, degree and face will be introduced in Chapter 4.)
4 Graphs
The graphs which you will encounter in this chapter are very simple
objects at first glance – so simple that most people wouldn’t asso-
ciate them with mathematics. They bear no relation to formulas
or equations, nor to geometry. But thinking about them leads to a
lot of interesting mathematics, and you will discover some of that
mathematics in this chapter. You will use mathematical induction in a
new context and learn some new techniques for problem-solving, like
counting in two ways and even/odd arguments. You will encounter
a proof of impossibility – a fascinating species of mathematical propo-
sition, about the limits of what can be done. Finally, with Euler’s
formula you will get a first glimpse of the intriguing mathematical
area of topology.
1 Be careful: The graphs we are talking about here have no relation to the
graphs of functions, that you study in calculus. Therefore they are sometimes called
combinatorial graphs.
2 In most examples the edges are straight lines. However, this is not required in
the definition.
G1 G2 G3 G4 G5
Figure 4.1 Five examples of plane graphs
? Problem 4.1
Let G be a connected plane graph. Denote by v, e, f the numbers of vertices,
edges and faces of G, respectively. Prove that
Investigation
G
Look at a few examples and check the formula. Also check that
the formula is false for disconnected plane graphs. In this way you
get a feel for the formula and also for the great variety of graphs.
Graphs with many vertices can be quite complex. How can we find
a proof for the formula in spite of this variety?
Plan: We want to prove this inductively. What would the inductive
step be? It could run as follows: In order to prove the formula for a
graph G we construct from G a smaller graph G
, use the inductive
4.1 The Euler formula for plane graphs 85
hypothesis for G
and then conclude that Euler’s formula holds
for G.
How can we make a graph smaller? We could remove a vertex or
an edge. This would correspond to mathematical induction on v
or e, respectively.
First attempt: Induction on v. Let us try to do the inductive step.
Inductive hypothesis: Let v ≥ 1 be arbitrary. Assume that Euler’s
formula holds for all connected plane graphs having fewer than v
vertices.
Inductive step: Let G be an arbitrary connected plane graph, having
v vertices, e edges and f faces. We want to prove that v − e + f = 2.
In order to use the inductive hypothesis we remove a vertex from
G; then we also need to remove all edges attached to this vertex.
How do v, e, f change?
Denote the removed vertex by V and the new graph by G
. Let
v
, e
, f
be the number of edges, vertices, faces of G
. Clearly
v
= v − 1, but how are e
and f
related to e and f ? To get
an idea what happens, we look at some examples, see Figure
4.2. However, our arguments must be generalizable to arbitrary
connected plane graphs.
By the inductive hypothesis we have v
− e
+ f
= 2. (Or not? See
below!) We want to conclude v − e + f = 2.
The first example in Figure 4.2 is easy: We remove one vertex and
one edge, so the difference v − e does not change: v − e = v
− e
;
also, f = f
, so v − e + f = v
− e
+ f
= 2.
The second example shows that the number of faces can change
also. Things get complicated. How can we control the simultaneous
change of v, e and f ?
Idea: Remove the edges attached to V one by one, and check how
f changes in each step: It seems clear that the number of faces
decreases by one every time we remove an edge (so −e + f and
hence v − e + f remains constant), except when removing the last
edge. When removing the last edge we are in the situation of the
first example.
This looks promising. But the third example shows that we must be
careful: By removing an edge the graph may fall apart, i.e. become
86 4 Graphs
G G
: v
= v − 1, e
= e − 1, f
= f
G G
: v
= v − 1, e
= e − 3, f
= f − 2
G G
: not connected
disconnected.
Summary of first attempt: It is not easy to track what happens when
removing a vertex. Along the way it is reasonable to remove edges
one by one.
This suggest another idea: We could start out by removing edges,
not vertices. That is, we could do an induction on e, not on v. Try
it!
first.
Inductive hypothesis: Let e ≥ 1 be arbitrary. Assume Euler’s for-
mula holds for all connected plane graphs with fewer than e edges.
Inductive step: Let G be an arbitrary graph with e edges, v vertices
and f faces.
Remove one of the edges, call it E and the remaining graph G
. Let
v
, e
, f
be the numbers of vertices, edges and faces of G
.
Clearly, v
= v and e
= e − 1 since we remove only one edge.
(We don’t remove any vertices, even if they get separated from the
remaining graph by removing E.) This is simpler than in the first
attempt, where all three quantities v, e, f could change.
But it is still possible that the graph falls apart when removing E.
So we must take this seriously. We consider two cases:
Case 1: G
is connected.
Case 2: G
is not connected.
We make a sketch, see Figures 4.3 and 4.4. The dashed lines
represent any path in G or G
, the dots more vertices or edges.
(The drawn edges on the left and right are examples, they need
not be there.)
Let us consider case 1: How does f change? By removing E we
amalgamate two faces into one, so we have f
= f − 1. Using
k
= k − 1 we get e − k + f = e
− k
+ f
= 2 as required.
In case 2 G
is not connected, so we cannot use the inductive
G G
G G
. Now we
G
G
Figure 4.5 Case 2: Gluing the two (former) endpoints of E into one vertex
2 = v
− e
+ f
= v − ( e − 1) + ( f − 1) = v − e + f .
Case 2: G
is not connected. Then both sides of the edge E border
the same face. Therefore
v
= v e
= e − 1, f
= f .
= v
− 1 = v − 1, e
= e
= e − 1, f
= f
= f .
Because e
and obtain
2 = v
− e
+ f
= (v − 1) − (e − 1) + f = v − e + f .
Remark
v1
− e1
+ f 1
= 2
v2
− e2
+ f 2
= 2
+
v − ( e − 1) + ( f + 1) = 4.
Subtracting 2 yields v − e + f = 2.
Counting in two ways is a simple powerful idea that you can use in
many contexts to derive interesting formulas.
4.2 Counting in two ways for graphs 91
? Problem 4.2
Let G be a plane graph. Put a mark (a ‘custom house’) at both sides of each
edge, see Figure 4.6. Count the number of custom houses in two ways.
! Solution
First count: There are two houses at each edge. Therefore there are 2e
houses.
Second count: Count the houses in each face (‘country’) and add. To
write a formula we use the notation
2e = ∑ bF (4.2)
F face of G
? Problem 4.3
Let G be a plane graph. Draw an arrow wherever an edge leaves a vertex,
see Figure 4.7. Count the number of arrows in two ways and deduce a
formula.
! Solution
First count: Each edge carries two arrows. Therefore there are 2e
arrows.
Second count: For each vertex V there are as many arrows as there are
edges containing V. We let
(where we count an edge twice if both its endpoints are the vertex V).
Then the number of arrows is ∑ dV . From the two counts we
V vertex of G
get the edge-vertex formula
2e = ∑ dV (4.4)
V vertex of G
4.2 Counting in two ways for graphs 93
!
Here it was not essential that the graph was plane. The argument
still works if edges intersect. It is also not important how the graph is
drawn. This motivates the general definition of a graph, which does
not refer to any concrete picture of it.
We summarize:
Graph formulas
2e = ∑ dV .
V vertex of G
2e = ∑ bF .
F face of G
v − e + f = 2.
You should know these formulas well. They can often be used for
problem-solving.
? Problem 4.4
At a party some of the guests shake hands. Show that at any point in time
the number of guests who have shaken an odd number of hands is even.
! Solution
Consider the graph whose vertices are the guests, where two vertices
are joined if and only if the guests have shaken hands. For each
guest V the degree dV is the number of handshakes she has made. By
formula (4.4) the sum of all dV is 2e, an even number. Therefore the
number of vertices (guests) V for which dV is odd must be even. !
4.4 Five points in the plane, all joined by edges 95
? Problem 4.5
In Figure 4.9, can you connect boxes A with A, B with B and C with C so
that the connecting lines don’t intersect?
C A
A B C
? Problem 4.6
Can you draw 5 points in the plane with a line joining each pair of them, so
that the joining lines don’t intersect?
Put differently: Does the graph G given by 5 vertices, with any two
vertices joined by a single edge, have a plane representation? Recall
that with 4 vertices this is possible, see the left-hand picture in Figure
4.8.
B
C A
D E
Investigation
G
Try it! – After a while you will probably conjecture that it is not
possible. For example, in Figure 4.10 all lines except the one from
A to D are drawn, and it is clear that we cannot draw the missing
line without intersections. This is because A lies outside the closed
path BCEB while D lies inside. So we formulate the conjecture: It
is impossible.
But watch out: The picture does not prove the impossibility. Per-
haps we chose the previous lines badly, and if we had started out
differently then it would have worked. Problem 4.5 showed us
that we need to be careful. We need a general argument, one that
works no matter how we try to draw the lines.
What do we want to prove? An impossibility. How do you prove
that something is impossible? You use a proof by contradiction:
You suppose that it is possible, and from this you derive a contra-
diction or a conclusion which is obviously false.
4.4 Five points in the plane, all joined by edges 97
20 = 2e = ∑ bF ≥ ∑ 3 = 7 · 3 = 21 , (4.5)
F face of G F face of G
98 4 Graphs
!
Review of Problem 4.6
This was a first example of a proof of impossibility:4 We were able to
prove that every one of the infinitely many possibilities of drawing
G must have intersecting edges. Our argument was indirect: By
assuming there were no intersections, we derived a false statement.
v − e + f = 2.
5 Convex polyhedra can also be characterized as: 1. The convex hull of finitely
many points in space, i.e. the smallest convex set containing these points. 2. The
intersection of finitely many half spaces, assuming this is bounded. The equivalence
of these conditions is intuitively clear but not easy to prove.
100 4 Graphs
you can put your arm through, while the sphere doesn’t – and that this
property is preserved when we deform these surfaces continuously?6
Euler’s formula allows us to find an answer to this question, as
follows:
3. There are also versions of Euler’s formula for other surfaces. For
a ‘torus with two holes’ you get the formula v − e + f = −2, for
three holes (surface of a pretzel) you get v − e + f = −4. In general
6 Thinkof turning the sphere into a long sausage, then knotting the sausage.
Topologically this is still like a sphere, but what is the essential difference from a
torus, which may also be knotted?
7 For example this is not the case for the graph consisting of a single vertex and
B
A A
D
C C
A A
B
for g holes you get v − e + f = 2 − 2g. The number that you get
on the right is called the Euler characteristic of the surface.
See the References section at the end of the book for further reading
on topology.
? Problem 4.7
Suppose we want to colour the faces of a plane graph in such a way that any
two faces which share a border must get different colours. We call such a
colouring proper. What is the smallest number of colours which is enough
for a proper colouring of any plane graph?
8 You may find this unsatisfying: While the Euler characteristic distinguishes
sphere and torus it does not intuitively reflect the ‘hole’ in the torus. But it has the
advantage of being easily defined. There is a way to talk about holes mathematically.
It is called homology theory, but it takes a lot more effort to define it.
9 You will learn more about invariants in Chapter 11.
102 4 Graphs
J It is easy to see that you need at least 4 colours, for example for
the graph on the left of Figure 4.8, since every one of the four faces
borders on every other face. If you carefully try out some more
examples then you will notice that four colours always seem to
suffice (be enough).
J This leads to the 4-Colour Conjecture: Four colours suffice for any
plane graph. In other words: The countries in any plane map can
be coloured with four colours in such a way that countries which
share a border get different colours.
J It turned out to be extremely difficult to prove this conjecture. The
conjecture was formulated the first time in 1852, but in spite of the
efforts by many mathematicians the first proof was only obtained
in 1976 (so now it is the 4-Colour Theorem). Unfortunately part
of the proof consists in checking a large number of special cases,
too many to do by hand. So a computer was used for this. Even
now, no proof is known which does not rely on computer help.10
Exercises E 4.10 to E 4.14 allow you to retrace some of the steps on
the way to the four colour theorem. There you will also see that
the analogous problem for the torus is simpler. Here the smallest
number of colours is 7.
4.6 Toolbox
While thinking about Problem 4.1 you saw that it is important to stay
flexible, to change a chosen route if you get a better idea. Problem 4.5
showed that you need to be very careful not to jump to the conclusion
that “This is clearly impossible!” – often it is hard or even impossible
to have all possibilities in mind. Nevertheless, mathematics allows
us sometimes to give rigorous proofs of impossibility, for example
using the technique of proof by contradiction. You also learned the
technique of counting in two ways and some of its uses, for example
in the proof of impossibility in Problem 4.6.
Finally in Problem 4.4 you saw a simple example of how to use
graphs as representations of complex webs of relationships.
10 You find more on the interesting history of this problem in (Aigner, 1987), for
example.
Exercises 103
Exercises
E 4.4 .Is there a polyhedron with exactly 7 triangular and no other 1-2
faces? (See Section 4.5 for the definition of a polyhedron.)
E 4.5 . Imagine a house that has a front door but no back door 2
or other entrance. Can you be sure that there is a room in the
house which has an odd number of doors? (Rooms include kitchen,
bathrooms, corridors etc.)
1-2 E 4.10 . Prove that there is no plane graph with five faces each of
which borders on every other face. Why does this not immediately
imply the 4-Colour Conjecture?
2-3 E 4.11 .Let G be a plane graph all of whose vertices have degree at
least 3. Prove that there is a face with at most 5 borders.
3 E 4.12 .Use Exercise E 4.11 to prove the 6-Colour Theorem: the faces
of every plane graph can be coloured properly with 6 colours.
2 E 4.13 .Draw a graph on the torus which has 7 faces, each bordering
every other face.
3 E 4.14 . Exercise E 4.13 shows that there is a graph on the torus for
which you need 7 colours. Prove the 7-Colour-Theorem for the torus:
the faces of any graph on the torus can be coloured properly with 7
colours.
Investigate which of the other figures can be drawn in one go. Can
you find a criterion to decide for a given graph whether it can be
drawn in one go?
ist das Haus vom Nikolaus’ – ‘This is the house of Santa Claus’.
Exercises 105
meet at each vertex and every face has the same number of ver-
tices. Prove that cube, octahedron, tetrahedron, dodecahedron and
icosahedron are the only regular convex polyhedra.
E 4.17 .Label the vertices of a triangle with the numbers 1,2,3. Now 3
introduce some additional vertices in the interior and on the edges,
and add edges so that every internal face is a triangle. Then label the
interior vertices 1, 2 or 3 however you like, and label each new vertex
on an edge of the big triangle with one of the numbers at the end
points of this edge.
Prove that there is a (small) triangle all of whose vertices have different
labels.
Note: This assertion is known as Sperner’s Lemma. It can be used
to prove quite amazing results, for example Brouwer’s Fixed Point
Theorem.
5 Counting
In how many ways can you arrange 5 objects in a row? How many
poker hands have two pairs? Counting is one of the original purposes
of mathematics. You can find counting problems in everyday life
and in calculating probabilities (how likely is it to have two pairs in
a poker hand?). You have already seen some counting problems in
previous chapters and learned about the recursion technique. In this
chapter we will take a systematic look at counting problems.
Counting is not only a goal in itself, it can also be used to achieve
other goals. For example, counting the same objects in two ways can
lead to many interesting formulas. Variations of the basic idea of
counting in two ways occur in many areas of mathematics, and some
of them are explained at the end this chapter.
| X | = number of elements of X .
The two fundamental rules of counting are the addition rule and the
multiplication rule:
X = X1 ∪ · · · ∪ X r , Xi pairwise disjoint,
then | X | = | X1 | + · · · + | Xr |.
? Problem 5.1
! Solution
1. First decision: which appetiser. Second decision: which main
course. Third decision: which dessert. Each decision can be made
independently of the outcomes of all previous decisions. Therefore
there are 3 · 5 · 2 = 30 different 3-course meals.
2. For choosing the first digit there are the 9 possibilities 1, . . . , 9 (first
decision), for choosing the second digit there are the 10 possibilities
0, . . . , 9 (second decision). So there are 9 · 10 = 90 numbers.
Second solution: These are all numbers from 10 to 99, that is,
99 − 10 + 1 = 90 numbers.2
2 Not 99 − 10 since you need to include the first and the last one. Compare the
shift by one in Problem 1.1.
110 5 Counting
Let
Multiple-counting principle
a) We can count Y.
Then | X | = |Y |/m.
(1, 2)
(1, 2)
(2, 1)
(1, 3)
(1, 3)
(3, 1)
(2, 3)
(2, 3)
(3, 2)
X Y
Figure 5.1 Double counting of the pairs ( a, b) with a, b ∈ {1, 2, 3} and a < b
? Problem 5.2
A game uses tiles in the shape of equilateral triangles, whose top faces are
marked with three different numbers from the set {0, . . . , 5}. How many
different tiles are there?
! Solution
1
2
2
3
? Problem 5.3
The game Triominoes uses tiles as in the previous problem, but the numbers
on the tiles need not be distinct. How many different tiles are there?
! Solution
Again we first count how many ways we can mark a fixed triangle.
Since the numbers need not be distinct, we have 6 possibilities for
each vertex, so by the multiplication rule there are 6 · 6 · 6 = 216
triangles.
Does every tile correspond to three marked triangles as before?
No, since a tile with three equal numbers only corresponds to one
marked triangle. There are 6 such tiles. All other tiles correspond to
three marked triangles as before. Therefore we apply the multiple-
counting principle to those triangles whose three numbers are not
all the same. There are 216 − 6 = 210 such triangles, so 210 3 = 70
corresponding tiles. In addition, there are the 6 tiles with all numbers
equal. Altogether we have 76 tiles. !
Review
The multiple-counting principle can only be applied if the size of the
multiple-counts (m) is always the same. If this is not the case then one
can try to divide the set that is to be counted into subsets (classes) to
which the principle is applicable. So here we first used the addition
rule and then the multiple-counting rule.
114 5 Counting
Using the fundamental counting rules we can solve the most impor-
tant general counting problems. Many real-life counting problems
can be translated into one of these basic types.
Let A be a set with n elements: | A| = n. We want to count tuples
and subsets of elements of A. We denote the size of the tuple or
subset by k ≥ 1. We always consider the case k = 2 first since the
principles are most easily understood in this case.
You should work out a special case for each type of counting
problem, for example A = {1, 2, 3, 4} and k = 3. Write out all
possibilities and make sure you understand the counting principle.
Number of orderings:
? Problem 5.4
10 people meet. Each one shakes hands with every other person exactly once.
That’s how many handshakes?
3 Thecorresponding map – see the additional remarks before Problem 5.2 – is
very easy to write down in this case: if (b1 , . . . , bk ) is a k-tuple with all bi different
then f (b1 , . . . , bk ) = {b1 , . . . , bk }.
4 A good way to remember the lengthy expression in the numerator is to notice
! Solution
Let A be the set of 10 people. Each handshake corresponds to a 2-
10·9
2 ) = 2 = 45.
element subset of A. So the number of handshakes is (10
!
The same counting problem appears in many disguises, for example:
number of connections between n points; number of pairs ( a, b) with
a, b ∈ {1, . . . , n} and a < b (note that these pairs correspond precisely
to 2-element subsets since any such subset can be written as { a, b}
with a < b; compare Problem 5.1.4).
? Problem 5.5
A group of 10 women and 10 men go dancing. How many ways are there
to make up 10 mixed pairs?
! Solution
We number the women 1, . . . , 10. The first woman can choose among
all 10 men, then the second woman can only choose among 9 men
(no matter which man was chosen by the first woman), the next
one among 8 etc., the last woman has the choice of only one man.
Therefore there are 10 · 9 · · · · · 1 = 10! = 3, 628, 800 possibilities.
Alternatively you could line up the women. Then each pairing
corresponds to one way of lining up the men next to the women. So
you need to count the orderings of the 10 men. !
a 1
b 2
c 3
d 4
X Y
Counting by bijection
J For counting: If you want to count X then you can try to find a set
Y whose cardinality you know, and a bijection X → Y.
Even if you already know a formula for | X | such a bijection can
lead to a better understanding of the formula.
subset 1 2
∅ − −
{1} + −
{2} − +
{1, 2} + +
For each subset there is one row. In the column marked 1 we write a
+ whenever the subset contains the element 1, otherwise we write a
−, and similarly for the column marked 2. If we read the table row
by row then we see that each subset corresponds to a pair of elements
of A = {−, +}. For subsets of {1, 2, 3} we would get three columns,
hence triples. In general we obtain:
Second proof of the equation |P ({1, . . . , n})| = 2n : The subsets of
{1, . . . , n} correspond to the n-tuples ( a1 , . . . , an ) with ai ∈ {−, +}
for all i, as follows. Each subset S ⊂ {1, . . . , n} is associated with the
n-tuple ( a1 , . . . , an ) defined by
+ if i ∈ S
ai =
− else.
? Problem 5.6
Prove the identity
n n
=
k n−k
(for 0 ≤ k ≤ n) using a bijection.
! Solution
The left-hand side counts the k-element subsets of {1, . . . , n}, the
right-hand side counts the (n − k )-element subsets. How can we
relate these to each other? Can we find a bijection?
? Problem 5.7
For n ≥ 1 let en and on be the numbers of subsets of {1, . . . , n} which have
an even or odd number of elements, respectively. Find formulas for en and
on .
Investigation
G
Let us look at some examples. We leave out the braces (or “curly
brackets”) for simplicity. Let us call a subset even/odd if it has an
even/odd number of elements.
n even subsets odd subsets en on
1 ∅ 1 1 1
2 ∅, 12 1, 2 2 2
3 ∅, 12, 13, 23 1, 2, 3, 123 4 4
F : En → On .
What does this mean? We are looking for a rule that associates
an odd subset with every even subset. The rule must be such that
every odd subset appears precisely once as a result.
How can you produce one subset from another subset? You know
one way to do this from Problem 5.6: taking the complement.
That is, associate S ⊂ {1, . . . , n} with its complement {1, . . . , n} \ S.
Does this rule produce an odd subset from an even one? If n is
odd then this is the case, as you can easily check. But if n is even
then the complement of an even subset is even again.
So for odd n we have solved our problem.
But what about even n? We need a new idea.
6 Counting in two ways is sometimes called double counting, but this expression
is also used for ‘overcounting by a factor of two’ as in the multiple-counting principle.
7 Problem 5.6 showed another way of deriving a formula by counting.
124 5 Counting
? Problem 5.8
Connect n points pairwise by lines. Count the number of lines in two ways
and derive an identity.
! Solution
J First count: Number the points 1, . . . , n.
– First connect 1 and 2, 1 and 3, . . . , 1 and n, that’s n − 1 lines,
– then connect 2 and 3, 2 and 4, . . . , 2 and n (note that 2 and 1
are already joined), that’s n − 2 lines,
– then connect 3 to the points 4, . . . , n, that’s n − 3 lines,
– and so on, and finally connect n − 1 and n.
Therefore the total number of lines is
( n − 1) + ( n − 2) + · · · + 1 .
J Second count: Since we want to draw a line between any two points,
the lines correspond to the 2-element subsets of the set of points.
There are (n2 ) such subsets. (Compare Problems 5.4 and 5.1.4.)
J Therefore we get
n
( n − 1) + ( n − 2) + · · · + 1 = . !
2
? Problem 5.9
Count the number of triples ( a, b, c) which satisfy
c triples number
1 none 0
2 (1, 1, 2) 1
3 (1, 1, 3), (1, 2, 3), (2, 1, 3), (2, 2, 3) 4
Conjecture?
How many ways of choosing a, b are there for any fixed c? The
conditions are a < c, b < c, so a, b ∈ {1, . . . , c − 1}. Since a, b can
be chosen independently, there are (c − 1)2 possibilities.
Since any choice of c ∈ {1, . . . , n} is possible, by the addition rule
we get that there are
02 + 12 + 22 + · · · + (n − 1)2
triplets.
Second count: How else could we count the triplets? Instead of
sorting them by the value of c, we could first fix the numbers that
appear in the triplet and then count how many triplets can be
formed from these numbers. For example, from the numbers 1, 3, 4
we can form the triplets (1, 3, 4) and (3, 1, 4), but from the numbers
2, 5 we can only form the triplet (2, 2, 5).
The examples suggest that we should distinguish whether two or
three different numbers appear in a triplet (it is not possible that
126 5 Counting
only one number appears since c is always larger than a and b).
Therefore we divide the triples into two classes and do a case by
case analysis:
1. The triplets having a = b. Each such triplet has two different
numbers a and c, so it determines a 2-element subset S of
{1, . . . , n}. Conversely any 2-element subset S determines a
unique triplet: a = b must be the smaller element of S and c
must be the larger element. Therefore there are (n2 ) such triplets.
2. The triplets having a = b. Each such triplet determines a 3-
element subset S of {1, . . . , n}. Conversely, we saw in the ex-
ample that a 3-element subset S determines two triplets. This
works in general: Write S = { x, y, z} with x < y < z, then S
corresponds to the triplets ( x, y, z) and (y, x, z). Since there are
(n3 ) 3-element subsets S, we get 2(n3 ) such triplets.
By the addition rule we get that the total number of triplets is
n n
+2 .
2 3
Remark
? Problem 5.10
Prove the formula
n
n
2 = ∑
n
k =0
k
! Solution
What is counted by 2n ? The subsets of An = {1, . . . , n}, see Problem
2.1 and Section 5.2. And (nk) counts the subsets with k elements. So
both the left and the right side count the number of subsets of An ,
but on the right we sort them by their number of elements.
More formally: Let An = {1, . . . , n} and X = P ( An ) the power set
of An . For k ∈ {0, 1, . . . , n} let Xk be the set of k-element subsets of
An : Xk = {S ⊂ An : |S| = k }. Then
X = X0 ∪ X1 ∪ · · · ∪ X n
n
and the Xk are pairwise disjoint. By the addition rule, | X | = ∑ | Xk |.
k =0
The formula now follows from | X | = 2n and | Xk | = (nk). !
Here is a proof by counting in two ways which you may know from
elementary school:
? Problem 5.11
Prove by counting in two ways that
n·m = m·n
! Solution
Consider a rectangular array of dots, which is n dots wide and m dots
high. If you count the dots column by column then you get n · m dots
(each column has m dots, there are n columns); if you count them
row by row then you get m · n dots. !
This may look trivial to you – for children who have just learned to
multiply it is not.
You can find variations on the idea of counting in two ways in all
areas of mathematics. Here are some examples. Even if you don’t
understand all the words in the explanations that follow, keep reading
anyway. You will remember the ideas when you learn more math-
ematics. Then you should also look out for more examples of this
principle.
1 + 3 + · · · + (2n − 1) = n2
B URNSIDE’s lemma
1 + 3 + 5 + . . +(2n-1)
.
...
... n
.. .. ..
. . .
Double sums
the row sums, in the example ( a11 + a12 + a13 ) + ( a21 + a22 + a23 );
J first sum over i for each fixed j, then add the sums (i.e. sum over j):
m n
∑ ∑ aij . This means first summing each column and then adding
j =1 i =1
the column sums, in the example ( a11 + a21 ) + ( a12 + a22 ) + ( a13 +
a23 ).
Since we are adding all numbers in both cases, the results must be
equal:
n m m n
∑ ∑ aij = ∑ ∑ aij . (5.3)
i =1 j =1 j =1 i =1
This generalizes counting in two ways. For example, if all aij = 1 then
you obtain the counting proof of n · m = m · n. Another example is
the edge-vertex formula (4.4) for graphs: Suppose a given graph has
its vertices numbered by i and its edges numbered by j. Set
⎧
⎪
⎪
⎨1 if edge j has vertex i as one endpoint
aij = 2 if edge j has vertex i as both endpoints
⎪
⎪
⎩0 otherwise.
Then the sum of row i is the degree of vertex i and the sum of column
j is 2 for each j. So (5.3) is just the edge-vertex formula (here n = v,
m = e).
Changing the order of summation as in equation (5.3) also gives
interesting results for infinite sums (so-called series). A famous
example of a series is ∑∞ n=1 n2 = 1 + /4 + /9 + . . . . There is no
1 1 1
Double integrals
If you are familiar with integration then you know that integrals may
be considered as the continuous analogue of sums.
This leads to further generalizations of the idea of counting in two
ways: If you have a function of two variables, f ( x, y), then you can
integrate it first in x and then in y, or first in y and then in x – the
fact that the results are the same is known as Fubini’s theorem. If
5.4 Going further 131
integration variable does not change the value of the integral!) and
multiply:
∞ ∞ ∞ ∞
e− x dx e−y dy = e−( x
2 2 2 + y2 )
I2 = dx dy
−∞ −∞ −∞ −∞
This is a double integral, which computes the volume of a certain
body B. We use coordinates x, y, z in space. The body B is infinitely
extended in the horizontal x,y-directions; its base is the z = 0 plane
and its top is the graph of the function z = e−( x +y ) . The double
2 2
Figure 5.4 Two ways to compute the volume under the graph z = e−( x
2 + y2 )
√
and hence I = π. So we have derived the surprising result9
∞ √
e− x dx =
2
π.
−∞
1. You count the women and you count the men and compare the
numbers.
the circles Cr and Cs have constant distance r − s from each other. If this was not
the case we would get an additional factor in the second ‘count’, stemming from the
change of variables formula for integrals. For details see (Pugh, 2010, Section 5.7) or
(Apostol, 1967, Vol. 2, Section 11.26).
5.5 Toolbox 133
The second method allows you to ascertain the equality of the num-
bers without actually knowing the numbers! All you did is establish
a bijection between the set of women and the set of men.
The same idea is used for classifying infinities (cardinalities). Two
sets are said to be of the same cardinality (or equinumerous) if there
is a bijection between them. This notion makes just as much sense
for infinite as for finite sets since we don’t actually need to count the
‘number of elements’. However, with infinite sets some funny things
happen. For example, the set of natural numbers N has the same
cardinality as the set of even natural numbers, since mapping n to
2n for all n ∈ N gives a bijection. Even more surprisingly, N has the
same cardinality as the set of rational numbers (fractions), but not as
the set of real numbers.10
In short: There are as many natural numbers as there are even
natural numbers or fractions, but less than there are real numbers.
5.5 Toolbox
Exercises
E 5.2 . You throw two dice, one black and one white. How many 1-2
possible outcomes are there? An example of an outcome is ‘black 1,
10 For proofs and more explanations see (Pugh, 2010, Section 1.4), for example.
134 5 Counting
white 3’. How many outcomes show two different numbers? How
many outcomes are there if the dice are indistinguishable?
1-2 E 5.3 .In the game of dominoes each tile has two fields, each showing
0, 1, 2, 3, 4, 5 or 6 spots. How many domino tiles are there? Give at
least two derivations of your answer.
2 E 5.5 . How many ways are there to go home from campus, see
Figure 5.5? Only direct routes are counted, i.e. those that always go
east or north. How many ways are there if you want to buy bread on
your way home?
n −1
2 E 5.6 . Find a formula for the sum of cubes ∑ k3 by counting the
k =1
elements of the set
( a, b, c, d) : a, b, c, d ∈ {1, . . . , n}, a < d, b < d, c < d
in two ways.
home
campus bakery
2 E 5.11 . Count in two ways to prove the formula ∑nk=0 k(nk) = n2n−1
for n ∈ N.
2 E 5.12 .Give a new proof of the Fibonacci recursion for the numbers
on in Exercise E 2.15 using a bijection, by distinguishing representa-
tions according to whether the last summand is equal to 1 or not.
2-3 E 5.13 .Consider the pairs ( a, b) with a, b ∈ {0, 1, . . . , n}. Let en be the
number of such pairs for which a + b is even and on the number of
pairs for which a + b is odd. What do you observe for n = 0, 1, 2, 3?
State a conjecture and give proofs via bijection, direct calculation and
induction. Can you generalise to more than two numbers?
Give two proofs: one by direct calculation, the other by counting the
k-element subsets of {1, . . . , n + 1} in two ways. Conclude that (nk) is
the kth entry in the nth row of Pascal’s triangle, see Exercise E 3.5.
Here you always start counting at zero.
2 E 5.16 .
a) Check by direct calculation that the formula (2.9) for the nth
Fibonacci number always yields a rational number. That is,
check that when multiplying out the powers using the general
binomial theorem (see Exercise E 5.15) all square roots disappear.
Exercises 137
E 5.18 .Find at least one more proof for the equality of the numbers 2-3
of even and odd subsets of {1, . . . , n}.
E 5.19 .Let n ∈ N. Find a bijection proof for the fact that the number 3
of ways to write n as an ordered sum of natural numbers is 2n−1 (see
Exercise E 1.9).
E 5.21 .Use the following idea to give a new derivation of the formula 2-3
for the number of regions which result from n lines in the plane in
general position (Problem 1.3):
First turn the plane so that no line is horizontal. Then associate
with every region its lowest point, if it has a lowest point. Do all
intersection points of lines arise as lowest points? How many regions
do not have a lowest point?
E 5.23 .Generalise the idea of Problem 5.8 to the counting of triangles 2-3
that can be formed from the n points, and derive an identity.
E 5.24 .Find the number of regions into which the interior of a circle 3-4
is divided if you choose n points on its circumference and draw all
chords between them. We assume the points are chosen so that no
three of the chords pass through a common point.
Find the number for n = 2, 3, 4, 5 and state a conjecture. Then find
the number for n = 6. Find a general formula.
6 General problem solving strategies: Similar
problems, working forward and backward,
interim goals
data, unknown,
conditions ? conclusion
given goal
How can I
given goal
use the given?
How can I
given goal
reach the goal?
turns out not to help then try another. For example, you first try
working forward, and if you don’t see what to do, you try working
backward. And when this has given you more understanding, you
try working forward again. Sometimes you also have more complex
solution schemes with several interim goals. For example, we could
first formulate one interim goal and then, considering how we could
reach that interim goal, formulate another interim goal.
Let us look back at some of our solutions from previous chapters
from this perspective.
J In the log cutting problem 1.1 we set the interim goal of finding
the number of pieces. This number was easy to find from the data
(the length of the log), and from there it was easy to determine the
time.
Figure 6.5 Solution scheme for solving a counting problem using a recur-
rence relation
for the mechanism that produces the zeroes (the goal) at the end
of n!.
J The indirect proof in Problem 4.6 (five points with all connections)
was a kind of working backward: Suppose the conclusion (the
goal) is wrong, what follows from this?
? Problem 6.1
A merchant has a crate of apples. A customer comes and buys half of the
apples and one extra. Then another customer comes and buys half of the
remaining apples and one extra. Then a third and a fourth and a fifth
customer come and do the same. At the end there is one apple left. How
many apples did the merchant have at the beginning?
! Solution
The simplest way to solve this is to start at the end: At the end the
merchant has one apple, so before giving the extra apple away he had
2, and before giving away the last half he had 4. So he had 4 apples
before the fifth customer came. Similarly he had 5 apples before
the fourth customer got the extra apple and before that 10. So the
merchant had 10 apples before the fourth customer came. Similarly,
22 = (10 + 1) · 2 apples before the third, 46 = (22 + 1) · 2 before the
second and 94 = (46 + 1) · 2 before the first customer. Therefore the
merchant had 94 apples at the beginning. !
This is a classic example of working backward in a finding problem.
Note that doing “first halve, then subtract one” backward means “first
6.2 The diagonal of a cuboid 143
add one, then double”. When turning things around, the order also
gets turned around. See also Exercise E 6.12.
? Problem 6.2
Find the length d of the diagonal of a cuboid with side lengths a, b, c.
c
d
C
b
A B
a
x
b
A B
a
c
d
C
x c
b
A B
a
Observation: The bottom diagonal and the space diagonal are two
sides of the triangle ACD. Let us take a close look at this triangle.
Its third side length is c. Do we know anything else? The angle
at C must be a right angle since the side CD is orthogonal to the
6.3 The problem of trapezoidal numbers 145
a a
x
b ? d b d
c c
? Problem 6.3
Which natural numbers n can be written as the sum of several consecutive
natural numbers?
1 George Pólya discusses this example at length in his classic ‘How to solve it
Investigation
G
What is given?
Only the definition of a trapezoidal number.
What are we looking for?
1. The answer to the question: Which numbers n have trapezoidal
representations?
2. A proof that our answer is correct. For the numbers that we
claim to be trapezoidal the simplest proof would be to write
down a trapezoidal representation. For the others we need to
find a proof that they are not representable in this way.
So we have both a finding problem and a proving problem.
To get a feel for the problem look at some small n.
You get Table 6.1. The numbers 1, 2, 4, 8 are not trapezoidal. This
may give you an idea:
Vague conjecture: All numbers except the powers of 2 are
trapezoidal.
The conjecture is quite vague because we have only a little data,
and because there does not seem to be a good reason why powers
of 2 should play a role for trapezoidal numbers. If you extend the
table then the conjecture holds up, but you cannot go on forever.
We need a general method.
The table also shows that a number can have several trapezoidal
6.3 The problem of trapezoidal numbers 147
n trapezoidal representations
1 none
2 none
3 1+2
4 none
5 2+3
6 1+2+3
7 3+4
8 none
9 4 + 5 or 2 + 3 + 4
happen that during the investigation we find out that it is wrong. Keep your eyes
open.
148 6 General problem solving strategies
Look again! The summands must be not only consecutive but also
positive. This is only the case if y − x−2 1 is positive. For example, if
we start with 14 = 7 · 2 then x = 7, y = 2, so y − x−2 1 = −1 and our
3 See Chapter 8 for more on divisibility and divisors.
6.3 The problem of trapezoidal numbers 149
d > 1. (6.5)
(that is, c is the bigger and d the smaller of the numbers x, y) then c, d
satisfy the conditions of (iii).
All in all, we obtain that (i) and (iv) are equivalent, as required. !
There are also other kinds of ‘figurate numbers’: maybe you have
heard of triangular numbers. These are numbers which occur as num-
bers of points in certain triangular patterns, see Figure 6.12. The nth
triangular number is 1 + 2 + · · · + n. You already know a formula for
this. Square numbers are well-known. From pentagons you get the
pentagonal numbers (look them up on Wikipedia!). Very surprisingly
they come up in the partition number problem: in how many ways
can you write a natural number n as a sum of natural numbers in
nonincreasing order? For example 4 = 3 + 1 = 2 + 2 = 2 + 1 + 1 =
1 + 1 + 1 + 1, that’s five ways for n = 4; here 3 + 1 and 1 + 3 are
considered to be the same representation. This problem is much
more difficult than the problem where 3 + 1 and 1 + 3 are counted as
different, see Exercises E 1.9 and E 5.19.5
Exercises
1 E 6.1 .Find perimeter and area of the shape in Figure 6.13 (not by
measuring, it is not drawn to scale). Which strategies do you use?
1-2 E 6.2 .You have two pots, with volumes 9 and 4 litres respectively.
Exercises 155
5 cm 6 cm
2 cm
8 cm
How can you measure precisely 6 litres? You have no tools except
for the pots and an unlimited supply of water. Formulate a suitable
interim goal. Is it useful to work backward?
E 6.7 .Starting at 1 add the natural numbers in increasing order one 2-3
by one. Is it possible to obtain a 5 digit number with all digits equal?
E 6.10 .Write 4 zeroes and 5 ones round a circle in any order. Keep 2
repeating the following step: Consider each pair of neighbouring
numbers. If they are equal, write a new one between them; if different,
156 6 General problem solving strategies
a new zero. Now delete the original (so that you are left with 9
numbers again). Can it happen that you ever get 9 ones? Can you
ever get 9 zeroes?
3-4 E 6.11 .100 cards lie in a row on the table, face down. First you turn
over the cards at positions 2,4,6,. . . Then you turn over the cards at
positions 3,6,9,. . . (so that now the card at position 6 is face down
again), then the cards at positions 4,8,12,. . . are turned etc. until in the
last round only the card at position 100 is turned over. Which cards
lie face down at the end?
7.1 Logic
J A: ‘1 + 1 = 2’
J C: ‘1 = 2’
J D: ‘5 is negative’
A B A and B A or B A⇒B ¬A
t t t t t f
t f f t f f
f t f t t t
f f f f t t
Table 7.1 Truth tables for and, or, if-then and negation. t = true, f = false
The expressions ‘for all’ and ‘there is’ (or the symbols ∀ and ∃) are
called quantifiers. Here are a few examples.
In this case the proposition is refuted by n = 0. In this book we denote the set
{0, 1, 2, . . . } by N0 .
7.1 Logic 161
everyday language this is not so: if you say “All of my houses are
built of stone” then people will believe that you own at least one
house. But logically this does not follow – the statement is true even
if you do not own any houses.
You can change the name of a variable inside a ‘for all’ or a ‘for is’
proposition without changing its truth value: instead of ‘for all n ∈ N:
n + 1 ∈ N’ you may just as well say ‘for all m ∈ N: m + 1 ∈ N’. Of
course you have to change the name at all places referred to by the
quantifier. For example, ‘for all m ∈ N: n + 1 ∈ N’ is not the same
proposition – in fact it is not even a proposition since it is unclear
what n is.
This is often useful, even necessary, in arguments where several
quantifiers occur. See the proof of the divisibility rules in Section 8.1
for an example.
In many propositions several quantifiers are combined: the every-
day wisdom ‘every pot has a lid’ can be rephrased ‘for each pot there
is a lid which fits’.
Watch out! Order matters. The proposition ‘there is a lid which fits
on every pot’ would mean something quite different. Formally you
could write the two propositions as follows (we usually leave out the
colon between quantifiers):
From two propositions A, B you can form the new proposition ‘if A
then B’, in symbols ‘ A ⇒ B’. We also say ‘ A implies B’ and call A
the premise and B the conclusion.3 The proposition ‘ A ⇒ B’ is false
3 Sometimes different words are used, for example hypothesis, assumption or
antecedent instead of premise, and consequent instead of conclusion.
162 7 Logic and proofs
raining at time t’ and ‘the street is getting wet at time t’. Then ‘ A ⇒ B’ is short for
the ‘for all’ proposition ‘ ∀t : A(t) ⇒ B(t) ’.
7.1 Logic 163
A⇒B ¬B ⇒ ¬ A ¬( A and ¬ B) .
But B(n) is not sufficient for A(n): an even number need not end in
a zero. Similarly, A(n) is not necessary for B(n). Pay attention to the
reversal of order when using ‘necessary’.
We can summarize the meaning of ‘necessary’ and ‘sufficient’ as
follows: If A(n), B(n), C (n) are predicates then A(n) ⇒ B(n) ⇒ C (n)
means that A(n) is sufficient for B(n) and that C (n) is necessary for
B ( n ).
We usually use these words when we are investigating a compli-
cated property of certain objects, and trying to find a condition which
is easy to check and which is logically related to this property.
Here is an example: Consider the following proposition A( G ) about
a graph G: ‘G can be drawn in the plane without edge intersections’.
The solution of Problem 4.6 shows that a necessary condition for
A( G ) is: G has no 5 vertices which are all joined by edges. How-
ever, this condition is not sufficient: suppose G contains 6 vertices
E1 , E2 , E3 , F1 , F2 , F3 where each Ei is joined to each Fj by an edge. Then
G does not satisfy A( G ) either, see Exercise E 4.6.5
5 Amazingly, in a sense this is all that can happen: using these two special cases
one can formulate a condition which is necessary and sufficient for A( G ). This is
Kuratowski’s theorem, see (Aigner, 1987) for example.
7.1 Logic 165
Examples
J The proposition ‘it rains every day’ is false if and only if there
is a day when it does not rain.
¬(∀n ∈ N ∃m ∈ N : m > n) ⇐⇒
∃n ∈ N ¬(∃m ∈ N : m > n) ⇐⇒
∃n ∈ N ∀m ∈ N : ¬(m > n) ⇐⇒
∃n ∈ N ∀m ∈ N : m≤n
7.2 Proofs
Example
7 See the Exercises E 1.10 and E 5.24 for other such problems.
7.2 Proofs 167
Remark
We first reformulate this to show clearly the premise and the conclu-
sion:
Claim:
Let n, m be even numbers. (premise)
Then n + m is even. (conclusion)
Proof.
Since n, m are even, there are j, k ∈ Z so that n = 2j and m = 2k (this
is the definition of ‘even’). Then n + m = 2j + 2k = 2( j + k ). We have
j + k ∈ Z. Therefore, n + m is also of the form n + m = 2q with q ∈ Z
and hence an even number. q. e. d.
11 An axiom is a proposition which is postulated to be true in a given context. For
example, one of the axioms of plane geometry is the parallel postulate: Given any
line g and any point P not lying on g there is a unique line g
which contains P and
does not intersect g. As foundation for a mathematical theory one chooses as few
axioms as possible.
7.2 Proofs 169
Proofs of formulas
Proofs of existence
Proof.
Since n is odd we can write it as n = 2m + 1 where m ∈ N0 . Then
n = ( m + 1)2 − m2 . q. e. d.
Proof analysis: We needed to supply a proof of existence for each
of the infinitely many odd numbers n. This was accomplished
by a general construction, in this case a general formula for the
two squares.
12 Idea: for x = 0 we have x5 + x = 0 < 1 and for x = 1 we have x5 + x = 2 > 1,
Investigation
G
How could we find such a point? Let us first simplify the problem:
instead of requiring the same distance from three points we content
ourselves with the same distance from two points. So we ask: Given
two points A, B in the plane, which points are the same distance
from A and from B? Maybe you remember the answer from school:
these are precisely the points on the perpendicular bisector of the line
segment AB.
How do we get from same distance from two points to same
distance from three points A, B, C?
Proof.
We give a procedure which does the following: for an arbitrary finite
set of primes it produces a prime which is not contained in this set.
Let p1 , p2 , . . . , pm be primes. Consider the number n = p1 · p2 · · · pm +
1. This is clearly bigger than each of the numbers p1 , . . . , pm . So if n
is prime then we are done.
If n is not prime then it is divisible by a prime.13 Call this prime
p. Since n is divisible by p, the number n − 1 is not divisible by p.
Therefore p1 · p2 · · · pm = n − 1 is not divisible by p, so p cannot be
one of the primes p1 , . . . , pm .
We have proved that for any finite set of primes there is another
prime not contained in the set. Therefore there are infinitely many
primes. q. e. d.
13 Why? Let p be the smallest integer which divides n and which is bigger than
1. Then p must be a prime number, since otherwise we could write p = ab with
1 < a < p, and a would divide n and would be smaller than p, contradicting the
choice of p.
14 You will find this indirect argument in many books. However, it is better to
phrase arguments in a direct way whenever possible. This makes them easier to
understand. Principle: use as few negations as possible.
7.2 Proofs 173
In each area of mathematics you will find more specific tools for
proofs of existence. For example, in analysis the intermediate value
theorem and fixed point theorems, and in linear algebra (and other
areas) dimensional arguments (a homogeneous linear system of equa-
tions with more variables than equations must have a non-trivial
solution).
We have already encountered a special type of proof of existence:
refutation by counterexample. This is a case of proof of existence by
exhibiting an object: the negation of ‘for all n ∈ N: A(n) ’ is ‘there
is an n ∈ N for which A(n) is false’, and this can be proved by
exhibiting an n for which A(n) is false.
When disproving Fermat’s conjecture that all Fermat numbers
are prime Euler used the principle ‘proof of existence by exhibiting’
twice: he exhibited the Fermat number F5 which is not prime; and
174 7 Logic and proofs
√
Theorem The number 2 is irrational.
Investigation
G
Let us
√ first see that this is a statement of nonexistence: the claim is
that 2 is √not rational, that is, that there are no natural numbers p, q
p
satisfying 2 = q .
How could we prove that? We could try a proof by contradiction:
wesuppose there were such p, q, then we try to derive more and more
consequences from this until we arrive √ at a contradiction.
p
So assume there are p, q ∈ N with 2 = q . What could we do
with this equation? Can we simplify it?
There are two complications: the fraction and the square root. So let’s
multiply by q to get rid of the fraction and then square to get rid of
the root: √ √
p
2 = ⇒ 2 q = p ⇒ 2q2 = p2 .
q
How could we continue, what can we conclude from this?
The equation 2q2 = p2 implies that p2 is even. Then p must also
be even (see below for a complete proof). We make this explicit by
writing p = 2r for some natural number r.
We square and get p2 = 4r2 . We plug this into 2q2 = p2 and obtain
2q2 = 4r2 . Now we can divide by 2 and get
q2 = 2r2 .
Proof.
We prove this indirectly. Suppose n was odd. Then we could write
n = 2m + 1 where m ∈ N0 . Then we would get n2 = (2m + 1)2 =
4m2 + 4m + 1 = 2(2m2 + 2m) + 1, so n2 would be odd. q. e. d.
√
We now prove that 2 is irrational.
Proof. √ p
Suppose 2 = q with p, q ∈ N. We may assume that the fraction is
reduced to lowest terms, so that p and q have no common factor. We
multiply by q and square to obtain 2q2 = p2 . Therefore p2 is even,
so p is even by the lemma. Write p = 2r with r ∈ N. Squaring this
and plugging in we obtain 2q2 = 4r2 , hence q2 = 2r2 . Therefore q2
is even, hence q is even by the lemma. Therefore p and q are both
even, so they have the common factor 2. This is a contradiction√to
p
the assumption that the fraction q was in lowest terms. Therefore 2
cannot be rational. q. e. d.
J Proof by contradiction
J The invariance principle (see Chapter 11)
Exercises
1-2 E 7.2 . Each of the five cards in Figure 7.1 has a letter on one side
and a number on the other side. How many cards do you need to
17 A lemma (from the Greek) is an auxiliary proposition which is used in the
proof of a theorem.
Exercises 177
B 6 7 E X
E 7.3 .Consider a colouring of the natural numbers using the colours 1-2
red and blue. Formally, this is a map f : N → {red, blue}. Also
consider the following proposition:
For each blue number there is a larger number which is red.
Which of the following propositions follow from this?
a) There is a blue natural number.
b) ∃n ∈ N : f (n) = red
c) For each red number there is a smaller number which is blue.
d) For each red number there is larger number which is red.
e) |{m ∈ N : f (m) = red}| = ∞
f) If f (1) = blue then there is n ∈ N such that f (n) = blue and
f (n + 1) = red.
1-2 E 7.8 .Formulate the proposition ‘Each person has a secret’ using
quantifiers. Here a secret is a fact that no other person knows about.
?
xy odd ⇔ x and y odd
?
xy even ⇔ x and y even
?
xy even ⇔ x or y even
x is a man. x is a mammal.
a<b ∃c ∈ R : a < c and c < b
a<b ∃c ∈ N : a < c and c < b
A figure consists of an The figure can be tiled by
even number of identical dominoes.
squares.
Exercises 179
E 7.12 .Let a, b be rational numbers satisfying a < b. Prove that there 1-2
is a rational number r such that a < r < b. Give a direct proof by
construction. (See also Exercise E 10.7 for the case where a, b are real
numbers.)
E 7.13 .Prove that among any seven numbers in {1, 2, . . . , 128} there 1-2
are x, y with x < y ≤ 2x.
Proof.
This follows directly from the definition. Let us prove a):
n| a means that there is q ∈ Z with a = qn.
a|b means that there is q
∈ Z with b = q
a.
Plugging the first equation into the second we get b = q
(qn) = (q
q)n.
Because q
q is an integer, this implies n|b. The proof of b) is similar
(exercise). q. e. d.
For example, 2 has the positive divisors 1 and 2, hence is prime, but
4 has the positive divisors 1, 2 and 4, hence is not prime. 1 has only
one positive divisor (namely 1), hence is not prime. To phrase the
definition in this way (which excludes 1 from being prime) is only a
matter of convention. We will see below that it is a useful convention,
because only then is the prime factorisation unique.
Prime numbers have the following important property.
p| ab ⇒ p| a or p|b
8.1 Divisibility, prime numbers and remainders 183
The same prime can occur multiple times. Then it appears as many
times among the pi as among the q j .
Examples: 2 = 2, 10 = 2 · 5 = 5 · 2, 999 = 3 · 3 · 3 · 37.
We have used the prime factorisation already in the solutions of
Problems 1.2 and 6.3. Only the following proof makes these solutions
complete.
Proof.
Since this is a statement about all natural numbers n > 1 it is natural
to look for an inductive proof. Try it yourself first!
a = qn + r and 0 ≤ r < n .
Proof.
Initial ideas: How do you think about division with remainder?
Maybe like this: You take as many n as you can fit into a; there are q
of them, and what remains is the remainder r. The remainder is less
than n because otherwise another n would fit into a. Therefore q and
r exist. They are unique, for if we used another q then the remainder
would be negative or bigger than n.
Now we just need to express this in mathematical notation. Try it
yourself!
Proof analysis: The theorem has two parts: Existence (“there are”)
and uniqueness (“unique”) of q, r. For the proof of existence
we gave a way to construct q, r. To prove the property r < n we
used an indirect proof.
Here it was natural to construct the number q using an extremal
property (the largest integer satisfying qn ≤ a). We will develop
this idea systematically in Chapter 10.
The proof of uniqueness is the direct translation of the initial
ideas into mathematical language. This was also an indirect
proof: We excluded the possibility of another representation
than the one we first constructed.
186 8 Elementary number theory
Example
? Problem 8.1
! Solution
a) After every 24 hours (one day) it will be the same time of day. So
we need to find the remainder of 11 + 40 = 51 modulo 24. That’s
three. The answer is 3 o’clock.
b) January has 31 days, so we have to advance by 31 days to get from
January 18 to February 18. After every 7 days (one week) it will be
the same day of the week. The remainder of 31 modulo 7 is 3, so
February 18 is a (Wednesday+3) = Saturday. !
8.2 Congruences
Dividing the integers into evens and odd numbers is useful for many
mathematical arguments.
√ You saw examples of this in Problem 6.3
and in the proof that 2 is irrational in Section 7.2.
Even numbers leave the remainder 0 modulo 2, odd numbers leave
the remainder 1. Instead of using remainders modulo 2 we could
2 Initially you probably thought about a > 0. Convince yourself that the proof is
Proof.
Let a, b ∈ Z and n ∈ N. Write (division by n with remainder)
a = qn + r, b = pn + s (8.1)
a≡b mod n
Example
of two figures in the plane or in space, which means that one figure can be turned
into the other by means of a translation, rotation or reflection.
8.2 Congruences 189
a≡b mod n
c≡d mod n
then
a+c ≡ b+d mod n
a−c ≡ b−d mod n
ac ≡ bd mod n
ak ≡ bk mod n
for all k ∈ N.
n| a − b, n|c − d ⇒ n|( a − b) + (c − d) = ( a + c) − (b + d)
which gives the first claim, and the second claim follows similarly.
Now try to find a proof of the third claim (multiplication) yourself!
ac − bd = ac − bc + bc − bd = ( a − b)c + b(c − d) .
n divides
n dvides
( a − b)c n divides
a−b
and ac − bd
and c − d
b(c − d) goal
given
connector
Proof analysis: This was a direct proof, and the main point was
skilful calculations.
The transformations used in the proof for multiplication seem
difficult to find. How on earth can you get this idea? This is
a typical problem-solving situation. What is our goal? That
ac − bd is divisible by n. What is given? That a − b and c − d
are divisible by n. In short: Goal: ac − bd. Data: a − b, c − d.
How can we connect the goal with the data? The expression
ac − bd looks complicated, so let’s begin with one part of it, the
term ac. How can we connect this with the data? One way
to do this is through the expression ( a − b)c = ac − bc since
it has both a − b and ac in it. What do we need to get from
here to our goal? To get from ac − bc to ac − bd we need to
add bc − bd, which equals b(c − d). Summarizing, we have
ac − bd = ( a − b)c + b(c − d). Figure 8.1 shows the solution
scheme; it is an example of the general scheme in Figure 6.4.5
5 This
type of calculation, which is also called “clever addition of zero” (because
we added 0 = −bc + bc between ac and bd) can be found in various places in
mathematics. For example, in analysis, we add a clever form of zero when proving
that the product of two convergent sequences converges to the product of their
limits.
Exercises 191
Examples
So the remainder is 1.
J What is the last digit of the number 777 ? The last digit of
a natural number (in the decimal system) is its remainder
modulo 10. Let us try smaller exponents first: 72 = 49 ≡
9 ≡ −1 mod 10. This is easy to exponentiate, for example
776 = 72·38 = (72 )38 ≡ (−1)38 = 1 mod 7, hence
Exercises
E 8.1 .If January 18, 2012 is a Wednesday, which day of the week is 1
January 18, 2013? Formulate your solution using congruences. (Note
that 2012 is a leap year.)
E 8.2 .Explain how the well-known rule “even + even = even” can 1
be reduced to the equation 0 + 0 = 0 using congruences. Which
equations correspond to the rules “even + odd = odd”, “odd·odd =
odd” etc.?
192 8 Elementary number theory
2 E 8.4 .We write lg 2 for the logarithm of 2 to the base 10, that is, the
number which satisfies 10lg 2 = 2. Prove that lg 2 is irrational.
3-4 E 8.8 .Find more divisibility rules in the decimal system, for example
for division by 13 or 17. Find a divisibility rule for division by 7 in
the octal number system (number system with base 8).
a b
a≡b mod n ⇒ ≡ mod n, if n, c are coprime.
c c
Proof. “Proof”
In order to prove the claim, we show
∀k ∈ N : 6k ≡ 6 (mod 10).
62 = 36 ≡ 6 (mod 10).
Pigeonhole principle
So instead of pigeons you may think of envelopes if you wish. But it’s more fun to
think of birds, so we will stick to the original meaning.
Proof.
If each hole contained at most one pigeon then there would be at
most n pigeons in total. q. e. d.
If you replace pigeons and holes suitably then you get interesting
facts.
Examples
J Among any three people there are two of the same sex.
(pigeons: people; holes: sexes)
2 For this you need to know: 1. Every human has at most 300,000 hairs on
his head (usually it’s about 150,000). 2. the city of Liverpool has about 466,000
inhabitants (data from 2013).
9.1 The pigeonhole principle, first examples 197
Proof.
If each hole contained at most a pigeons then there would be at most
an pigeons in total. q. e. d.
Examples
? Problem 9.1
Some people are in a room. Show that there are two among them who are
acquainted with the same number of people in the room.4
3 By the 2011 census England has about 53,000,000 inhabitants.
4 We assume that the ‘acquaintance’ relation is symmetric, that is: if A is ac-
quainted with B then B is acquainted with A.
198 9 The pigeonhole principle
Investigation
G
Let n ≥ 2 be the number of people in the room. The statement
‘there are two . . . ’ suggests that we use the pigeonhole principle.
What could be the pigeons, what the holes? We want to prove
the existence of two people, the relevant property is the number of
acquaintances. So the pigeons should be the people, the holes the
possible numbers.
Which holes are there? A person in the room can have 0, 1, . . . , or
n − 1 acquaintances in the room. These numbers are the holes.
So we have n pigeons and n holes. The pigeonhole principle is not
applicable. What now?
Look again: if one person knows everyone else (thus has n − 1
acquaintances) then there can be no person having 0 acquaintances.
So either hole 0 or hole n − 1 is empty.
Therefore only n − 1 holes can be used, so one of them must contain
2 pigeons. G
You could write this up as follows:
Remark
? Problem 9.2
Given 10 natural numbers, show that there are two among them whose
difference is divisible by 9.
The goal is divisibility by 9, this suggests that we use remainders
modulo 9 as holes.
! Solution
There are 9 possible remainders when dividing by 9: 0, 1, . . . , 8. There-
fore two of the 10 given numbers have the same remainder modulo 9.
Their difference is divisible by 9. !
The analogous statement with 10 replacing 9 would be: among 11
natural numbers there are two that end in the same digit. This is
obvious: there are only 10 possible digits. Note that the last digit is
the remainder modulo 10.
The pigeonhole principle can also be useful for proving the exis-
tence of a single object with certain properties:
? Problem 9.3
Prove that among the powers 7, 72 , 73 , . . . there is one ending in 001.
Investigation
G
What are we looking for? Three final digits. That’s the same as
the remainder modulo 1000. So we could try to use the pigeonhole
principle where the holes are the remainders modulo 1000. What
should be the pigeons? The objects whose existence we want to
prove: the powers of 7. So we get two powers of 7 having the same
remainder modulo 1000. How can we use this for the problem?
The proof shows that among the numbers 7, 72 , . . . , 71000 there must
already be one ending in 001.
An analogous statement holds for any number other than 7 which
is not divisible by either 2 or 5. And instead of 001 we can require n
zeroes followed by 1, for any n. The proof is the same.
Your first reaction might be: what a strange question, of course any
real number a can be approximated arbitrarily well by fractions:6 Just
cut off the decimal representation of a after a few digits. For example,
π = 3.1415 . . . can be approximated by 3.141 = 3141/1000 with an error
of 0.0005 . . . . If you want a better approximation then simply use
more digits.7
We could stop here: problem solved, exploration finished. Or
we could try to discover more, taking our vague question only as a
starting point.
Let us stick to the example π = 3.1415926 . . . . If the fraction m/n is
to be close to π then nπ should be close to an integer. So let us look
at some multiples of π and their distance to the nearest integer, see
Table 9.1:
Surprise: 7π is much closer to an integer (22) than all the other
listed multiples of π. So 22/7 will be a very good approximation of
π, considering that the denominator is quite small. We calculate
22/7 = 3.142 . . . and see that the error is about 0.001. Compare this
with our first idea of cutting off the decimal expansion. Table 9.2
shows some of these fractions and their approximation errors. It also
shows another very good approximation, 355/133. What is remarkable
about this table? The fractions 22/7 and 314/100 approximate π about
equally well, but 22/7 has a much smaller numerator and denominator.
pigeonhole principle? Just wait. Let the question, not the method, be our guide.
202 9 The pigeonhole principle
n nπ (rounded) distance
1 3.14 0.14
2 6.28 0.28
3 9.42 0.42
4 12.57 0.43
5 15.71 0.29
6 18.85 0.15
7 21.99 0.01
8 23.13 0.13
9 28.27 0.27
10 31.42 0.42
fraction error
31/10 = 3.1 0.04 . . .
314/100 = 3.14 0.001 . . .
3141/1000 = 3.141 0.0005 . . .
22/7 = 3.1428 . . . 0.001 . . .
355/113 = 3.1415929 . . . 0.0000003 . . .
9 This is not so easy to prove. See (Hardy and Wright, 2008) for example.
10 The Greek letters ε, δ (epsilon and delta) are frequently used in mathematics
for small positive numbers.
204 9 The pigeonhole principle
a
0 1 2 m m +1
n n n n
m
Figure 9.1 Approximation of a by the fraction n
smaller than 1/14 and 1/226, respectively. Can we find such especially
good approximations for any a? How good can they possibly be?
We found the good approximation 22/7 of π by considering the dis-
tance of nπ to the nearest integer. So let us investigate this in general:
how small can we make this distance when we allow numbers n up
to a certain size?
? Problem 9.4
Let N ∈ N. Find the smallest number δ, depending on N, having the
following property: for any real number a > 0 at least one of the numbers
a, 2a, . . . , Na lies within distance δ of an integer.
9.3 An exploration: approximation by fractions 205
Investigation
G
We need to understand the problem well. The statement is quite
complicated: . . . smallest . . . any . . . at least one . . . . Look at each
of these words to understand what we are looking for. Consider
some examples of a and N and find the best possible δ.
We look at a special case: what is the answer for N = 1? For which
δ is it true that any a lies within δ of an integer?
Clearly this is true for δ = 1/2 but not for smaller values of δ (take
a = 1/2). So the answer for N = 1 is δ = 1/2.
How about N = 2? Now we need to consider both a and 2a. Play
with this, try out different a, try to construct the worst case.
0 1 2 1
3 3
But if the distance between frac(2a) and frac( a) is at most 1/3 then
2a − a = a must lie within 1/3 of an integer, so frac( a) would lie in
one of the outer thirds. Contradiction!
We need to check something here: is it true that the distance from
b − a to the nearest integer is at most | frac(b) − frac( a)|? (In our
case b = 2a.) This looks reasonable, but let’s postpone the details
and first consider general N.
Try to generalize the argument to general N. What could be the
optimal δ? How could you prove that? If you are not ready for the
general case yet, try N = 3 first.
12 In fact it is less than 1/3, but this does not matter for the proof.
9.3 An exploration: approximation by fractions 207
Proof.
Write x = x + frac( x ), y = y + frac(y). Then
The first parenthesis on the right is an integer, the second one has
absolute value less than or equal to δ by assumption. The lemma
follows. q. e. d.
Proof.
For a = N1+1 we get the numbers N1+1 , . . . , NN+1 . Each of them differs
by at least N1+1 from the nearest integer. Therefore we must have
δ ≥ N1+1 .
Now let δ = N1+1 . Let a > 0 be arbitrary. We show that at least one
of the numbers a, 2a, . . . , Na lies within δ of an integer. Consider the
N + 1 intervals13
Each interval has length δ, including the last one since 1 = ( N + 1)δ.
Suppose none of the numbers na, n = 1, 2, . . . , N lies within δ of
an integer. Then none of the numbers frac(na) lies in I0 or in IN .
Therefore, all of these N numbers lie in the remaining N − 1 inter-
vals. By the pigeonhole principle at least two of them, say frac(ka)
and frac(la) with k > l, must lie in the same interval. This im-
plies | frac(ka) − frac(la)| ≤ δ. Then the lemma implies that ka − la
lies within δ of an integer. Now k, l ∈ {1, . . . , N }, k > l imply
k − l ∈ {1, . . . , N − 1}, so ka − la = (k − l ) a is one of the numbers
a, 2a, . . . , Na. This contradicts our assumption. Therefore the assump-
tion was wrong and the claim is proven. q. e. d.
!
Proof analysis: The proof that δ = N1+1 works was a proof
by contradiction: the assumption that the claim is wrong for
some a led to a contradiction. The pigeonhole principle could
be applied since from two numbers in the same ‘hole’ a new
number (their difference) could be constructed, which provided
the contradiction.
In order to show that smaller values of δ don’t work it sufficed
to give an example a. (Recall that the negation of a ‘for all’
proposition is a ‘there exists’ proposition.)
matters is that their union contains the interval [0, 1), the set of possible values of
frac( a).
9.3 An exploration: approximation by fractions 209
know that ε = 2n 1
always works, for any n; but we are aiming for
much smaller ε, generalizing the example of a = π and mn = 22 7 . We
begin by restating the solution of Problem 9.4 as follows: Let a > 0.
14
But this isn’t quite what we wanted either, since all we know is that
there is some n (and then a corresponding m) for which this inequality
is true. If n was, say, 2 then that’s not a very good approximation!
However, there is a better way to use (9.1), which yields:
Proof.
We show that given any finite set of fractions there is another fraction
which is not in the set and which satisfies inequality (9.2). Starting
with the empty set we get arbitrarily many fractions satisfying the
inequality. Therefore there cannot be only a finite number of them.
Thus, let M be a finite set of fractions. For each of these fractions
n consider the number | na − m |. It is positive, not zero, since a is
m
|n
a − m
| < δ0 , hence ∈ M by definition
n
of δ0 . Second, we divide
m
by n
,
and using n
≤ N we get a − n
≤ n
(n1
+1) , which was to be
shown. q. e. d.
What does the theorem buy us? First, note that for each n ≥ 2
there can be at most one m satisfying (9.2) (why?). Therefore, the
theorem implies that the estimate is true for infinitely many n, hence
for any given ε > 0 we can find such n with n(n1+1) < ε, and then
Approx( a, n, ε) holds.
But there is much more to it: the estimate (9.2) is much better than
the approximation obtained by cutting off the decimal expansion.
If you cut off after the kth digit after the decimal point, then the
approximating fraction has the form 10mk , and the error is at least 101k+1
unless the (k + 1)st digit happens to be zero. So here we have n = 10k ,
1
and the error is of the order of 10n . For k > 1 this is much bigger than
1
the error n(n+1) in (9.2): The former has denominator linear in n and
the latter quadratic.
J The statement of our last theorem also holds for rational a but
p
is uninteresting then: write a = q and choose m = kp, n = kq
for k = 1, 2, . . . . However, the question of good approximation by
fractions with small denominators remains interesting for rational
numbers, as we saw. The theory of continued fractions gives
an effective algorithm for finding such fractions (in the case of
rational or irrational a). See for example (Hardy and Wright, 2008)
or (Silverman, 2012).
J The approximation (9.1) and the subsequent theorem hold for all
a > 0. However, for certain numbers a there are much better ap-
proximations. For example, for some a the error n(n1+1) in (9.2) can
be replaced by n13 , which means a much better approximation for
large n. On the other hand it is known that such an improvement
9.3 An exploration: approximation by fractions 211
√
1+ 5
is not possible for the golden ratio, a = 2 . So this number is
only badly approximable.
This circle of questions is called diophantine approximation. It
plays an important role in the theory of dynamical systems. For
example, around 1900 Poincaré was led to such questions when
investigating the motion of the planets.
J The gap problem: The fact stated in Problem 9.4 has other inter-
esting consequences. Consider Figure 9.3. A goblin walks on a
circular path of length 1 with constant step size a. There is a gap
in the path of length ε > 0. Then the following is true: if a is
irrational then the goblin will fall into the gap at some point – no
matter how small ε is and where he starts.15
ε
a
Figure 9.3 If a is irrational then the goblin will fall into the gap eventually
Proof.
Mark the starting point by 0 and measure lengths in the walking di-
rection. Since the path has length 1 the steps are at frac( a), frac(2a),
frac(3a), . . . . Choose N ∈ N satisfying N1 < ε. By Problem 9.4
there is an n ≤ N such that frac(na) < N1 or frac(na) > 1 − N1 . We
consider the first case, the argument in the second case is similar.
Let b = frac(na). Since a is irrational we have b > 0. The first n
steps move the goblin from 0 to b. After another n steps it will
have moved to 2b, after the next n steps to 3b etc. Now |b| < N1 < ε,
so one these numbers b, 2b, . . . falls into the gap. q. e. d.
? Problem 9.5
Prove that among any 6 people there are 3 who know each other or 3 who
don’t know each other.
Play with this to see it is actually true. Try to prove it. Hint: Look
at all the edges emanating from one vertex. What can you say about
them?
Does this also work with 5 vertices (people)? No: draw all outer
edges of a pentagon red and all diagonals green. Then there is no
monochromatic triangle.
Let us generalize the question: is it true that among sufficiently
many people there must be 4 who know each other, or 4 who don’t
know each other (i.e. none of the 4 knows any other)? In the lan-
guage of graphs this would correspond to 4 vertices so that all 6
edges between them have the same colour. We call this a complete
monochromatic quadrilateral.
It is a little simpler to first consider an intermediate case: colour all
edges between 10 vertices red or green. Then there is a red triangle
or a complete green quadrilateral. Prove this!
Is 10 the smallest number for which this is true? No. It turns out
that 9 also works, but this is a little harder to prove. For 8 vertices
this is not true. We symbolise this fact by the equation R(3, 4) = 9
and say that 9 is the 3,4-Ramsey number. Similarly, we showed that
R(3, 3) = 6. The higher Ramsey numbers are difficult to find precisely,
for example, R(5, 5) is not known.
214 9 The pigeonhole principle
9.5 Toolbox
Exercises
1 E 9.1 .At least how many children must be in a room so you can be
sure that three of them have their birthday in the same month?
1 E 9.2 .
a) There are five pairs of green socks and five pairs of red socks in a
drawer. You cannot tell left socks from right socks. At least how
many socks do you need to take blindly out of the drawer (without
putting them back) if you want to be sure to have a matching pair?
b) In a shoe cabinet there are 10 different pairs of shoes. At least how
many shoes do you need to take blindly out of the cabinet (without
putting them back) if you want to be sure to have a matching pair?
How many do you need to take if you have five identical brown
pairs and five identical black pairs?
Exercises 215
E 9.3 . Suppose you walk around on a field of snow. Prove that 1-2
at some point you have to step into your own footsteps (at least
partially). How soon will this happen? Which quantities do you need,
to find a number of steps by which you will certainly have done this?
E 9.4 .Prove using the pigeonhole principle: Let a triangle and a line 1-2
be given. Then the line intersects at most two sides of the triangle.
E 9.6 . In Figure 9.4 there are three monochromatic triangles, not 2-3
just one. Is this always the case? Or else are there always at least two
such triangles?
E 9.9 . Prove that among any 52 different numbers from the set 2-3
{0, . . . , 99} there must be two whose sum is 100.
E 9.10 . Prove that among any 52 natural numbers there are two 3
whose sum or difference is a multiple of 100. (Note that 0 is also a
multiple of 100.)
16 The slope of a ray starting at zero is defined as b/a if ( a, b ) is any point on the
ray except the origin. For vertical rays the slope is defined to be ∞. For the purposes
of this problem we count ∞ as rational.
216 9 The pigeonhole principle
b) If each tree has thickness ε > 0 then we will see a tree in every
direction. That is, every ray starting at the origin hits a tree, no
matter how small ε is.
c) Find a value dε , depending on ε, for which you can be sure that in
b) you will see a tree in every direction at distance at most dε .
2 E 9.12 . What is the largest number of lattice points which you can
choose to satisfy the following condition: the midpoint between any
two of the chosen points is not a lattice point.
E 9.17 .Suppose 101 distinct numbers are written in a row (they do 3-4
not need to be ordered by size). Prove that you can delete 90 of these
numbers so that the remaining 11 numbers form either an increasing
or a decreasing sequence.
1 Da aber die Gestalt des ganzen Universums höchst vollkommen ist, entworfen
vom weisesten Schöpfer, so geschieht in der Welt nichts, ohne dass sich irgendwie
eine Maximums- oder Minimumsregel zeigt.
For example, the shortest path between two points is a straight line
(structure: no curves), the body of agiven volume with the smallest
surface area is the ball (structure: perfect symmetry), and beautiful
regular crystals appear when molecular configurations attain a state
of minimal energy.
We now look at some examples in more detail.
? Problem 10.1
Among all rectangles with perimeter 20 cm, which one has the largest area?
a b ab
1 9 9
2 8 16
3 7 21
4 6 24
5 5 25
Review
The first thing you may have tried is eliminating b by writing b =
10 − a. Then you need to minimize a(10 − a) = 10a − a2 . It is not
obvious how to proceed. One way would be to complete the square:
? Problem 10.2
Which number between 0 and 2 minimizes the sum of the squares of its
distances to 0 and to 2?
! Solution
If we call the number a then the two distances are a and 2 − a, so we
want to minimize a2 + (1 − a)2 . Recalling the previous solution we
look at the deviation from the center, i.e. we write a = 1 − x. Then
2 − a = 1 + x, so
a2 + (2 − a )2 = (1 − x )2 + (1 + x )2 =
1 − 2x + x2 + 1 + 2x + x2 = 2 + 2x2 .
√ a+b
We call ab the geometric mean, the arithmetic mean and
2
a2 + b2
2 the quadratic mean of a and b. See Exercise E 10.4 for the
significance of these means. There is a similar inequality for more
than two numbers, see Exercise E 10.20.
Proof.
a+b b− a
Let c = 2 and x = 2 . Then a = c − x, b = c + x, so ab = c2 − x2
hence ab ≤ c2 ≤ a +2 b . Now take square
2 2
and a2 + b2 = 2c2 + 2x2 ,
roots. Equality holds if and only if x = 0, i.e. a = b. q. e. d.
Shortest paths
Everyone knows that the shortest path between two points is the
straight line. Actually this is not easy to prove rigorously. But here
we will take it for granted. A special case of this is:2
? Problem 10.3
Let a line g and two points A, B lying on the same side of g be given. How
do you determine a point C on g for which the sum of distances from A to
C and from C to B is minimal? See Figure 10.1.
224 10 The extremal principle
B
A
g
C
Figure 10.1 The problem of the shortest path touching the line g
Think about it. Then look at the following solution, which is beautiful
and ingenious. Put it in your bag of tricks.
! Solution
Reflect B across the line g. Let B
be the mirror point. Draw the
straight line from A to B
. It intersects g at a point C.
How do you proceed from here? Make a sketch.
Remark
Other extremes
3 With real billiards you need to take into account that the balls are not points.
226 10 The extremal principle
B
A
D g
C
B
A
α β g
C β
Therefore you should reflect along a line which is on the table parallel to the cushion
at distance one ball radius. Also you need to take into account that the ball will
slightly dent the cushion, which has the effect that the angle of reflection is slightly
bigger than the angle of incidence. This effect increases with ball speed.
10.2 The extremal principle as problem solving strategy, I 227
? Problem 10.4
In a tournament every player plays against every other player once. There
are no draws. At the end every player makes a list containing the names of
all players he defeated, and also of all the players defeated by a player whom
he defeated.
Show that there is a player whose list contains the names of all other
players.
b
c
there is only one such player. But several players could have the same maximal
number of victories, as in Figure 10.4, where both a and b have won twice.
10.2 The extremal principle as problem solving strategy, I 229
Example
1. Every finite set of real numbers has a largest and a smallest element.
Remark
The second fact is also true for infinite sets of natural numbers,
but not necessarily for infinite sets of positive real numbers. For
example, the set { x ∈ R : x > 0} does not have a smallest
element.
See Section 10.4 (after Problem 10.8) for more on the question of
existence of extrema.
? Problem 10.5
We are given 2n points in the plane: n farms and n wells. We assume that
no three of the points lie on a line. Is it possible to assign a well to each
farm in such a way that each well belongs to only one farm and the straight
paths from each farm to its well do not intersect?
Figure 10.5 The first and third assignment of wells to farms are admissible,
the others are not. Farms are squares and wells are circles. Assignments are
indicated using line segments.
10.2 The extremal principle as problem solving strategy, I 231
Investigation
G
Let us call an assignment of wells to farms admissible if it satisfies
the conditions, i.e. if it is bijective and intersection-free. Figure 10.5
shows a few examples with n = 2. These are deceptively simple.
For large n things could look quite complicated. If you try a
few more examples you will notice that an admissible assignment
seems to always exist. So we formulate:
Conjecture: There is always an admissible assignment.
How could we prove this? The difficulty is that there are so many
possibilities for the positions of farms and wells. As a first idea we
could put ourselves in the position of a farmer:
First attempt: To each farm assign the well which is closest.
If the farms lie as in the first picture in Figure 10.5 then both
farms get the same well (second picture), so the assignment is not
bijective.
So that didn’t work: it was too short-sighted to take the individual
points of view of each farmer as a basis. We should keep in mind
the total configuration.
Let us try to use the extremal principle. Let us make a plan. What
are we looking for? Among all bijective assignments we are looking
for one without intersections. It is natural to try the following.
Second attempt: Consider a bijective assignment with the minimal
number of intersections.6
This seems promising since for a solution of the problem this
number must be zero, hence minimal.
We want to prove: If A is a bijective assignment with minimal
number of intersections, then A has no intersection. To prove this,
we assume that A has an intersection. Then there would be two
farms and wells with assignments as in Figure 10.6 (solid lines;
there could be more farms and wells which are not drawn). We
want to change this to a different bijective assignment B having
fewer intersections than A. How could we do this?
f2
f1
w2 w1
Figure 10.6 A simple idea for reducing the number of intersections. Here
farms and wells are represented by dots.
The left-hand picture in Figure 10.7 shows that this is not necessar-
ily true. In this example, while removing the intersection S (using
the dashed lines) we produce a new intersection T. So B has the
same number of intersections as A has. Even worse, you can easily
modify the example so that B has more intersections than A.
f2 f2
f1 f1
S f3 S f3
w3 w3
T
w2 w1 w2 w1
Figure 10.7 A problem with the second attempt and a solution for this
example
10.2 The extremal principle as problem solving strategy, I 233
Suppose this was not the case. Then there would be wells w1 , w2
assigned to farms f 1 , f 2 , respectively, so that the line segment f 1 w1
intersects the line segment f 2 w2 . Let S be the point of intersection. So
we have a situation as in Figure 10.6, since no three points lie on a
line. We didn’t draw the other farms and wells.
Claim: Let B assign the well w2 to the farm f 1 and the well w1
to the farm f 2 (dashed lines) and leave the assignments of all
other wells to their farms as in A. Then B has a smaller sum of
distances than A.
This would be a contradiction to the minimality of A. Therefore A is
admissible.
It remains to prove the claim. Since all other assignments stay the
same, it suffices to show that the two dashed lines together are shorter
than the two solid lines together:
!
( f 1 w2 ) + ( f 2 w1 ) < ( f 1 w1 ) + ( f 2 w2 ) (∗)
where ( PQ) denotes the length of the line segment from a point P
to a point Q. To prove (∗) we use the triangle inequality, applied to
the triangles w2 S f 1 and w1 f 2 S:
( f 1 w2 ) < ( f 1 S) + (Sw2 ), ( f 2 w1 ) < ( f 2 S) + (Sw1 ).
Adding these inequalities we obtain the left hand side of (∗) on the
left, and on the right
( f 1 S) + (Sw2 ) + ( f 2 S) + (Sw1 ) = ( f 1 w1 ) + ( f 2 w2 ),
that is, the right hand side of (∗), where we used ( f 1 S) + (Sw1 ) =
( f 1 w1 ) and ( f 2 S) + (Sw2 ) = ( f 2 w2 ). !
Review of Problem 10.5
J The idea of minimising the natural quantity q( A) = (number of
intersections for the assignment A) did not lead to a proof. This
may seem paradoxical since we know that this number is minimal
for the assignment we are looking for. However, at this point in
the argument we do not know yet that there is an intersection-free
assignment; this is only a conjecture. It could have turned out that
the conjecture was wrong, i.e. that there is a configuration of farms
and wells for which every bijective assignment has intersections.
10.2 The extremal principle as problem solving strategy, I 235
We saw that the extremal principle can be a tool for proofs of existence.
But considering extremes can also be useful as a more general idea.
? Problem 10.6
1000 numbers are written along the perimeter of a circle. Each number is
the average of its two neighbours. Show that all numbers are equal.
10.3 The extremal principle as problem solving strategy, II 237
The two solutions are very similar; it almost seems as if the second is
a rephrasing of the first. This is not so: the second solution, using the
extremal principle, can be generalised to a two-dimensional version
of the problem, but the first can’t. See Exercise E 10.14.
238 10 The extremal principle
Infinite descent
? Problem 10.7
Can three times a square number equal the sum of two square numbers?
Investigation
G
The question is: Are there natural numbers a, b, c satisfying
3a2 = b2 + c2 ?
√
Maybe the problem reminds you of the proof that 2 is irrational,
see Section 7.2. There we had to prove that the equation 2q2 = p2
has no solution in natural numbers.
We don’t know yet whether √ our problem has a solution. If we
could argue as we did for 2 then we might be able to prove that
there is no solution. Try it!
How did we proceed with the equation 2q2 = p2 ? We first showed
that p is even, using that 2q2 and hence p2 is even.
In our problem we have a 3, not a 2, so we might try to argue with
divisibility by 3, not 2.
So let us suppose we had a solution of 3a2 = b2 + c2 . Then b2 + c2 is
divisible by 3. Unfortunately we cannot conclude from this directly
that b or c are divisible by 3. How to go on?
The generalisation of even/odd is the remainders modulo 3, see
Chapter 8. Let us check the possible remainders modulo 3 of b and
10.3 The extremal principle as problem solving strategy, II 239
3A2 = B2 + C2 .
How can we use this? This is the same equation as the one we
started with. But A is smaller than a (since a = 3A), and similarly
for B, C. This easily leads to a contradiction, see below. G
In this section you will find more examples and a more extensive
discussion of shortest paths. Even if you don’t understand all of the
words in the explanations that follow, keep reading anyway. You will
be astonished how universal the extremal principle is.
In the books (Nahin, 2004) and (Hildebrandt and Tromba, 1996)
you will find more information about many of these topics and their
history.
10.4 Going further 241
Optimisation problems
it out carefully you will see a soap film, and this will be a surface of minimal area.
242 10 The extremal principle
In this way the ball will pick up more speed in the beginning and
arrive sooner than for the straight track, although its path is longer.
What is the precise shape of the optimal track? To answer this you
need to know differential equations. The best curve is called the
brachistochrone. This sort of optimisation problem, where we are
looking for a curve, not a number, is called a variational problem.
J Proving the mean value theorem using the extreme value theorem
(analysis).
J Zorn’s lemma, which can be used to prove that every vector space
has a basis, or to prove the Hahn-Banach theorem and many
other important theorems (linear algebra, functional analysis, etc.).
Keep your eyes open; you will find many more examples!
Another beautiful example is the rainbow: Why are there rainbows,
why are they circular arcs, and how can you calculate their position?
This also amounts to solving an extremal problem (see (Nahin, 2004)).
244 10 The extremal principle
B
A
b
a
α β g
P x C d−x Q
Figure 10.8 Notation for the calculus solution of Problem 10.3; C is not the
minimum in the picture
c
B
A
β
α
C
Figure 10.9 Reflection in a curved mirror; α, β are the angles with the
tangent line of the curve c in the point C
as follows:
? Problem 10.8
Let c be a curve and let A, B be two points lying on the same side of c. Does
it follow that there is a point C for which the angles α and β are equal?
So we want to send a billiard ball from A to B via the cushion c. Is
that possible?
! Solution
14 Pierre de Fermat, 17th century. The principle was generalised in the 18th and
19th century by Euler, Lagrange, Maupertuis and Hamilton to the ‘principle of
least action’, which aims to describe all physical processes in a similar way.
15 This is the version for homogeneous media, where the speed of light is constant.
If you replace the length of the path by the time of travel then this still holds for
inhomogeneous media. If you apply this to the transition between two media then
you get the law of refraction (Snell’s law).
10.5 Toolbox 247
10.5 Toolbox
Exercises
1 E 10.1 .Choose a natural number bigger than two. Take its square
root and round it down, then take the square root again and round
it down etc. Show that at some point you will obtain 2 or 3. How is
this related to the extremal principle?
1-2 E 10.2 . Suppose the product of two positive real numbers is 20.
What is the smallest possible value for their sum? What is the largest?
1-2 E 10.3 .In Problem 10.2 replace the squares of the distances by the
reciprocals of the distances and solve the problem.
2 E 10.5 .In Problem 10.4 we looked at a player who has won the most
games, and this led to a solution. Instead we could have looked at a
player with the longest list. Can you find a solution of the problem
from here?
1-2 E 10.6 .Does the argument in the solution of Problem 10.5 also work
if you use q( A) = (the biggest distance from a farm to a well) instead
of the sum of distances?
assume that one vertex of the triangle is the origin and one vertex lies
on the positive x axis, so A = (0, 0), B = (b, 0) where b > 0. Let the
third vertexbe C = ( x, y), y = 0. Then
the side lengths are ( AB) = b,
( AC ) = x2 + y2 and ( BC )= ( x − b)2 + y
2 by Pythagoras’
E 10.9 .Prove that every triangulation of a convex n-gon (see Prob- 2-3
lem 2.4) has a boundary triangle, i.e. a triangle whose vertices are
successive vertices of the n-gon.
E 10.10 . Can five times a square be the sum of two squares? How 2
about seven times a square?
E 10.12 .Show that the equation 4x4 + 2y4 = z4 has no integer solution 2-3
except x = y = z = 0.
E 10.13 .Is there a square number which lies in the middle between 2
two other square numbers?
E 10.14 . 2
E 10.15 . Let a graph be given. A black and white colouring of its 2-3
vertices is called desegregated if each white vertex has at least as many
black neighbours as white neighbours, and vice versa.
Prove that there is a desegregated colouring of the vertices.
250 10 The extremal principle
P
Perpendicular does not hit interior of side
3-4 E 10.18 .Several barrels of petrol are arranged along a circular track.
The barrels may be filled to different levels, and may be positioned at
irregular intervals. Suppose the total amount of petrol in the barrels
suffices for a car to go around the track once.
You have a car but no petrol to start with. However, you may choose
the barrel at which you start your journey. Can you choose the place
in such a way that you can go full circle, filling up at each barrel
when you reach it?
3-4 E 10.19 .Suppose in a group of 100 people each person knows at least
50 other people. Prove that it is possible to seat the people around
a circular table in such a way that everyone knows his or her two
neighbours.
3-4 E 10.20 . The general inequality of the geometric, arithmetic and
quadratic mean says: Let n ∈ N and a1 , . . . , an ≥ 0. Then
√ a1 + · · · + a n a21 + · · · + a2n
n
a1 · · · · · a n ≤ ≤ ,
n n
Exercises 251
E 10.23 .Prove that the equilateral triangle has the largest area among 3-4
all triangles of a given perimeter.
E 10.24 .Suppose you are given a finite number of points in the plane, 4
not all on a line. Is there always a line which contains precisely two
of the points?
B C
16 We assume that the billiard ball is a point. The claim remains true for ‘real’
billiard balls, if their radius is smaller than the smallest radius of curvature of the
boundary. Also we assume there is no friction.
11 The invariance principle
? Problem 11.1
Two joggers A and B run on a straight track. B starts one metre ahead of
A. They run at the same speed.
Show that A can never catch up with B.
! Solution
Since A and B have the same speed their distance is constant. Since it
is positive at the beginning it will always be positive. !
1 invariant = not changing
A B A B
initial position later
position
? Problem 11.2
You have a board composed of 6 × 6 squares. A coin lies on the lower left
corner square. In one move the coin can be moved from its present square
to one of the squares diagonally adjacent to it.
Show that the coin can never get into the lower right corner square, no
matter how long you play.
! Solution
Colour the squares black and white as on a chessboard. The lower
left square is black, say. In each move the coin will remain on the
same colour, so it will always remain on black squares. Since the
lower right square is white the coin can never get there. The coin is
like a (lame) bishop in chess. !
What do the two problems have in common? Something remains
constant (in each moment or in each move), therefore it must remain
constant over an arbitrary time span or after arbitrarily many moves.
This is the invariance principle. In short:
Invariance principle
The examples show that the invariance principle helps with proofs
of impossibility: B cannot catch up with A, the coin can never reach
the lower right square.
11.1 The invariance principle, first examples 255
A
B C
Figure 11.1 Boards for domino tilings
? Problem 11.3
Is it possible to tile a 5 × 5 board with dominoes? How about a 6 × 6 board?
! Solution
A domino covers two squares. Therefore any board tiled with domi-
noes must have an even number of squares. The 5 × 5 board has 25
squares, so it cannot be tiled.
The easiest way to show that a 6 × 6 board can be tiled with
dominoes is to give an example of a tiling, see Figure 11.2. !
Be careful: For proving that the 6 × 6 board can be tiled it is
not enough to argue that it has an even number of squares. For
example, the board has an even number of squares, but it
obviously cannot be tiled with dominoes.
? Problem 11.4
Is it possible to tile the board in Figure 11.1 C with dominoes?
Now we can describe more precisly how to use the invariance princi-
ple.
2 The
process in the jogger problem 11.1 is continuous: it does not have single
steps. However, the question and the solution are analogous. See also Section 11.4.
11.2 How to use the invariance principle 259
Example
3 This formalisation is not needed for understanding the rest of the chapter. It
serves to make the concepts precise, and illustrates the way many mathematical
texts are written. However, it will not usually help you to get good ideas for finding
invariants. For that it is more important to have an intuitive feeling for the invariance
principle, and you get this by doing examples, solving problems. Conversely you
may conclude that you should always look for the idea behind the formal definitions
that you find in many textbooks on mathematics.
260 11 The invariance principle
Often we describe processes as games. Then the states are the possible
positions of the game and the steps are the moves that are possible in
a given position.
? Problem 11.5
Let n be an odd natural number. We play the following game: We write
down the numbers 1, 2, . . . , 2n. A move consists of choosing two numbers
and replacing them by their difference. We play until only one number is
left.
Can the remaining number be zero?
Investigation
G
Let us consider an example with n = 3. We mark the two numbers
chosen for the next move by a dot:
1̇ 2 3 4 5 6̇
2 3 4 5̇ 5̇
2̇ 3̇ 4 0
1̇ 4̇ 0
3̇ 0̇
3̇
2. The parity of the sum of the remaining numbers stays the same
during each move.
1. and 2. together imply that the single number remaining at the end
must be odd, so it cannot be zero.
Proof of 1.: We have
2n(2n + 1)
1 + 2 + · · · + 2n = = n(2n + 1).
2
By assumption n is odd. Since 2n + 1 is also odd, it follows that
n(2n + 1) is odd.
Proof of 2.: Suppose at some stage in the game the numbers a1 , . . . , ak , x, y
remain, where x, y are the numbers chosen for the next move. Here
k ∈ N0 could be zero. Without loss of generality we may assume
x > y. Then after the next move the numbers a1 , . . . , ak , x − y remain.
So we need to show
a1 + · · · + a k + x + y ≡ a1 + · · · + a k + x − y mod 2
(for the congruence notation see Chapter 8; this just means the two
numbers have the same parity). The congruence is true since the
difference of the left- and right-hand sides is 2y, hence even. !
The following problem will guide you to the notion of the signature
of a permutation, one of the fundamental invariants of mathematics.
? Problem 11.6
Write down the numbers 1, 2, . . . , n in any order. A move swaps any two
adjacent numbers. Is it possible to arrive at the initial order after an odd
number of moves?
Investigation
G
Again we are talking about a process: the states are the permuta-
tions, the moves are the neighbour swaps.
Try out a few examples. For example, starting with 213 we could
swap 1 and 3 and arrive at 231; then we could continue as 321, 312,
132, 123, 213, which is the order we started with. We have made
six moves. You will notice that whenever you arrive back at the
initial order you will have made an even number of moves. We
conjecture that this is always the case. How could we prove that
in general?
It is not clear how to use the invariance principle here. But if we
could assign a number to each permutation in such a way that this
number changes its parity with each move then our conjecture would
follow immediately. This is our plan.
What happens when we swap two adjacent numbers? Two num-
bers that were in natural order (i.e. the smaller number first) will
now be out of order, and conversely.
Idea: this suggests that we consider the number of inversions of
a permutation. An inversion is a pair of places i < j where the
number at place i is bigger than the number at place j.
Example: How many inversions does the permutation 3412 have?
We consider all pairs of places systematically: 34 (at places 1 and
2) is not inverted, 31 inverted, 32 inverted, 41 inverted, 42 inverted,
12 not inverted. So there are 4 inversions.
How does the number of inversions change when we swap two
adjacent numbers? Clearly, if these numbers were not inverted
264 11 The invariance principle
before the swap then they will be afterwards, and if they were
inverted then they won’t be afterwards. The position of these two
numbers relative to all other numbers remains unchanged, as do
the positions of any pair of the other numbers.
So the number of inversions changes by one when we swap two
adjacent numbers. In particular the number of inversions will
change its parity, which is what we wanted. Here is an example.
The signature is the parity of the number of inversions.
number of
permutation signature
inversions
213 1 o
231 2 e
321 3 o
312 2 e
132 1 o
123 0 e
213 1 o
Proof.
Let π = ( a1 , . . . , an ) be a permutation. Let 1 ≤ k < n and σ =
( a1 , . . . , ak+1 , ak , . . . , an ) be the permutation obtained after swapping
ak and ak+1 . We show that the number of inversions of σ is one bigger
or one smaller than the number of inversions of π. This implies the
lemma. For this we consider the possible inversions i < j of π and σ:
All in all, we see that the number of inversions of σ differs from the
number of inversions of π by 1. q. e. d.
We can now solve Problem 11.6: Since the signature changes at each
move, and is the same at the beginning and the end, the number of
moves must be even. !
Remark
Example for a): 31254 is odd, and if you move 1 to the right, skipping
2 and 5, you obtain 32514, which is also odd.
Part b) generalizes the previous lemma on swapping adjacent num-
bers.
Here is a beautiful application of the signature:
? Problem 11.7
Consider a sliding puzzle in the shape of a 3 × 3 square, filled with 8 square
tiles numbered 1 to 8 as in Figure 11.4, so one tile is missing. A move slides
an adjacent tile into the empty space.
Somebody takes out the tiles 7 and 8 and puts them back in the oppo-
site order. Can you get back from this arrangement to the original arrange-
ment by sliding moves?
11.3 Further examples 267
1 2 3 1 2 3
4 5 6 4 5 6
7 8 8 7
Figure 11.4 Left: original position of the 8-puzzle, with two possible moves;
right: tiles 7 and 8 are interchanged
! Solution
The states are all possible arrangements of the tiles. By reading the
numbers row by row and ignoring the empty space we can associate
a permutation of the numbers 1, 2, . . . , 8 with each arrangement. The
original arrangement corresponds to the permutation 12345678; the ar-
rangement on the right in Figure 11.4 corresponds to the permutation
12345687.
When we move a tile horizontally then the corresponding permu-
tation does not change. Let us see what happens when we move a
tile vertically: Let m be the number on the tile. If we slide m down
then in the corresponding permutation it moves right, skipping two
numbers. If we slide m up then it moves left, skipping two numbers.
By the theorem above the signature does not change, whichever way
we move m.
Therefore the signature of the associated permutation is an invari-
ant of the game. Since the permutations 12345678 and 12345687 have
different signatures it is impossible to get from one arrangement to
the other, no matter how many moves we make. !
The analogous problem for a 4 × 4 square (the so-called 15-puzzle,
see Exercise E 11.9) has an interesting history. It is reported that in
268 11 The invariance principle
the year 1880 the puzzle created a craze first in the US and then in
Europe, after someone had promised a 1000 Dollar award for finding
a sequence of moves from the arrangement with 14, 15 swapped to
the original arrangement.
? Problem 11.8
You have a box containing 4 red balls, 5 green balls and 6 blue balls. In
each move you take out any two balls of different colours and replace them
by a ball of the third colour.5 You play until you cannot move any more.
Suppose a single ball remains at the end. Can you predict which colour
it is?
If you start with 4 red balls, 6 green balls and 8 blue balls, is it possible
that a single balls remains at the end?
Try it. Observe carefully the numbers of red, green and blue balls in
the course of the game. Do you notice anything? Can you prove it?
What can you conclude from it?
5 It is assumed that you have an extra supply of balls of each colour outside the
box.
11.3 Further examples 269
If r, g have the same parity before the move then they have the
same parity after the move. And if they have different parity before
the move they have different parity after the move. Put differently,
the parity of their difference does not change, no matter which move
we make.
By symmetry the same is true for r, b and for b, g: what remains
constant is whether they have the same or opposite parity.
Suppose a single red ball remains at the end. Then r, g, b are 1, 0, 0
at the end, so r has different parity from g and b. Therefore, r must
have had different parity from g and b at the beginning.
Similarly, if a green or blue ball remains at the end then g or b
respectively must have had a different parity from the other two
numbers at the beginning.
Since the starting values of r, g, b are 4, 5, 6 and only 5 has a different
parity from the other two numbers, it follows that the remaining
ball is green.
In the case 4, 6, 8 all parities are equal at the start, so they must
always be equal. Therefore it is not possible that a single ball
remains at the end. !
G
Remarks
J For a plane curve which is closed (i.e. starting point and endpoint
are the same) and which is allowed to intersect itself, and for
a point P not lying on the curve, one can consider the winding
number: the number of times the curve “winds around” P. The
winding number is an invariant of such curves under deformations,
assuming that during the deformation the curve always avoids
P. It is not easy to turn this intuitive description of the winding
number into an exact definition. This can be done using tools from
topology or from complex function theory.
The winding number has many applications. For example it can
be used for a very elegant proof of the fundamental theorem of
algebra (any polynomial has a zero in the complex numbers).6
given closed rope can be unknotted or not?8 Can one prove that
the three knots on the right can not be unknotted?
These questions are investigated in knot theory, a fascinating mod-
ern mathematical theory which has applications for example in the
understanding of DNA, which encodes our genetic information. In
knot theory one constructs invariants which are easy to compute
and which can be used to prove, for example, that the second and
third knot in Figure 11.5 cannot be unknotted.
However, up to this day no one has succeeded in proving that
these invariants are sufficient for deciding whether any given knot
can be unknotted. We don’t know whether they are.
An even more ambitious goal would be to find a complete set of
invariants, which would enable us to decide for any two knots
whether they can be deformed into each other.9
An extension cable is useful for playfully investigating knots (knot
it, then plug the ends together).
By the way, the knot on the right in Figure 11.5 can be unknotted.
J Processes and their long-term behaviour are the subject of the the-
ory of dynamical systems. Important tools in this theory are invari-
ant manifolds and Lyapunov functions (these are semi-invariants:
they are monotone increasing or decreasing during a run of the
process).
8 Wemake this more precise: A knot is a closed curve in space which does not
intersect itself. Two knots are called equivalent if one can be deformed into the other,
where also during the deformation no self-intersections are allowed. A knot can be
unknotted (alternatively, it is called trivial) if it can be deformed to the unknot, i.e.
a circle.
9 The book (Adams, Colin C., 2004) gives an informal introduction to knot
theory, with applications in physics, chemistry and biology; on the web page
http://katlas.org/wiki/Main_Page you find pictures of many knots.
11.4 Going further 273
12 ‘Fast’is not a mathematical but rather a practical notion. You may think of ‘in
less than a thousand years on state-of-the-art computers’.
11.5 Toolbox 275
11.5 Toolbox
Exercises
E 11.1 .We shred a sheet of paper. In each step we take one piece 1
and tear it into 3 or 5 parts. Is it possible to obtain precisely 100
pieces?
E 11.3 .We colour the board in Figure 11.1 C as follows: the lower 1
left 3 × 3 square and the upper right 3 × 3 square are black, the rest is
white. Can you use this colouring instead of the chessboard colouring
to prove that the board cannot be tiled with dominoes?
i, i + 1 having ai > ai+1 . Can you solve the problem using this number
instead of the total number of inversions?
2-3 E 11.10 .From a 12 × 12 board you remove one little square from each
of three corners. Is it possible to tile the remaining board using tiles
of the form ?
2-3 E 11.13 .Consider a strip of 2n unit squares. The squares are coloured
alternately black and white. In each move choose a contiguous group
of squares (for example the third square, or squares two to four) and
swap all colours in this group. Clearly you can make all squares
white using n moves. Is this also possible with fewer moves?
Exercises 277
E 11.16 . Three frogs sit at the points of the plane with coordinates 3
(0, 0), (0, 1) and (1, 0). Now they start leaping. In each leap one
frog leaps across another frog so that the leaped-over frog sits in the
middle between the starting and landing positions of the leaping frog.
Can a frog ever land at position (1, 1)? (These are super-frogs: they
can leap a long way.)
E 11.19 . Consider Problem 11.8 with initially r red, g green and b 2-3
278 11 The invariance principle
2-3 E 11.20 .Consider the following game. You start with g ∈ N green
and r ∈ N red balls in a box. In each move you take out two balls.
If they have the same colour then you put a green ball back into the
box, otherwise a red ball. We assume you have a supply of extra balls
as needed.
You play until only one ball is left in the box. Can you predict from r
and g what colour this ball is?
exit
entrance
E 11.25 .In this problem it is assumed that you know Rubik’s cube. 4
From the outside you can see 26 little coloured cubes called cubelets.
When you play with the cube you will notice that from the starting
280 11 The invariance principle
configuration, with each face just one colour, you can never get to a
configuration where
a) all except two cubelets are in the correct position, or
b) all corner cubelets are in the correct position and all except one
are correctly oriented, or
c) all edge cubelets are in the correct position and all except one
are correctly oriented.
Prove that it is really impossible to reach any of these configurations
(unless you disassemble the cube).
A A survey of problem-solving strategies
Suppose you are feeling ‘I have no idea what to do!’ What should
you do?
Then you take out your toolbox. It contains general strategies,
special strategies, techniques, and concepts.
Keep going, be stubborn but also flexible: if one strategy does not
work then try another. Work step by step.
General strategies
J Get a feel for the problem, get well acquainted with it:
Consider special cases or examples, make sketches and tables
J Introduce notation
J Formulate conjectures
Here are some other questions that you may ask yourself:
J Is there a pattern?
Special strategies
J Recursion, induction
J Pigeonhole principle
J Extremal principle
J Invariance principle
If you think that one of these principles could be useful, plan how
to use it: what would I need to do for the inductive step, what
could be the pigeons and the holes, which quantity could we max-
imise/minimise to solve our existence problem, what could be an
invariant that helps to prove non-existence?
A A survey of problem-solving strategies 283
Techniques, concepts
There are many techniques and concepts that can be useful for solving
problems. Some that you learned about in this book are:
J Counting principles
J Congruences
J Signature of a permutation
There are many more techniques and concepts that you will learn
about when studying more mathematics.
Of course with experience you will get better at solving problems.
You acquire it by solving problems yourself and also by understand-
ing given solutions. After a while you will build up a stock of
problems and solutions, which you can use with the strategy “simi-
lar problems”. Or you may follow a middle course: first think about
the problem, then read a little, then try to make progress yourself,
then get another idea from the book, etc. This can be an efficient way
to build up your stock and gain experience.
Many solutions to problems have solidified into mathematical theo-
ries (for instance number theory, or graph theory) which have been
refined more and more over the centuries. When you study such a
theory you will learn more techniques, concepts and ideas. Always
ask yourself: Which problems does the theory help me to solve?
Which problems can I solve now that I could not solve before?
And if none of the tools help – build your own. This is the high art
of problem-solving and of mathematical research.
J Structure sensibly
When you have solved the problem you should ask yourself more
questions, for example:
Example:
Let A = {1, 2, 3, 4, 5, 6}. Then {n ∈ A : n is even} = {2, 4, 6}.
(In words: the set of elements n of A which are even)
Number systems are sets:
From two sets you can create new sets using various operations: For
sets A and B we define:
Name Symbol Definition
union of A, B A∪B { x : x ∈ A or x ∈ B}
intersection of A, B A∩B { x : x ∈ A and x ∈ B}
difference of A, B A\B { x : x ∈ A, but x ∈ B}
product of A, B A×B {( x, y) : x ∈ A and y ∈ B}
(In words: A union B, A intersected with B, A minus B, A times B.)
For example, {1, 2} ∪ {2, 4, 6} = {1, 2, 4, 6}, {1, 2} ∩ {2, 4, 6} = {2}
and {1, 2} \ {2, 4, 6} = {1}. For the product (also called product set
or cartesian product) see the next section.
Two sets are called disjoint if they have no common elements, i.e.
if A ∩ B = ∅. If A, B are disjoint then A ∪ B is sometimes called their
disjoint union.
B Basics on sets and maps 289
Tuples
1 2 3
1 (1, 1) (1, 2) (1, 3)
2 (2, 1) (2, 2) (2, 3)
Maps
Proof.
The equivalence of a) and b) follows directly from the definition.
Suppose c) holds, i.e. f has an inverse map g : B → A. Then f is
surjective since to any b ∈ B we can take a = g(b), this satisfies the
equation f ( a) = b since f ( g(b)) = b.
f is also injective: if f ( a) = b then applying g to both sides yields
g( f ( a)) = g(b). By assumption g( f ( a)) = a, so we get a = g(b). We
have shown that there can be only one a ∈ A satisfying f ( a) = b.
Thus we have shown that c) implies b) and hence a).
It remains to prove that a) implies c). Assume f is bijective. Then we
can write down g: Let b ∈ B. Since f is bijective there is exactly one
a ∈ A with f ( a) = b. We define g(b) = a. Then g is an inverse map
of f . q. e. d.
292 B Basics on sets and maps
Examples
2 Itis useful and helps to avoid confusion and mistakes to use a different variable
name for the inverse map, for example m instead of n.
3 This follows from the intermediate value theorem and the following properties
cardinality
The cardinality of a finite set X is the number of elements of X. Notation: | X |.
Two (possibly infinite) sets are said to have the same cardinality if there is a
bijection between them. 107, 118, 133
C ATALAN numbers
Sequence of numbers which occurs when counting triangulations, for exam-
ple. 67
colouring problems
An interesting class of problems for graphs. 101
conclusion
The proposition B in an implication A ⇒ B. 161
congruent
For integers: For n ∈ N and a, b ∈ Z we say that a, b are congruent modulo
n if a and b leave the same remainder when divided by n, or equivalently if
b − a is divisible by n. In geometry: Two figures (i.e. subsets of the plane or
of space) are congruent if one can be transformed into the other by a rigid
motion, i.e. by a translation, rotation or reflection. 188
connected
A set is connected if you can get from any point (i.e. element) of the set to
any other point of the set along a path which runs inside the set. Here the set
can be a graph or a subset of the plane or of space. 84
degree of a vertex
In a graph the degree of a vertex V is the number of edges containing V
(loops are counted twice). Notation: dV . 93, 198
dense
For subsets A ⊂ B ⊂ R we say that A is dense in B if for any two numbers
x, y ∈ B with x < y there is an element r ∈ A satisfying x ≤ r ≤ y. 211, 246
disjoint
Two sets A, B are called disjoint if they have no common elements, i.e. if
A ∩ B = ∅; several sets are called pairwise disjoint if any two of them are
disjoint. 286
division with remainder
For a ∈ Z, n ∈ N the representation of a as a = qn + r with q, r ∈ Z and
0 ≤ r < n. The remainder is r. 184
divisor
If a, n ∈ Z then n is a divisor of a if a is divisible by n, that is if there is q ∈ Z
satisfying a = qn. 181
domino effect
Intuition for mathematical induction. 71
edge-face formula
The formula 2e = ∑ bF for plane graphs G, where e is the number of
F face of G
edges and bF is the number of boundary edges of the face F. 91
edge-vertex formula
The formula 2e = ∑ dV for graphs, where e is the number of edges
V vertex of G
and dV is the degree of the vertex V. 92
(logically) equivalent
Two propositions A, B are (logically) equivalent, in symbols A ⇐⇒ B, if
both ‘ A implies B’ and ‘B implies A’ are true. For example, the propositions
n + 3 = 8 and n = 5 about natural numbers n are equivalent. 163, 164
E ULER’s formula
The formula v − e + f = 2 for planar graphs or for polyhedra, where v is the
number of vertices, e is the number of edges and f is the number of
faces. 84, 98
extremal principle
Important idea for proofs of existence. Fundamental principle of science that
extremal configurations have special significance. 173, 217
Glossary 297
G AUSS trick
Method for calculating 1 + · · · + n quickly. 33, 124
graph
A finite structure given by a set of objects, called vertices, and a set of edges,
each joining two vertices. Examples: 1. a plane graph; 2. vertices are the
people in a room, and two people are joined by an edge if they know each
other. 93
graph, plane
A graph which is drawn in the plane in such a way that vertices are points,
edges are lines (not necessarily straight) joining the vertices, and the lines
don’t intersect (except at vertices). 83
implication
Proposition of the form ‘ A implies B’ (A ⇒ B). 161
in general position
A set of lines is in general position if no three go through a point and no two
are parallel. 28
infinite descent
Method which is sometimes useful for proving that an equation has no
solution in natural numbers: you prove that if there was a solution then there
would have to be another solution which is smaller. 235
injective, one-to-one, 1-1
A map f : A → B is injective (or one-to-one) if for every b ∈ B there is at most
one a ∈ A satisfying f ( a) = b. 288
invariance principle
Important idea for proofs of nonexistence. Fundamental principle of science
that in complex processes the quantities that don’t change have special signif-
icance. 176, 251
invariant
Something that does not change during a certain process. 256
298 Glossary
inverse map
g : B → A is called the inverse map of the map f : A → B if g( f ( a)) = a and
f ( g(b)) = b hold for all a ∈ A, b ∈ B. A map f has an inverse map if and
only f is bijective. 289
irrational number
A number which cannot be written as the quotient of two integers. 175, 203
lattice point
A point of the plane both of whose coordinates are integers. 215
lemma
An auxiliary statement which is used in the proof of a theorem. 182
loop in a graph
An edge of a graph whose two endpoints coincide. 93
map, mapping
A prescription which assigns to each element of a set A an element of a set B.
We write f : A → B where f is a name for the map. 288
mean: harmonic, geometric, arithmetic or quadratic
√
For a, b > 0 we call 1 2 1 the harmonic mean, ab the geometric mean, a+ b
a + b
2
modulo, mod
The remainder of a modulo n is the remainder when dividing a by n. 184
multiple
If a, n ∈ Z then a is a multiple n if a is divisible by n, that is if there is q ∈ Z
satisfying a = qn. 181
multiple counting principle
A useful idea for many counting problems. 110
multiplication rule
Basic counting rule. 108
necessary
Proposition A is necessary for proposition B if B implies A. 163
ordering
An order in which you can line up some objects, for example the numbers
1, . . . , n. 115, 262
parity
Property of an integer being even or odd. 150, 254
Glossary 299
PASCAL’s triangle
Arrangement of the binomial coefficients in a triangular array. 79, 120, 127
path in a graph
A sequence of edges in a graph where each edge has a common vertex with
the previous edge, so that the edges can be traversed one after another. The
path is called closed if the first and last vertex are the same. 84
permutation
A way to order the elements of a set M, e.g. M = {1, . . . , n}; may also be
interpreted as bijection M → M. 115, 262
pigeonhole principle
Fundamental idea for proofs of existence: If n + 1 pigeons sit in n pigeonholes
then at least one hole must be occupied by more than one pigeon. 173, 195
polygon
A plane figure bounded by finitely many straight lines, for example a triangle
or hexagon. A polygon is called convex if the straight line connecting any
two of its vertices lies in the polygon. 61
power set P ( A)
Set of subsets of the set A. 44, 118, 286
predicate
A statement containing variables, which becomes a proposition when values
are plugged in for the variables. 158
premise
The proposition A in an implication A ⇒ B. 161
prime factorisation
The representation of a natural number n > 1 as product of prime num-
bers. 183
prime number
A natural number which has precisely two divisors. 182
proof by contradiction
In order to show A ⇒ B you prove that ‘ A and ¬ B’ implies a false statement
(a contradiction). 163, 167
proof by mathematical induction
A type of proof which is often useful for proving statements about all natural
numbers. 71, 169
proof of existence
A proof which shows the existence of an object with certain proper-
ties. 169, 256
proof of impossiblity
Proof that something is impossible. 98, 174, 252, 272
300 Glossary
proof of nonexistence
A proof which shows that an object with certain properties cannot exist. 174, 257
rational number
A number that can be written as the quotient of two integers. 201, 285
recurrence relation
An equation giving each term in a sequence as a function of previous terms.
It expresses the idea of recursion in a counting problem. 41
recursion
A problem solving technique: reduce the problem to a smaller problem of the
same kind. 141
remainder
The remainder of the division of a ∈ Z by n ∈ N is the number r in the
representation a = qn + r where q, r ∈ Z und 0 ≤ r < n. 184, 199
semi-invariant
Something that changes in a controlled way during a certain process. 264
shift by one
Typical phenomenon in counting problems, frequent source of errors. For
example, a train with 10 cars has 9 couplings, and the number of integers
from 10 to 100 is 91, not 100 − 10 = 90, since one needs to count both the first
and last. 23, 109, 149
signature of a permutation
The parity of the number of inversions of a permutation. 262
sufficient
Proposition A is sufficient for proposition B if A implies B. 163
superposition principle
In linear problems (equations) one may obtain new solutions by adding two
solutions or multiplying a solution by a constant. 57
Glossary 301
surjective, onto
A map f : A → B is surjective (or onto) if for every b ∈ B there is at least one
a ∈ A satisfying f ( a) = b. 288
to tile
To cover completely without overlaps, and without pieces (tiles) extending
over the boundary. 50, 253
topology
Area of mathematics which studies those properties of shapes (or other
mathematical structures, like maps) which remain the same when the shapes
(or maps etc.) are changed in a continuous way. 99
torus
A surface which looks essentially like a bike tyre inner tube (without valve). 99
trapezoidal number
Natural number that can be represented as the sum of several consecutive
natural numbers. 146
triangle inequality
In a triangle each side is shorter than the sum of the lengths of the two other
sides. 221
triangulation
subdivision of a polygon into triangles by non-intersecting diagonals. 60
truth value
true (t) or false (f). 158
Lists of problems, theorems and methods
List of problems
Cutting up a log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Trailing zeroes of 100! . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
n lines in the plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Number of subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Number of tilings by dominoes . . . . . . . . . . . . . . . . . . . . . . 50
Solving the Fibonacci recurrence relation . . . . . . . . . . . . . . . 54
Number of triangulations of a convex n-gon . . . . . . . . . . . . . . 61
Colouring regions in the plane . . . . . . . . . . . . . . . . . . . . . . 74
Euler’s formula for graphs . . . . . . . . . . . . . . . . . . . . . . . . 84
Counting in two ways for graphs: edge-face formula . . . . . . . . . 91
Counting in two ways for graphs: edge-vertex formula . . . . . . . . 92
Handshakes: even and odd . . . . . . . . . . . . . . . . . . . . . . . . 94
Three connecting lines without intersections . . . . . . . . . . . . . . 95
Five points in the plane, all joined by edges . . . . . . . . . . . . . . . 96
Colourings of plane graphs . . . . . . . . . . . . . . . . . . . . . . . . 101
Simple counting problems . . . . . . . . . . . . . . . . . . . . . . . . . 109
Counting triominoes, I . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Counting triominoes, II . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Number of handshakes . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Number of ways to form pairs of dancers . . . . . . . . . . . . . . . . 117
Symmetry of the binomial coefficients . . . . . . . . . . . . . . . . . . 120
Number of subsets with even/odd number of elements . . . . . . . 121
Counting in two ways all connecting lines of n points . . . . . . . . . 124
Counting in two ways and sum of squares . . . . . . . . . . . . . . . 125
Counting the number of subsets in two ways . . . . . . . . . . . . . . 127
Counting in two ways for multiplication . . . . . . . . . . . . . . . . 127
Working backward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Diagonal in a cuboid . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Trapezoidal numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Practical use of remainders . . . . . . . . . . . . . . . . . . . . . . . . 186
Same number of acquaintances . . . . . . . . . . . . . . . . . . . . . . 197
Two equal remainders . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Powers ending in 001 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Approximation by fractions . . . . . . . . . . . . . . . . . . . . . . . . 201
How close can multiples be to an integer? . . . . . . . . . . . . . . . 204
(Non-)Acquaintances among 6 people . . . . . . . . . . . . . . . . . . 212
Rectangle of largest area with given perimeter . . . . . . . . . . . . . 220
Smallest sum of squares of distances . . . . . . . . . . . . . . . . . . . 222
Exercises in Chapter 1
E 1.6 Here the Gauss bracket is useful, the symbol for rounding
down to the previous integer. By definition x = the largest integer
which is ≤ x. For example 72 = 3 is the number of even natural
numbers which are less than or equal to 7.
since 2! cancels with −2!, similarly 3! with −3! (in the next term), up
to n! with −n!.
The telescope trick also helps with b) and c).
The sum in c) is n + 1 − 1
n +1 .
E 1.9 For example, you could try to prove the recursion sn = 2sn−1 .
Exercises in Chapter 2
E 2.10 Distinguish two kinds of subsets: those that contain the ele-
ment n and those that don’t.
E 2.14 First check for n = 1, 2, 3, 4, 5 whether the first player can force
victory. How can you reduce the answer for a game with n matches
to the answer for a smaller number of matches?
Exercises in Chapter 3
E 3.1 Prove by induction that for each n ∈ N you can put n pins into
the suitcase :-).
Hints for selected exercises 307
E 3.4 What could be the inductive step? First try to understand the
step from n = 2 to n = 3.
E 3.9 The main task is to show that this rule makes sense: there could
be several paths from A to B, and you need to show that each path
yields the same resulting colour for B. Here is an idea how to prove
this: if you have two such paths then you can deform or ‘slide’ one
path so it becomes the other path. What happens to the number of
intersection points when you slide across a vertex in the process?
Exercises in Chapter 4
E 4.8 Cut the torus open so you can flatten it into the plane and
consider the resulting plane graph.
E 4.15 Pay attention to the vertex degrees. Why can’t you start at the
top of the roof?
Exercises in Chapter 5
Therefore, about 42% of all hands have one pair, so the probability of
getting one pair is about 0.42.
E 5.6 First count: find the number of quadruples for each fixed d.
Second count: find the number of quadruples in each of these three
cases: a, b, c are all distinct; two of the three numbers a, b, c are equal;
and a = b = c.
E 5.14 Distinguish two cases: Either the subset contains the element
n + 1 or it does not.
E 5.16 b) (n+ n +1 2 n +1
1 ) + 5( 3 ) + 5 ( 5 ) + . . . is divisible by 2 . Question
1 n
for further investigation: Can you find a direct proof for the formula
2n a n = ( n + n +1 2 n +1
1 ) + 5( 3 ) + 5 ( 5 ) + . . . ? For example, by counting a
1
big is 1 − 2 approximately?
Exercises in Chapter 6
E 6.9 Work forward. How can I use the data? For example you
could connect B, C. There is more than one solution.
E 6.11 What does it mean for a number n that the card at position n
is face down at the end?
E 6.12 Either write down examples and guess (‘see’) a formula (and
then prove it!), or else work systematically: number the customers
1, . . . , n where 1 is the last customer etc. Let xi be the number of apples
left after customer i + 1 has gone, then x0 = 1 and xi = 2xi−1 + 2 for
i = 1, . . . , n. A clever way to solve this recursion is to add 2 on both
sides and to write the result as xi + 2 = 2( xi−1 + 2).
?
E 6.13√Work backward. Write x > 0 and try to eliminate the roots
(add 2, square etc.) Be careful with signs.
Exercises in Chapter 7
E 7.8 For example: for each person there is a fact which she knows
and for which there is no other person knowing it.
Exercises in Chapter 8
E 8.13 The claim is not negated correctly. Instead of “6k ≡ 6 (mod 10)
for all k ∈ N” the correct negation is “There is k ∈ N such that 6k ≡ 6
(mod 10) ”.
For a correct proof use induction.
Exercises in Chapter 9
E 9.12 Let ( a, b) and (c, d) be lattice points. What does it mean for
a, b, c, d that the midpoint between ( a, b) and (c, d) is a lattice point?
E 9.15 Think about what it means that there are m, k satisfying 999999 ·
10k−6 ≤ 2m < 10k . Take the logarithm to base 10 and relate this to the
problem of the goblin falling into the gap, see Figure 9.3.
Hints for selected exercises 313
E 9.18 Either imitate the solution of Problem 9.4 (that’s a good exer-
cise), or use the result of Problem 9.4.
Exercises in Chapter 10
E 10.5 This is possible, but a little more complicated than the given
solution.
1
E 10.7 Consider multiples of n for sufficiently large n.
E 10.14 The numbers must all be equal. In a), b) this can be proved
using the extremal principle, but in c) you need to find a different
argument since a set of positive real numbers need not have a smallest
element. (Of course c) implies a).)
Remark: The same conclusion also holds if you write positive real
numbers at lattice points in the plane, but this is harder to prove. Try
it!
E 10.16 For each splitting into two groups G1 , G2 consider the number
of pairs of people in G1 who know each other, plus the corresponding
number for G2 .
you pass and note at each point in time how much petrol you have.
Consider the minimum.
E 10.24 Let S be the set of given points. Consider all pairs (, P)
where is a line containing at least two points of S and P is a point
of S not lying on . Prove that there is at least one such pair. For each
such pair consider the distance of P from .
E 10.25 Choose the n points in such a way that the n-gon they form
has maximal perimeter.
Exercises in Chapter 11
colouring it does not depend on the position, and this is essential for
the argument.
E 11.5 No, for example this number does not change in the move
1324 → 1342.
E 11.8 You always need the same number of steps, no matter how
you go about it. Why? What changes in a controlled way at each
step?
E 11.13 Think about how to quantify the difference between the initial
and the final position.
E 11.18 The number is always even. What happens when you move
p across a diagonal?
E 11.22 Look at some examples. Starting with the numbers (r, g, b),
which numbers can result after a move? What remains constant in
each move?
E 11.23 Colour the holes suitably with three colours and use the
result of Problem 11.8.2
E 11.24 You can only get to the fourth row, so the biggest possible m
is 4. Why? It is easy to find a sequence of moves which gets you to
the fourth row. It is harder to prove that m = 5 is impossible. Here is
an idea: Suppose you could get a peg to position (0, 5). Now assign
numbers to all lattice points in such a way that the sum of numbers
at occupied points does not increase during any move which might
be done at any time during a game. If you choose the numbers well
then the sum of numbers of pegs involved in a putative solution is
smaller than the number at position (0, 5).
How do you choose the numbers for this to work? Here the equation
x2 + x = 1 will play a role. Also, the geometric series will be useful:
if | x | < 1 then 1 + x + x2 + · · · = 1−1 x .
Group Theory to Central Solitaire, The College Mathematics Journal, v 29, n 3, Mai
1998, 208-212) with the help of group theory. The proof proposed here is simpler.
References
General literature
Zeitz, P. (1999). The art and craft of problem solving. Wiley, New York,
NY.
Very well written textbook on problem-solving.
For Chapter 2
For Chapter 4
For Chapter 5
Apostol, T.M. (1967). Calculus. Vol. I and Vol. II. Blaisdell Publishing
Co., 2nd edition.
A comprehensive introduction to one-variable (vol. I) and multi-variable
(vol. 2) calculus, rigorous, with applications and many examples. A
classic.
For Chapter 8
For Chapter 10
For Chapter 11