the book - gfsmaths.com

advertisement
Number
0 Intro
1 Place value
1.1 Ancient number systems
1.2 Finger maths
1.3 Zeroes and ones
1.3.1 Napier’s location arithmetic
1.3.2 Binary
1.3.3 Binary codes
1.3.4 Binary fractions
1.3.5 Negabinary
2 Calculating
2.1 Multiplying methods
2.1.1 Grid method
2.1.2 Per crocetta
2.1.3 Napier’s bones
2.1.4 Egyptian method
2.1.5 Russian method
2.1.6 Line method
2.1.7 Lucas rulers
2.1.8 Abacus method
2.2 Division
2.2.1 Divisibility tests
2.2.2 Remainders
2.2.3 Power remainders*
2.3 Negatives and zero
2.3.1 Some history
2.3.2 Multiplying with negatives
2.3.3 Adding and subtracting negatives
2.3.4 Dividing by zero
3 Fractions
3.1 Babylonian fractions
3.2 Egyptian fractions
3.3 Fibonacci’s fractions
3.4 Galileo’s odd fractions
3.5 Fraction trees
3.6 Leibniz’s fractions
3.7 Euler’s totient numbers
3.8 Recurring decimals*
3.9 Greek ladders
3.10 Problem of the points
3.11 Pigeonhole fractons
4 Primes
1
4.1 Numbers as shapes
4.2 Finding primes
4.3 Prime games
4.3.1 Last prime
4.3.2 Prime Nim
4.4 Prime factorization
4.4.1 Factor trees
4.4.2 Uniqueness
4.4.3 Defining primes
4.5 Greatest Common Divisors
4.5.1 Relative primes and the GCD
4.5.2 Prime stars
4.5.3 Diophantine equations
4.6 Prime sequences
4.6.1 Linear prime sequences
4.6.2 Quadratic prime sequences
5 Number sequences
5.1 Triangle numbers
5.1.1 Counting crossings
5.1.2 Triangle patterns
5.1.3 Triangle cakes
5.1.4 Multiplication tables
5.1.5 Triangles from triangles
5.2 Squares and beyond
5.2.1 Square sort
5.2.2 Sums of squares
5.2.3 Summing sequences
5.3 The great Gauss
5.3.1 Quadratic residues*
5.3.2 Wilson’s theorem
5.3.3 Eight queens problem
5.4 Towers of Hanoi
5.5 Some unusual sequences
5.5.1 Stirling numbers of the 2nd kind
5.5.2 Stirling numbers of the 1st kind
5.5.3 Moessner sequences
5.5.4 Frequency sequences
5.5.5 Thue-Morse sequence
5.6 Pascal’s triangle
5.6.1 Blob pyramid
5.6.2 Rook moves
5.6.3 Lines in the plane
5.6.4 Catalan numbers
5.7 Fibonacci’s sequence
5.7.1 Steps
5.7.2 Partitions
5.7.3 Fibonacci reflections
2
5.7.4
5.7.5
5.7.6
5.7.7
5.7.8
5.7.9
5.7.10
5.7.11
Dominoes
Cumulative Fibonacci sequence
Fibonacci identities
Fibonacci remainders
Number bracelets
Fibonacci factors
Fibonacci Nims
Lucas numbers
6 Parity
6.1 Cogs
6.2 Invariants
6.2.1 Odd blobs
6.2.2 Odd cups
6.2.3 Binary strings
6.3 Coins
6.3.1 Coin tricks
6.3.2 Coins in a row
6.4 Fair game
6.4.1 Choco choice
6.4.2 Poisoned square
6.4.3 Clobber
6.4.4 Stomp!
6.4.5 Seat swap
6.5 Colouring in
6.5.1 Two-colourable maps
6.5.2 Three-colourable maps
6.5.3 Four-colourable maps
6.6 In and out
6.6.1 Bridges
6.6.2 Inside/outside
6.6.3 Odd triangle
6.6.4 Weaving
6.7 Graphs
6.7.1 Ghost house
6.7.2 Domino loop
6.7.3 Vertex game
6.8 Number puzzles
6.8.1 Number circles
6.8.2 Oddly even
6.8.3 Magic squares
7 The Maths of voting
7.1 What makes a good voting system?
7.2 Some voting systems
7.2.1 Plurality
7.2.2 Borda Count
7.2.3 Pairwise voting
3
7.2.4 Alternative Vote
7.2.5 Approval voting
7.3 Arrow’s Theorem
7.3.1 Independence of Irrelevant Alternatives
7.3.2 Arrow’s Theorem
7.4 UK 2010
7.4.1 How do UK elections work?
7.4.2 Who won?
7.4.3 Seats v Votes
7.4.4 Referendum 2011
7.4.5 Single Transferable Vote
7.4.6 Equality in the House of Commons
7.4.7 Voter apathy
7.5 Weighted systems
7.6 Banzhaf power
7.7 Electoral College
7.7.1 How do US elections work?
7.7.2 US 2000
7.7.3 Who would have won under AV?
7.7.4 How are electoral votes allocated?
8 Maths and music
8.1 The standard scale
8.2 Frequency
8.3 Pythagorean tuning
8.4 Just intonation
8.5 Equal temperament
8.6 Chords
8.7 Duration of notes
8.8 Time signatures
Glossary
Bibliography
4
0 Introduction
Why did I write this book?
The main reason I have written this book is to collect in one place some of the
mathematics that I, and my pupils, have found intriguing; I hope you find them as
intriguing as we do.
This book is designed for the interested mathematician, whether they are 14 years
old or 114. I would like to think that there is equally as much of interest for the
secondary school student of Maths as the secondary school teacher.
What Maths is in this book?
I have tried to take some of the more interesting areas of number and make them
accessible for the younger student. I want younger students to gain exposure to
some of the beautiful mathematics usually reserved for older students.
You will find little algebra, and no geometry here, not because I don’t love these
areas of Mathematics (I do!) but because these investigations form the basis of the
Number aspect of the Key Stage 3 scheme of work I have developed at Greenwich
Free School.
Curriculum
With regards to the curriculum, most of the areas under the number strand of the
UK National Curriculum at Key Stage 3 (age 11-14) are covered here: place value,
multiplication, division, fractions, decimals, percentages, ratio, negative numbers,
factors, multiples, primes, sequences, and patterns as well as using and applying
Maths. In that sense it can be used as part of a scheme of work that follows the
National Curriculum.
That said, the focus is not on curriculum content, but rather investigating and
exploring Maths; the activities are intended to allow the reader to explore how
numbers work. The aim is for pupils to practice and apply basic skills in a non-basic
context.
Questions are posed in red boxes, with (mostly) full worked solutions beneath. To
get the most out of this book, the reader should attempt the questions before
reading on. Only by fully investigating the problem can the beauty of the solution be
fully appreciated. I hope the solutions give enlightening ways on how to go about
solving mathematical problems.
How much Maths do I need to know?
The level of maths involved is generally no higher than that required for Key Stage 3,
although some of the investigations are a bit harder and may be more suitable for
older pupils (these are marked with a *). It is my hope that most readers can access
5
most of this book. There is a Glossary at the back of the book that contains some
basic skills and definitions you might need if you didn’t already know them; terms in
the Glossary are in bold.
Well, if you are a student of Maths, I hope you enjoy trying some of the
investigations, and if you are a teacher I hope you enjoy sharing some of the
investigations with your kids. Most of all, I hope this book will give anyone reading it
the same pleasure that I get from doing Maths.
6
1 Place value
Understanding and reflecting on how our number system works is the fundamental
building block to being able to work with numbers with fluency.
This section takes us on a whistle-stop tour of some ancient number systems, gives
some methods of working with our fingers, and explores some other number
systems such as binary.
7
1.1 Ancient number systems
Before we invented the number system we use today, which is now used almost
everywhere in the world, humans came up with lots of different ideas for writing
numbers.
The first known methods of counting, possibly around 30,000BC, involved making
tally marks, one mark for every number, often in bone or stone. This is OK for small
numbers but it would take a while to write bigger numbers!
Around 20,000 years later there is evidence the Sumerian civilization (modern Iraq)
were using different shaped clay tokens to represent different numbers and objects
(some of which can be found in the Louvre):
The Ancient Babylonians developed these ideas into a more sophisticated number
system, written on clay tablets. They originally started with lots of symbols for
different numbers, based on the shapes of the clay tokens seen above. For example,
they used symbols like these for 60, 600, 3600 and 36000:
They also used tally marks to represent 1 and 10 like this:
However, the true genius of the Babylonian number system was their invention of
place value. Putting the symbols in different places would result in them being of
different value, which meant they didn’t need lots of symbols for different sized
numbers. Gradually decided they could get by with only the two symbols for 1 and 10,
and scrapped the other symbols.
8
Now, the Babylonians used a base-60 system, so each column would be worth sixty
times more than the one before. So, using blobs, they might have written 736 = 12.60
+ 16 like this:
3600
60
units



You can see why they invented an extra symbol for 10 units - you could have up to 59
blobs in one place! They would write 736 like this:
Although this is lovely and simple, only using two symbols, it is still quite confusing as
it is not totally clear which symbol has which value. In around 500BC they came up
with a much nicer solution, using a couple of triangle blobs to separate the two
places like this:
Using our numerals, we often write Babylonian numbers using a comma to separate
the different columns, so we might write 736 like this: 12, 16.
Why do you think Babylonians used base 60?
Here are some Babylonian numbers found on a clay tablet.
1
1,2,1
1,2,3,2,1
1
1,1
1,1,1
Translate these numbers into our numbers. What do you think this represents?
In our numbers, the table reads:
1
3721
13402921
1
61
3661
The numbers on the left are the squares of the numbers on the right.
9
Babylonian mathematics was much more sophisticated than just multiplying and
dividing. They could solve quadratic and higher order equations. There is evidence
to suggest they had discovered Pythagoras’ Theorem long before Pythagoras, with
tablets containing Pythagorean triples and an approximation to the square root of
2.
Around the same time as the Babylonians were developing their number system, the
Ancient Egyptians were inventing one of their own. It was not as sophisticated as the
Babylonian one, as it did not use place value, but it was based on 10 instead of 60.
This meant they had to invent lots of symbols for different sizes of numbers. Here are
a few early ones they used:
One advantage of this is that it didn’t really matter where they put the symbols in the
number as they had a fixed value.
Here’s how they might have written 136:
Compare the Egyptian and Babylonian systems. Which do you prefer and why?
How could you make a system with the best of both?
The Egyptians came up with an ingenious method for multiplying (and dividing).
Here is their method for calculating 19 x 23:
1 x 23 = 23
2 x 23 = 46
4 x 23 = 92
8 x 23 = 184
16 x 23 = 368
So we have 23 + 46 + 368 = 437.
Before reading on, can you see how this works? Will it always work?
10
In this method we start at 1 x 23 and just double the left hand number until we get to
19. Then we only include the numbers on the left that add to make 19. Here, 19 = 1 +
2 + 16 so we just use those calculations. This method will always work because all
numbers can be expressed using powers of 2.
They also used this for division. To divide 135 by 15 (say) they would just write out
the multiplication for 15, stopping when they got to the target number 135:
1 x 15 = 15
2 x 15 = 30
4 x 15 = 60
8 x 15 = 120
Then they just found the numbers that add to 135 and took the multipliers, in this 1 +
8 = 9.
The Ancient Egyptians also discovered more than just multiplying and dividing.
They could solve complex practical problems, including geometrical ones
involving area and volume.
Around 500BC the Ancient Chinese came up with a base-10 system using bamboo
rods, with numbers 1 to 9 represented by:
The rods were placed on a counting board (like a chess board) where each box
represents a different value. Also, in each adjacent box the rods were alternately
placed horizontally and vertically like this:
They did not have a numeral for zero because they did not really need one!
However, in later years they used a stone from the game ‘Go’ to represent a zero.
This number system was replaced by the abacus, which first became used in China
around 200BC, although it was still used in parts of Japan for working with algebra.
Ancient Chinese mathematics was highly advanced, although it had little influence
on mathematics as we know it today
11
The base-10 system we use today came to Europe via Indian and Islamic
mathematics. Indian mathematicians came up with the idea of expressing each
number using one symbol each, as we do today. The development of these symbols
happened over more than 1,000 years into something resembling our current
symbols 0-9. Here is an image of Devanagari numerals from around 1000AD:
Note that zero appears in the above numerals. The birth of zero as a number, and its
rules for using it in calculations, can be traced to one of the most famous Indian
mathematicians, Brahmagupta (c. 700AD) – more about him later.
Indian mathematics had a huge influence on the development of Islamic
mathematics. Unlike the Greeks, they did not study arithmetic in order to solve
geometric problems; they studied it as a subject in its own right. The result of this
is that they developed solely numerical procedures for solving problems, many of
which we use today, as well as paving the way for the use of zero, negative and
irrational numbers.
Find out more about other ancient number systems.
I have not included anything about Islamic mathematics in this book – why not?
Find out what branches of mathematics Islamic mathematicians developed.
12
1.2 Finger maths
People have probably always counted on their fingers. You can definitely count up to
10 on two hands, but is this as far as you can go…?
Put your hands in front of you like you are about to play the piano. Each finger has
the value as shown in the picture below:
By ‘playing’ the index finger of your right hand you count 1. Leaving your fingers in
the table as you go, you can start counting to 4. When you get to 4, all of the fingers
on your right hand should now be on the table.
Now, to count 5, put your right thumb on the table, and at the same time, lift all
your fingers from the table. To count 6, now put your (right) index finger down
again (and keep your thumb down), giving 5+1 = 6. Now in the same way as before
you can count up to 9 on your right hand – when you get to 9, all your fingers and
thumb on your right hand are on the table.
To count to 10, you put your left index finger on the table, and at the same time, lift
all your right hand from the table. Now you can count to 99! You should practice
counting up and down before you try the next bit.
Try some times tables. What
does the 2x table look like on
your fingers? Can you see any
patterns? What about other
times tables?
Which times tables are the
easiest? Which are the hardest?
Can you work out which times
table this is a picture of?
13
Try doing some addition or subtraction using your hands. Can you find any methods
for making these calculations quicker?
This is based on the Japanese abacus called the Soroban. You can buy one of these
quite cheaply online. Here is a picture of one:
You can see that your fingers are like the earth beads (1 to 4) and
your thumbs are like the heaven beads (fives).
To count a number on the Soroban, move the beads so that they
touch the beam (like putting your fingers on the table). For
example, here is the number 736.
To add 654 + 213 we start with 634 on the abacus and then add the 2 to the 6, 1 to
the 5, and 3 to the 4, giving 867. Notice that we work from left to right.
This was a simple example as there were enough beads to do each column
separately without carrying, but what happens when we need to do carrying? For
this we need to use the idea of complementary numbers. Complementary numbers
are pairs that add up to 10, so the complementary number for 8 (say) is 2.
Let’s see an example. To work out 13 + 58, set 13 on the Soroban and try adding left
to right. The tens column is OK as there are enough beads, but in the second (units)
column there are not enough beads (3+8), so we subtract the complement of 8
which is 2 (giving 1 in the units column) and add 1 to the tens column (giving 71).
To subtract on a Soroban, we do the opposite. To calculate 53 – 26, going left to
right, we try the tens column first which is OK (5-2=3), but there are not enough
beads in the second column. So, doing the opposite to addition, we take one from
the tens column (leaving 2) and then add the complement of 6 (which is 4) to the 3
already in the units column, which gives 27.
Practice some calculations like these yourself! Why not explore abacus methods
for multiplying.
14
You can actually count up to much more than 99 on your hands. To see how, let’s
give each finger a value double to the previous one, like this:
Now you can count much further! For example, to show the number 21 you just hold
up the fingers 16, 1 and 4.
Practice counting using this method; what is the biggest number you can count up
to? What do times tables look like now? Why not try some calculations?
Can you see why this works?
15
Here is another way of showing numbers using fingers: British Sign Language (BSL).
This is one system that only uses one hand:
Find out more about other mathematical signs in BSL. Can you think of some
signs for mathematical terms and concepts that do not exist in BSL?
16
1.3 Zeroes and Ones
1.3.1 Napier’s Location Arithmetic
Let’s look a bit closer at the double-hand number system above.
In the 16th century a Scottish mathematician called Napier used letters instead of
fingers, with a = 1, b = 2, c = 4, and so on. So, for example, he would write 21 as ace.
Try writing some other numbers using Napier’s method. What are the advantages
and disadvantages of this method?
Napier allowed repeats to be used. For example, the word add represents 17.
However, you might have noticed that the word add can be shortened to ae; Napier
called this abbreviation.
What is the abbreviated answer to the sum add + ace?
Napier used counters on grids to perform calculations. Consider the sum 29 + 8.
Place counters on 29 (= 16 + 8 + 4 + 1 = acde) and 9 (= 8 + 1 = ad) like this:
You can think of abbreviating as replacing two counters in any column with one
counter in the next column up (to the left). So we abbreviate as follows:
And one final abbreviation leads to:
17
Try some more addition using these grids. How would you adapt this method to
perform subtraction?
Multiplication can be performed on a square
grid like this:
If each grey square contains the result of
multiplying the two letters together, can you fill
in the values of all the grey squares?
What do you notice?
You may have noticed that the diagonals of the
grid contain the same values;
Napier exploited this fact to perform
multiplications on this grid using counters.
Here is an example showing the calculation of 5
x 6. The word form of this sum is ac x bc, so
place counters on cells where these letters
‘intersect’ like this:
Then, as all values on the diagonal are the same, slide the counters along the
diagonals to the bottom row as shown below and read off the result (abbreviating if
necessary) to give the answer bcde which is 2 + 4 + 8 + 16 = 30.
18
Napier said of this method: “…it might be well described as more of a lark than a
labor, for it carries out addition, subtraction, multiplication and division purely by
moving counters from place to place.”
Try some of these calculations yourself. Can you see how to use it for division?
Make a larger grid and have a play with these methods for larger numbers!
John Napier was a Scottish mathematician born around 1550AD who had many
interesting ideas - he predicted the machine gun and submarine around 300 years
before they were invented. However, he is most famous for his work in
mathematics. He once famously said:
There is nothing more troublesome in mathematics than multiplications, divisions
of great numbers which involve a tedious expenditure of time, as well as being
subject to ‘slippery errors’
I agree! Apart from the discoveries here, he also invented the logarithm (log),
considered by some to be the most important discovery of the Renaissance as it
helped in calculations with large numbers. We will find out a bit more about logs
in the section on Maths and music.
19
1.3.2 Binary
Instead of using letters for each finger, let’s have a column for each finger, like our
usual columns for units, tens, hundreds and so on:
Carry on with this table – can you see any patterns?
There are lots of patterns you might have spotted. One that interests me is that the
last columns alternates blob, then blank, then blob… which is equivalent to saying all
odd numbers end in a blob.
In the 17th century, the German mathematician Leibniz starting using this system to
do calculations. He represented the blobs by 1s and the blanks with 0s. For example,
the number 5 would be 101. This is now called binary, or base -2.
Here is the addition 3 + 8 performed using binary. Change 3 and 8 into binary (11
and 1000) and then do the addition in the usual way:
Try doing some more calculations in binary – don’t just stick to addition… Do you
think it is easier or harder than our normal number system?
I definitely think that some calculations are easier using binary, although there is a
often lot of carrying involved!
20
Investigation 1: Here is a sequence of numbers: 3, 5, 6, 9, 10, 12, 17, 18, … what is
special about this sequence of numbers? Can you find a similar interesting
sequence of numbers?
If we write them in binary we get 11, 110, 101, 1001, 1100, 10001, 10010, and so on.
Now you might have noticed that these are all the numbers with exactly 2 binary
digits.
Investigation 2: Try making all the numbers 1 to 25 by adding some or all of the
five numbers 1, 2, 3, 7 and 12 (without repeats). Is it possible? What is the highest
total you can make? Is there a ‘better’ set of 5 numbers you can use?
You can make all the numbers from 1 to 25 with these five digits; in fact, 25 is the
highest total you can make.
However, you can make a ‘better’ set of 5 numbers that will make all the numbers
up to 25 and a few more. Notice that 3 is kind of ‘wasted’ as you can make this out
of 1+2, so why not have the next number as 4 instead of 3? Now we can make all the
numbers up to 7, which suggests 8 as the next best choice… But now you are
probably starting to notice that there are all the doubles (powers of 2), which is a
nice demonstration that you can make all the numbers by summing powers of 2.
Gottfried Wilhelm Leibniz (born 1646) is most famous for discovering calculus at
the same time as Newton (and having a dispute with him about who found it
first). It is Leibniz’s notation that we use today, not Newton’s.
He was the first European mathematician to use matrices to solve systems of
equations and asked the question whether all polynomials can be factorized into
linear and quadratic factors.
He is considered the most important logician since Aristotle, and believed that
human thought could be reduced to a series of calculations. He also developed
one of the first mechanical calculators that could perform multiplication and
division, which used binary.
21
1.3.3 Binary codes
Here is the number 5 (101) represented as a binary
‘picture’:
We could use this idea to create more interesting binary
pictures; here is a picture for the ‘code’ {5,2,5}, where
each number represents a row in the picture:
What picture does the code {17,27,21,17} represent?
Explore other binary pictures.
What is binary used for? In the 19th century English mathematicians George Boole
built on Leibniz’s and Babbage’s (see More Prime Sequences) ideas that Maths was
just a branch of general logical thought.
He developed a system of algebra for working with mathematical logic called
Boolean Algebra, which was considered relatively useless in his lifetime; its
importance was not fully realized until US mathematician Claude Shannon linked it
to electrical circuits and used it in the design of circuit boards for computers.
George Boole’s father was a carpenter, at that time considered a job for the lower
classes. In these days (and now?) the upper classes looked down on the lower
classes. Mathematics was forbidden in working class schools, being considered a
‘gentlemanly pursuit’.
George Boole broke this mold, initially being taught by his dad, then getting into a
charity school until the age of 16 (usually the poor worked from the age of 8 or
9). He taught himself a number of European languages so he could
read classic maths textbooks.
Find out more about electrical circuits, logic gates, Boolean algebra and the use of
binary in logic and computers.
Binary is now used in electrical circuits everywhere, in our computers and phones, to
store and transmit information. Information can be thought of as a long binary code
where each digit represents a bit of data.
When transmitting data across long distances, there is often ‘noise’, which creates
errors in the signal. In the 1970s, methods were developed by NASA to transmit a
code that could detect and correct its own errors. We are going to have a look at
how this might be possible:
22
Before reading on, consider the
following problem:
Can you create a code to transmit
to this robot so that it can navigate
through the maze?
You must only use zeroes and
ones; no spaces, commas, ...
One idea is to use 00, 01, 10 and 11 for up, down, left and right. Or perhaps you
decided to use 0 for forward and 1 for a turn of 90 degrees (clockwise).
So a transmission using this code would be (looking down from above, starting facing
to the right): 01001110100111001110001110.
Then comes the problem: what if there is an error in the transmission? If (say) any 0
turns to 1, the robot will not reach its goal. How can we devise a code that
recognizes that an error has been made?
One solution is to use something called a Hamming Code, invented by US
mathematician Richard Hamming in 1950.
Suppose we wish to transmit (say) a 4-digit symbol, such as 1101. Then we can add
extra digits to the end (called a parity check) to check whether there is an error in
the transmission. Here is an example:
Each digit is written in a section of the Venn
diagram. So the digits in sections 1 to 4 here are our
codeword 1101.
How are the other digits in sections 5, 6 and 7
chosen? They are chosen to make each circle contain
an even number of ones (hence the name parity
check).
So here we transmit the word 1101010, which can then be checked for errors by the
receiver using the Venn diagram.
But this code not only detects errors, it can also correct them! Once we have found
where the error is, we can also change the digit to the correct (opposite) value, and
work out what the codeword should have been!
23
For example, if this word was transmitted but we received 1001010, then we could
put these in the Venn diagram and realize that the error must be in section 2.
Can you find the error in the codeword 1001110 using this method? Find out
more about error-correcting codes.
24
1.3.4 Binary fractions
Here are the binary place values, including fractions:
Try writing some binary fractions.
Some are easy like 1/2 = 0.1, 1/4 = 0.01 and so on. How about 1/3?
Let’s just recap how we would work out 1/3 in base-10. 1/3 is the same as 1 divided
by 3, or ‘how many threes in one?’, and we use long division:
There are no threes in 1 (0 remainder 1), and we carry the remainder into the next
column (1/10ths), where it counts as 10 (ten tenths is 1 unit). We usually write this
like this:
Now we do threes into 10, which is 3 remainder 1, and we write the answer (3)
above the line, and carry the remainder 1 into the next column, where it counts as
10 again:
This will carry on forever, giving the recurring decimal 0.333… We can write this
process like this:
1 = 0 x 3 + 1  10 = 3 x 3 + 1  10 = 3 x 3 + 1 …
Now let’s think about what is happening here: the remainders become tens in the
next column s because we are working in base-10. What will happen in binary? The
remainders will become two in the next column!
25
Let’s try working out 1/3 in binary:
1=0x3+12=0x3+24=1x3+12=0x3+24=1x3+1
You can see the remainders doubling as we move into the next column… So our
binary-mal here is recurring 0.0101…
Try using this method to work out other binary-mals. Any patterns?
Here are the first few binary-mals, with recurring parts underlined:
1/2 = 0.1
1/3 = 0.01
1/4 = 0.01
1/5 = 0.0011
1/6 = 0.001
1/7 = 0.001
1/8 = 0.001
1/9 = 0.000111
1/10 = 0.00011
1/11 = 0.0001011101
1/12 = 0.0001
There are a few patterns I notice here. The most obvious one is that 1/2, 1/4, 1/8, …
are the only terminating (not recurring) decimals. Can you explain why?
You might also have noticed that the fractions with denominators one less than a
‘double’ (1/3, 1/7, …) follow the pattern 0.01, 0.001, 0.0001, … When you work them
out you can see why.
Also, you might have noticed that one you have worked (say) 1/3, you can easily
write down all the fractions that are half as big (1/6, 1/12, …) because they just have
one extra zero after the decimal point. So 1/3 = 0.01 implies that 1/6 = 0.001, 1/12 =
0.0001 and so on. This is because they are made of fractions that are half as big, so
all 1s are shifted one place to the right.
More than this, we can see all fractions such as 1/3 can be written as an (infinite)
sum of fractions. For example, 1/3 = 0.010101… can be written as
1/3 = 1/4 + 1/16 + 1/64 + …
You can type these into a calculator and see that including more terms gets us closer
and closer to 1/3. You could also use these to find infinite series for other fractions.
For example, doubling gives 2/3 = 1/2 + 1/8 + 1/32 + …
For more on infinite series, see the section Leibniz’s fractions.
26
Try writing fractions in other number bases. Which do you like best? Why?
I personally like base-12 as a number system as it has lots of factors, which means it
would be good for writing fractions. Before we start using base 12 we need to invent
two more number symbols (called numerals) to represent our 10 and 11, so I’m
going to use A and B.
So the numerals for base-12 are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, then 12 would be 10
and so on.
Here are some common fractions written using base-12:
It takes a bit of practice working them out but after a while it’s OK.
How can you check these are correct? For example, 1/8 = 1/12 +
6/144, which is the same as 12/144 + 6/144, which is 18/144,
which simplifies to 1/8.
Unfortunately we still have recurring ‘decimals’, we can’t get
away from them!
To work them out we need long division, remembering to carry
12 over for each remainder into the next column. Here are some
I worked out:
1/5 = 0.249724972…
1/10 = 0.124962497…
1/11 = 0.111…
…and our old friend 7, gives us 1/7 = 0.186A35186…
Do you think base-12 is a good idea?
See the sections Babylonian fractions and Recurring decimals for more about this.
27
1.3.5 Negabinary
Before finding out about negabinary, let’s look a bit closer at normal binary. Before
starting this section, you might want to look at the section on multiplying negatives.
We have seen that the place values (columns) in binary are 1, 2, 4, 8, … which are the
powers of 2: 20 = 1, 21 = 2, 22 = 4, 23 = 8, and so on.
What are the powers for the fractional columns we saw in binary fractions?
Carrying on the pattern above, we have the 1/2 must be 2-1, 1/4 is 2-2 and so on.
When talking about powers, we say the big number at the bottom is the base, and
the little number at the top is the power or the index. All the columns in binary all
have a base of 2, hence the name base 2 (and in the same way, all the columns in
our normal number system have base 10).
US mathematician Donald Knuth investigated the properties of an
alternative/extension to binary called negabinary, which can be thought of as base 2.
What are the place values in negabinary?
Well, let’s concentrate on the non-fractional place values. So we have:
(-2)0 = 1 (anything to the power 0 is 1)
(-2)1 = -2
(-2)2 = (-2) x (-2) = +4
(-2)3 = (-2) x (-2) x (-2) = -8
The place values are like binary, but with alternating negative signs:
What are the first few numbers in negabinary? What numbers can be written in
negabinary?
Can you see any patterns?
The first few numbers in negabinary are:
28
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
10000
=1
= 1 x (-2) = -2
= 1 x (-2) + 1 x 1 = -1
=1x4=4
=1x4+1x1=5
= 1 x 4 + 1 x (-2) = 2
= 1 x 4 + 1 x (-2) + 1 x 1 = 3
= 1 x (-8) = -8
= -7
= -10
= -9
= -4
= -3
= -6
= -5
= 16
Do you think all positive and negative numbers can be represented in
negabinary?
It turns out they can. Here are the positive and negative numbers represented in
negabinary:
Positives
Negatives
1
110
111
100
101
11010
11011
…
11
10
1101
1100
1111
1110
1001
If you hadn’t noticed it already, you can see that the positives have an odd number
of digits and the negative numbers have an even number. You might not have
noticed some other patterns, such as multiples of 3 have 3 ones.
You might have also found a quick way of working out the negabinary representation
of a number. For example, to work out what 7 looks like, note that 7 can be made
from 16 + (-9) = 10000 + 1011 = 11011.
29
What happens if we use counters to count with negabinary? How does adding,
subtracting and multiplying work?
If we want to count in negabinary, we note that two blobs in the (units) column turn
into two blobs in the next two columns, like this:
I’ll leave you to explore adding, subtracting and multiplying!
30
2 Calculating
This section is about boring old times tables and long division. Not really, but we will
have a look at some more interesting aspects of multiplication and division. Although
I have given some mention as to the origins of these methods, there is considerable
debate over many of them.
31
2.1 Multiplying methods
2.1.1 Grid method
The most common that is taught at school is
the grid or area method; here is 23 x 34. We
split the two numbers up and calculate (20 + 3)
x (30 + 4). Then we just add the results together
to get 782.
This method is good because it is clear and has a meaningful interpretation (area).
Also, it is useful for understanding BODMAS and for multiplying algebraic
expressions. Although this method is the one I would recommend to use, there are
more interesting methods.
2.1.2 Per crocetta
A different method, possibly invented by Indian
mathematicians, and which appears in Italian maths
books around 1500AD, is called per crocetta (by the
cross), and is shown by this diagram.
I have started at the 20, and gone round the arrows
multiplying each pair as I go along and writing it in red.
You can see it is really just the grid method in a different
form.
Can you make a similar cross for multiplying two 3-digit numbers together?
2.1.3 Napier’s Bones
John Napier (mentioned in the previous chapter, which incidentally included another
method for multiplying) invented another multiplication method called Napier’s
Bones. Napier’s bones are basically just times tables written on strips, like these ones
for the 2 and 7 times tables below.
Note how each box splits the product
into tens and units. Now, we can use
these strips to calculate the 27 times
tables easily. For example, to work out
6 x 27, just look at the 6th row (circled)
you can see 6 x 2 = 12 and 6 x 7 = 42.
Putting these together on the right
hand side and adding along the
diagonals gives the answer 162.
32
Of course, you don’t need the strips to work out this calculation; you could have just
written down the boxes on the right straight away. This method is sometimes called
Gelosia.
Why not make some Napier’s rods of your own!
2.1.4 Egyptian method
This was described in the previous section but is included again here for
completeness. Here is the method for calculating 19 x 23:
1 x 23 = 23
2 x 23 = 46
4 x 23 = 92
8 x 23 = 184
16 x 23 = 368
So we have 23 + 46 + 368 = 437.
2.1.5 Russian method
This is a similar method as above. Here is the calculation for 19 x 23:
19 x 23
9 x 46
4 x 92
2 x 184
1 x 368
Again adding the red numbers we can see that the answer is 437. This time we have
halved the left number and doubled the right number. We then cross out the ones in
which the left number is even.
How does this method work?
33
2.1.6 Line method
I’m not sure where this method comes from, but here is the calculation for 23 x 34:
Now we have 12 units, 17 tens and 6 hundreds, which add together to make 782.
Compare this with the grid method – can you see how it works?
34
2.1.7 Lucas rulers
Here is a set of strips, a bit like Napier’s Bones, that are used for multiplication. They
were devised by French mathematician Eduoard Lucas in the 19th century. He was
also famous for the Lucas numbers (see the section on Fibonacci) and inventing the
puzzle Towers of Hanoi.
35
Cutting out the strips, we can put them together to work out calculations. For
example, to work out 6 x 27 we put the strips for 2 and 7 together like this, along
with the ‘index’ strip:
Now we calculate the product 6 x 27 by looking at the
6th row.
First, take the top number in the furthest right column
(which is a 2).
We then follow the triangle arrow to the left, which is
pointing to a 6 in the next column.
Following the next triangle, it is pointing to a 1.
And we have the answer = 162!
Test this out for some other numbers...
How does this work?
2.1.8 Abacus method
This method is basically the long multiplication method that used to be taught in
schools, but is adapted to work on an abacus.
First, choose a column of the abacus to be the units column. Then enter the number
you want to multiply (367, shown in blue here) two columns to the left of this
column. Now multiply each digit of this number and put the answer in the two
spaces to the right of the number you just multiplied.
Here is the calculation for 6 x 367. First we
calculated 6 x 7 and put it in the two spaces to
the right of the 7, then 6 x 6 in the two spaces to
the right of the 6, then finally 6 x 3 in the two
spaces to the right of the three. Adding then
gives the answer, 2202.
Test this out on an abacus.
36
2.2 Division
2.2 1 Divisibility tests
There are lots of divisibility tests, which people get more or less excited about. Some
of the divisibility tests require the idea of a reduced number (or digital root), which is
where you add the digits of a number together. For example, 38 reduces to 3 + 8 =
11, which reduces to 1 + 1 = 2. So the reduced number of 38 is 2.
Before reading on, investigate the reduced number sequences of some basic
sequences, such as times tables, square/cube numbers, triangle numbers, ...
Try recording your results on 9-dot circles. What patterns can you find?
For example, here is the 4x table recorded on a 9-dot
circle:
You may have noticed that the 9x table always reduces
to 9 (and in fact the final reduced number is the
remainder on division by 9), and the 3x table always
reduces to 3, 6 or 9. This gives a quick way of checking
whether a number is divisible by 3 or 9.
Can you prove why this works?
Here’s a proof for divisibility by 9. Consider a 3-digit number abc, where a is the
hundreds digit, and so on. So the value of this number can be thought of as 100a +
10b + c.
Now the reduced number is a + b + c. The difference between 100a + 10b + c and a +
b + c is 99a + 9b. Now this is definitely a multiple of 9 (why?) so if a + b + c is also a
multiple of 9, them so is 100a + 10b + c. Think about this for a while and try it out
with some numbers if you are not sure why. You can probably adapt this proof to
see why the test for divisibility by 3 works too.
Here is a fun puzzle that uses the divisibility test for 3:
Suppose there are three piles of sweets, one with 1 sweet, another with 2 sweets
and a third with 3 sweets.
You can take sweets according to these two rules: You can either take the same
number of sweets from each, or you can divide any even pile into two and move
half into another heap (leaving the other half where it was).
The aim is to take all the sweets from the table: can you work out how to take all
the sweets?
37
This is not too tricky; take 1 from each, leaving 0-1-2. The split the third pile into half,
putting one half into pile 1, giving 1-1-1 and we are done.
Try for different starting piles of sweets. Can you always take all the sweets? If
not, when is it not possible? Can you explain why?
Did you work systematically to find which ones were possible and which were not?
It turns out that any piles of sweets that are a multiple of 3 will be possible. To see
why this might be true, consider the final position you want to get to, where all piles
have the same number of sweets; the total must be a multiple of 3. If you think
about this, the piles must always contain a total multiple of 3 otherwise we can
never take them all. So just use your divisibility test for 3 to see if the puzzle will be
possible!
Here is a trick that involves divisibility by 9, taken from Martin Gardner’s 2nd
Scientific American Book of Mathematical Puzzles and Diversions:
First of all, draw a spiral on a piece of paper and put it in an envelope. Then ask a
friend to take their phone number and then scramble the numbers into a different
order. Then ask them to subtract the smallest number from the biggest one and
work out the reduced number of the answer.
Starting at the star = 1 on the picture below and
counting round this reduced number, where do
you end? Can you explain how this trick works?
The reduced number of the answer is always 9,
which is why we end at the spiral (if we start at the
star – you could vary this to make the puzzle
harder to figure out).
Let’s see how it works through an example. My phone number is 237115, and I could
scramble this into (say) 751213. Then subtracting we have 751213 – 237115 =
514098, which has reduced number 9. In fact, the answer will always be 9 because
the phone number and its scrambled version will have the same reduced number. So
subtracting them will cancel out the reduced numbers, leaving the same reduced
number. Why is it 9? Consider the digit 7 in the number above: it contributes 100000
x 7 – 1000 x 7 = 99000 x 7 to the final reduced number, which is a multiple of 9. A
similar argument proves that all the digits will contribute a multiple of 9 to the
answer.
Now, let’s turn our attention to divisibility tests for other numbers. You already
know some other divisibility tests, such as those for the 10x, 5x and 2x tables (by just
looking at the last digit). There are similar tests for the 4x and 8x tables (by looking
at the last 2 or 3 digits).
38
We can combine the tests for the 2x and 3x tables to make a test for the 6x table.
How about a test for divisibility by 7? This is much less obvious. One test goes as
follows: Take the unit digit of the number and double it, then subtract this from the
rest of the number. Carry on until you get down to a small number. If it is a multiple
of 7 then the whole number is.
For example: 2849 --> 284 - 2x9 = 266 --> 26 - 2x6 = 14 which is a multiple of 7, so
2849 is.
There is also a nice test for divisibility by 11: add alternate digits to make two totals,
for example 154,737 gives 1+4+3=8 and 5+7+7=19. Then if the difference between
these totals is a multiple of 11 then the number is divisible by 11.
Can you prove why this works? Use a similar argument to the one for divisibility
by 9.
Let’s take the number abc = 100a + 10b + c again. Now we have a + c in one total and
b in the other. The difference between these totals is a – b + c. Now comparing 100a
+ 10b + c with a – b + c we have a a difference of 99a + 11b which is a multiple of 11.
So if a – b + c is also a multiple of 11, so is abc.
Finally, here’s an interesting test for divisibility by 7, 11 and 13. Take a large number
such as 174572528. Split the number into 3-digit segments 174, 572 and 528. Add
together alternate ones, as above, so here we have 174 + 528 = 702 and 572. Now
take the difference of the two totals, which is 702 – 572 = 130. As this is a multiple of
13, this number is divisible by 13.
To see how this works, consider a number abcdefghi. Now comparing 1000000xabc
+ 1000def + ghi with abc – def + ghi we have a difference of 999999abc + 1001def,
which is a multiple of 1001, and further to this, 1001 is a multiple of 7, 11 and 13. So
if our final number is a multiple of any of these, so is the original.
39
2.2.2 Remainders
For me, the most interesting thing about division is the patterns in remainders. They
help you find patterns in sequences that you might not have noticed at first sight.
For example, if you look at the remainders of the square numbers when divided by 2,
you get 1, 0, 1, 0, 1, 0, … which if you think about it, is just telling us that the square
numbers alternate odd, even, odd, even, … (why?)
Here are a few more investigations to get you started. If you can, try and explain why
you find the patterns you do. The first investigation is from the excellent book Points
of Departure, available through the ATM.
Start with any number and continue doubling it…
what are the remainders on division by different
numbers?
Here is what happens for the numbers 0 to 6 on
division by 7…
Investigate for other divisors.
Here are some more open-ended investigations of remainders for different
sequences:
We saw above how the square numbers have a pattern on division by 2.
Investigate the remainders of the square, triangle and cube numbers with
different divisors. How about the prime numbers?
We are going to look at these questions in more detail in the next section. But notice
that even a sequence with seemingly little pattern, such as the prime numbers, may
have some pattern when studying its remainders. For example, here are the
remainders of the first few prime numbers when divided by 6:
2, 3, 1, 5, 1, 5, 1, 5, …
Now, you might be forgiven for thinking that this sequence carries on alternating
between 1 and 5 like this forever. If only! In fact, the next few remainders are 5, 5, 1,
1, 5, 1, 5, … and there is no discernable pattern to find the next one, apart from the
fact that it will either be 1 or 5.
Why do prime numbers bigger than 3 only have remainders 1 or 5 when divided
by 6? [Hint: consider all the other possibilities and see why they can’t be true]
40
2.2.3 Power remainders*
We are going to look at patterns in the remainders of squares, cubes and so on. The
French mathematician Pierre de Fermat was the first to study this question in great
depth.
Pierre de Fermat, born in 1601, was perhaps the greatest French mathematician
of the Renaissance period, which is no mean feat considering the competition.
He made many discoveries in number theory, which he shared with others
through letters. He also laid the foundations of probability along with Pascal
(again through a series of letters between them), is credited with inventing coordinates (and analytical geometry in general) before Descartes, and he invented
methods that were later developed by Newton and Leibniz in the calculus.
All this by an ‘amateur’ mathematician!
In this section, we are going to use modular arithmetic, a description of which can
be found in the Glossary.
Using the language of modular arithmetic, the square number sequence 1, 4, 9, 16,
25, … is congruent to 1, 0, 1, 0, 1, … mod 2.
Did you look at the cubes mod 2 in the previous investigations? Here is a table of the
whole numbers (integers), squares and cubes mod 2:
Integers
Squares
Cubes
1
1
1
0
0
0
1
1
1
0
0
0
1
1
1
0
0
0
…
…
…
It would seem that all sequences of powers become 1, 0, 1, 0, ... mod 2 (check this if
you want, or better still can you explain why?).
Will all sequences of powers be the same for other divisors? No: here are the
integers, squares and cubes mod 3 – they are different:
Integers
Squares
Cubes
1
1
1
2
1
2
0
0
0
1
1
1
2
1
2
0
0
0
…
…
…
What do you notice about the last two tables?
41
You might have noticed that the integers and squares are the same mod 2, and the
integers and cubes are the same mod 3… so will the integers and powers of 4 be the
same mod 4, and so on? Let’s see:
If our conjecture is true, we would have expected that 𝑎4 (𝑚𝑜𝑑 4) would be the
same as the integers mod 4, that is: 1, 2, 3, 0, 1, 2, 3 … but this is not the case.
However, it is true for 𝑎5 (𝑚𝑜𝑑 5).
What conjectures would you like to make before investigating further?
Investigate further we find that it’s also true for modulo 7 and 11:
It appears to be true if n is a prime number! It turns out that this is indeed the case:
this result is known as Fermat’s Little Theorem and is often written
𝑎 ≡ 𝑎𝑝 (𝑚𝑜𝑑 𝑝)
for any prime p. Fermat’s Little Theorem is exciting; it gives us a rule for prime
numbers, which are few and far between. But is the converse true? That is, is it true
that if 𝑎 ≡ 𝑎𝑛 (𝑚𝑜𝑑 𝑛) then we know that n is prime? If this is true, it will give us a
way of finding primes – which would be great!
Let’s investigate with a = 2 in the table on the right. We
want to find out whether 2 ≡ 2𝑛 (𝑚𝑜𝑑 𝑛) means that n is
prime.
It would appear that it is true… the only 2𝑛 that are
congruent to 2 are when n is prime. So it seems we have
found a way of finding primes… and this is what
mathematicians thought in the 17th century.
Unfortunately, in the 18th century it was found that if we
carry on going we see that 2341 is congruent to 2 mod
42
341, but 341 is not a prime (341 = 11 x 31). So we have found an exception to the
rule, which means it can’t be true.
So Fermat’s Little Theorem is not true both ways; all we can say is that if p is prime,
then 𝑎 ≡ 𝑎𝑝 (𝑚𝑜𝑑 𝑝), but we can’t say that if 𝑎 ≡ 𝑎𝑝 (𝑚𝑜𝑑 𝑝) then p is prime!
One final note: can we ‘divide’ this equation by a like this:
1 ≡ 𝑎𝑝−1 (𝑚𝑜𝑑 𝑝)
Is this allowed? Let’s look at 𝑎𝑝−1 (𝑚𝑜𝑑 𝑝) to see if it is true:
It appears to be true, apart from when a is a multiple of p. This is indeed the case, so
Fermat’s Little Theorem becomes
1 ≡ 𝑎𝑝−1 (𝑚𝑜𝑑 𝑝)
if p is prime and a and p are relatively prime.
What is the relevance of Fermat’s Little Theorem? It is one of the most important
theorems in a branch of maths called Number Theory, which studies the properties
of the integers.
43
2.3 Negatives and zero
Negative numbers can be hard to get your head around. This is not surprising, as
most humans didn’t really accept them as proper numbers until around 500 years
ago. Here is a brief account of how they came about and how to calculate with them.
2.3.1 Some history
The first people to work with negative numbers may have been the ancient Chinese,
who used different coloured rods when dealing with negatives. Recall from chapter
one that they used red rods on a counting board to show numbers like this:
There is evidence they used black rods to represent negative numbers, and did
calculations with them, perhaps as early as 200BC. They did not need zero, as it was
a blank space on the counting board, so they did not invent it.
The birth of zero probably happened between 400 and 600AD in India. The Indian
mathematician Brahmagupta was one of the first to try and write down the rules for
working with negative numbers and zero. Here is an extract from his book
Brahmasphutasiddhanta, written in 628AD:
He describes positive numbers as fortunes and negatives numbers as debts.
Check through his rules and see if they make sense (use a calculator if it helps).
In Brahmasphutasiddhanta, Brahmagupta also set out methods for multiplying
just like those we use today. In addition, he gives algebraic methods for finding
square roots and solving quadratic equations, as well as method for summing
series.
The book also contains astronomical calculations of the planets and eclipses that
involve sophisticated use of trigonometry.
44
2.3.2 Multiplying with negatives
He did really well to get all of these rules correct. Let’s take a bit of time to look at
the rules involving products (and quotients). Most people will agree that the product
of two fortunes is a fortune. A bit of thought will convince you that the product of a
fortune with a debt is a debt (for example, 3 debts is just more debt).
How about the rule ‘the product of two debts is a fortune’ (i.e. two negative
numbers multiply to make a positive number)?
If you are not convinced why this is true, try this ‘proof’ using the grid method for
multiplication. Consider the product 27 x 38 (for example); we know the answer is
1026, so let’s use the grid method to work it
out, using 27 x 38 = (30 – 3) x (40 – 2):
So far we have got 1020, using the rules we
are intuitively happy with. Now we are left
with -2 x -3, which must be +6 in order to
make 1026.
Here’s a fun investigation that involves multiplying
negatives. Look at the following grid; each square is
going to change according to the following rule:
Multiply the signs of all the squares that share an edge
with that square, and change that square to that sign.
For example, looking at the middle top square (in red on
the left) it shares an edge with three other squares (in
green). Multiplying these green signs together, we get
positive, so the red square changes to a positive.
Here is what happens after working out the new sign
for each square.
Do this again on this new grid and see what
happens. What do you notice?
Try for other starting grids… can you explain what
is happening?
I am not going to give this one away, except to give you the hint that squares can’t
remain negative forever…
45
2.3.3 Adding and subtracting negatives
Now, time for a moment of caution! In my years of teaching secondary school pupils,
they always want to jump to nice easy rules. The classic with negative numbers is
that two negatives make a positive. We have just seen that it is true that two
negatives multiply (and divide) to make a positive. It is also true that subtracting a
negative number is equivalent to adding a positive (taking away a debt is like giving
someone a fortune).
However, it is definitely not true that adding two negatives make a positive! To see
why, consider the hours of rain and sunshine added over two days. If we have 10
hours of rain one day and 10 hours of rain the next, this is 20 hours of rain (and a
pretty bad couple of days) – it does not miraculously turn into twenty hours of
sunshine!
Another way of thinking about
this is using holes and piles, as
described by James Tanton in his
excellent book Mathematics
Galore.
There aren’t any rules for adding and
subtracting positives and negatives, it just
depends on how many you have of each.
This is shown expertly in this diagram by
one of my pupils:
And here is another way how my pupils
think of adding positives and negatives.
46
Here’s a puzzle that requires you to be able to add postives and negatives:
Write down any 4 positive or negative
numbers in a circle that have a sum of +1.
Now find the sums of all the chains of
adjacent numbers.
So, for example, with the (blue) numbers
in the circle shown on the right the
adjacent pair sums are shown in red and
the adjacent triple sums are shown in
green.
To see how these have been calculated, the red +7 is the sum of the adjacent blue
pair +3 and +4. The green +6 is the sum of the adjacent blue triple -1, +3 and +4.
In the diagram shown, there are 6 positive numbers and 6 negative numbers. The
blue numbers sum to +1, the reds to +2 and the greens to +3.
Investigate for other blue numbers of your own. What do you notice? Can you
explain why?
In order to explain why, consider the fact that if certain coloured numbers are
positive, the others of that colour must be negative.
47
2.3.4 Dividing by zero
The Indian Mathematician Brahmagupta also came up with rules for dividing with
zero. His rules are show below:
• Numbers when divided by zero are fractions with zero as the denominator
• Zero divided by a number is either zero or a fraction with zero as numerator
• Zero divided by zero is zero
Check these rules: Do they make sense? Are they correct?
You may have noticed that the first rule doesn’t really mean anything! The second
rule is correct, but the third rule is definitely questionable!
What is something divided by zero? How about zero divided by zero?
It took another 500 years for another Indian mathematician Bhaskara (1100AD) to
get closer to an answer to the problem of dividing by zero. He considered dividing 1
by smaller and smaller fractions.
Starting with 1 divided by a half = 2, we then go for 1 divided by a third = 3, and so
on... with the answer getting larger and larger. He concluded that 1 / 0 = infinity and
so n / 0 = infinity.
Do you agree with his conclusion?
One way to check whether this makes sense is to rearrange the calculation into a
multiplication. For example, 6 divided by 3 = 2 makes sense because 2 x 3 = 6.
So Bhaskara’s rule 1 divided by 0 = infinity implies that infinity x 0 = 1, which doesn’t
really make sense – so he probably should have concluded that you shouldn’t divide
by zero.
And what about 0 divided by 0? Let’s try the multiplication test on this: Suppose the
answer is some number, N. Then we are saying 0 divided by 0 = N, so that 0 x N = 0.
This seems fine, except that the number N could be anything! This time we have too
many possible answers, and we say that 0 divided by 0 is not defined. (Of course, we
could define it to be whatever we want as mathematicians, but it should have to
make sense!)
48
While we are talking about Bhaskara, here is a problem from his famous book
Lilavata (which means ‘arithmetic’), which is about fractions not zero. I found this in
the excellent book From Five Fingers to Infinity edited by Frank Swetz:
One fifth of a swarm of bees flew towards a lotus flower, one third towards a
banana tree. A number equal to three times the difference between the two
preceding amounts, O my beauty with the eyes of a gazelle, flew towards the
Codaga tree (whose bitter bark provides a substitute for quinine). Finally, one
other bee, undecided, flew hither and thither equally attracted by the delicious
perfume of the jasmine and the pandanus. Tell me, O charming one, how many
bees were there?
I wish all questions were written like this! So what’s the answer?
Well, we can call the total number of bees B. So we have B/5 going to the lotus
flower, plus B/3 going to the banana tree and 3 x (B/3 – B/5) going to the Codaga
tree. Adding the undecided one, we then have a total of:
𝐵=
𝐵 𝐵
𝐵 𝐵
+ + 3 ( – )+1
5 3
3 5
Adding the two fractions 𝐵/5 + 𝐵/3 = 8𝐵/15 (why?) and subtracting the other
two 𝐵/3 – 𝐵/5 = 2𝐵/15 so we have
𝐵=
8𝐵
2𝐵
+ 3 ×
+1
15
15
So B = 14B/15 + 1, so that there must be 15 bees in the swarm.
49
3 Fractions
Everybody loves fractions… not! I’m not sure why, but most pupils I teach start off
hating fractions, probably due to previous failures when trying to work with them.
However, I think if they realize how long it took the human race to understand
fractions, they won’t feel as bad.
Before starting this section, you should read the section on fractions in the Glossary
to remind yourself (or learn for the first time) how to calculate with fractions.
50
3.1 Babylonian fractions
Before starting this section, you should make sure you are happy with the link
between fractions and decimals, and have tried the section binary fractions.
The Babylonians used fractions in their calculations. They were using base-60, so the
columns in their number system can be extended to include fractions like this:
3600
60



units




1/60

1/3600

Notice how their first ‘fractions’ column is 1/60ths compared with our 1/10ths.
Let’s try writing some numbers using this sexigesimal system. We will represent the
gaps between columns with a comma, and the decimal point will be represented by
a semi-colon. So the number above would be:
12, 16; 4 = 12 x 60 + 16 x 1 + 4 x 1/60 = 736 and 4/60
Now, note that 4/60 is the same as 1/15. In the Babylonian system it is easy to write
this fraction, it’s just 0; 4, but in our number system its comes out to be a long
recurring decimal 0.0666…
Explore some other common fractions in sexigesimal and decimal.
Do you think the Babylonian number system is good for working with fractions?
Can you explain why? [Hint: consider the number 60]
You can see that the many common fractions can be written simply in sexigesimal
but are recurring decimals in our number system.
For example, 1/3 is the same as 20/60 which is just 0; 20. Compare this with the
decimal for 1/3, which is 0.333….. This is because 60 has many factors, and so many
fractions can be represented nicely out of 60.
The Babylonians were definitely onto something using base-60.
What would be other good numbers to use as a base? Try using different bases to
write fractions – which one is the most convenient? Convince a friend!
51
Now, let’s explore Babylonian fractions a bit further. To do this we need to know
about the reciprocal of a fraction: we find the reciprocal of a fraction by flipping it
upside down, so 2/3 and 3/2 are reciprocals.
Write down some other reciprocals. What do you get if you multiply reciprocal
pairs together?
Using 2/3 and 3/2, we get 2/3 x 3/2 = 6 / 6 = 1. In fact, any pair of reciprocals will
multiply to give 1; this is an alternative way of defining them.
What is the reciprocal the whole number 2? Or of any whole number n?
What we need to multiply by 2 to make 1 is 1/2. This also makes sense if we think of
2 as 2/1. The reciprocal of any whole number n is 1/n.
The Babylonians kept tables of reciprocals like this:
2
3
4
0; 30
0; 20
0; 15
Find the Babylonian reciprocals for 5, 6 and 10. How about 8 and 9?
They used these for dividing. For example, instead of dividing by 5 they would
multiply by 1/5. So the calculation 75 divided by 5 became 75 x 1/5, or in Babylonian
notation we have 1, 15 x 0; 12. Ignoring the sexigesimal point (the semi-colon) for a
moment, 1, 15 x 12 = 12, 180 which is the same as 15, 0 (why?). Now we reintroduce
the sexigesimal point to give 15; 0, or just 15.
I mentioned earlier that the Babylonians found an approximation to the square root
of 2. How did they do this?
They did it by successive approximations. An initial estimate of 1; 30 is too large
(what is it in our numbers?) so they divided 2 by 1; 30.
What is the reciprocal of 1; 30? Can you use this to work out 2 divided by 1; 30?
The reciprocal of 1; 30 is 0; 40 and 2 multiplied by 0; 40 is 1; 20 which is too small.
The average of the two is 1; 25. Repeating this with 1; 25 as the initial approximation
gives their approximation of 1; 24, 51, 10.
52
While we are talking about reciprocals, can you solve this problem:
Add any fraction to its reciprocal. For which fractions is the answer a whole
number?
Let’s try a few, such as 1/2, which gives 1/2 + 2/1 = 3/2 (no) and 1/3 + 3/1 = 10/3
(no). We can see this approach is not going to be very effective.
Let’s go for a bit of algebra: Let the fraction be 𝑎/𝑏, so we are adding 𝑎/𝑏 + 𝑏/𝑎
𝑎2 +𝑏2
which gives
.
𝑎𝑏
Now, for this to be a whole number, we need ab to divide into a2 + b2 so that a must
divide into b2 (why?) and also b must divide into a2. The only way this is possible is if
a and b are 1, so the only fraction we can have is 1/1!
53
3.2 Egyptian fractions
The Ancient Egyptians were one of the first civilizations to really start
thinking about fractions. However, they only used unit fractions (of
the form 1/n) and would write them like this:
The
symbol is called rho, and denotes a (unit) fraction.
How do you think Egyptians wrote non-unit fractions, like 2/5?
They would write them as sums of unit fractions. However, they did not take the easy
way out! You might have thought they would just write 2/5 as 1/5 + 1/5 but for some
reason they didn’t – they had strict rules about how fractions like this were written.
They created a table of 2/n fractions on something called the Rhind Papyrus, which
can be seen at the British Museum.
It turns out they wrote 2/5 as 1/3 + 1/15:
Is this the only way of writing 2/5 using unit fractions? How do you think they
decided which unit fractions to use? How might the Egyptians have written 2/7?
Can you find a pattern that will help you write other fractions of the form 2/n?
Or 3/n?
You could write 2/5 in lots of different ways, but the first unit fraction (1/3) is the
largest one that is smaller than 2/5, so 2/5 = 1/3 + 1/15 seems quite sensible. We
could draw it like this:
This picture suggests a method for finding other 2/n fractions:
54
So we can write 2/7 = 1/4 + 1/28.
Can you a quick way of finding these? Can you continue it? Can you adapt your
method for finding fractions of the form 3/n?
Following on this pattern we have 2/9 = 1/5 + 1/45, 2/11 = 1/6 + 1/66 and so on…
Strangely, the Egyptians did not use this pattern to write 2/n fractions. They had a
range of criteria for writing them. For example, the Rhind Papyrus gives 2/9 = 1/6 +
1/18 and 2/15 = 1/10 + 1/30 which suggests the use of the formula 2/3n = 1/2n +
1/6n.
55
3.3 Fibonacci’s fractions
Fibonacci, or Leonardo of Pisa, lived during the 13th century. Today he is mostly
famous for his sequence, of which we will learn more in chapter 6, but he did
much more important than that.
He travelled with his merchant father through many Islamic countries and came
back to Europe and wrote Book of the Abacus, which explains many methods for
calculation he found there, and advocates use of the Hindu-Arabic numerals we
use today. He is possibly the main link between Islamic mathematics and modern
Europe.
The book also contains examples of algebraic manipulation and solutions to
Diophantine equations.
In the Book of the Abacus, Fibonacci explains how to write any fraction as the sum of
unit fraction (like the Egyptians) using something called the Greedy Algorithm. The
algorithm says that you repeatedly take the largest unit fraction away from any
fraction, you will always eventually get an expression of the fraction as a sum of unit
fractions.
Let’s try it for the fraction 3/7. First we need to find the largest unit fraction less than
3/7; it is 1/3 (why?).
Then we subtract it: 3/7 – 1/3 = 9/21 – 7/21 = 2/21. Now we apply the same
process to 2/21.
What is the largest unit fraction less than 2/21?
Using equivalent fractions, 1/10 is the same as 2/20 (which is larger than 2/21),
whereas 1/11 is the same as 2/22 which is slightly smaller than 2/21, so the fraction
we’re looking for is 1/11.
Now 2/21 – 1/11 = 1/231 (using the pattern from Egyptian fractions above) and
we have the final answer 3/7 = 1/3 + 1/11 + 1/231.
Try some more applications of the Greedy algorithm. Can you spot any more
patterns? Can you explain why it always works (this is difficult)?
Consider the fraction 𝑎/𝑏, and subtract the largest unit fraction 1/𝑁 that is less than
𝑎/𝑏. If we do this we get
𝑁𝑎−𝑏
𝑏𝑁
.
Now 𝑎/𝑏 > 1/𝑁 implies that Na > b and so the numerator of this fraction is
positive.
56
Also 𝑎/𝑏 < 1⁄(𝑁 − 1) by our choice of N, so that 𝑎(𝑁 − 1) < 𝑏 which means
that 𝑁𝑎 – 𝑏 < 𝑎. What this means is that if we repeat this process then we will get
a series of fractions that are positive with ever smaller numerators, so eventually we
will get to a numerator of 1, and we will always get a sum of distinct unit fractions.
What happens if we use this process to write 1 as the sum of (distinct) unit
fractions?
1 = 1/2 + 1/3 + 1/7 + …
I’ll leave this one to you! Next we are going to learn about a method for writing and
working with fractions invented by Fibonacci. This is taken from the excellent book,
A History of Mathematics by Jeff Suzuki.
First of all, he wrote mixed numbers back to front, so instead of 5 ½ he would write
½ 5.
8
He also wrote fractions as sums of products. For example, he wrote 12
8
2
2
3
to represent
+ 3. The reason he did this was to make it easier to work with the imperial
measurements in use at the time.
12.3
Consider the measurement 5 yards, 2 feet and 8 inches. As there are 3 feet in a yard,
8 2
and 12 inches in a foot, he would write this as 12 3 5 yards.
His method also simplified division. Suppose we wanted to work out 326 divided by
24. He would split 24 into a product of factors, let’s say 3 x 8. We could write 1/24 as
1 0
1/3.8 which in his notation would be 3 8. Now he would proceed as follows:
Divide the first factor, 3, into 326 giving 108 remainder 2. He would write the
remainder 2 above the 3 in his answer. Then he would divide the second factor, 8,
into 108 giving 13 remainder 4. The 4 is then written above the 8, and his answer
2 4
would be 3 8 13.
2
4
We can check this is correct: 3 8 13 is the same as 13 + 2/3.8 + 4/8 which is 13 and
7/12, which is the correct answer.
Try Fibonacci’s method to work out some other division sums.
Can you explain how it works?
57
3.4 Galileo’s odd fractions
You probably know that 9/15 and 6/10 are equivalent to 3/5. In other words, these
are all different ‘names’ for the same (rational) number; we say that 3/5 is
irreducible, or in simplest terms. To find the simplified fraction we divide top and
bottom by any factors common to both until they are relatively prime (have no
common factors).
Here are some surprising equivalent fractions discovered by the famous physicist
Galileo:
1 1+3
1+3+5
=
=
=⋯
3 5 + 7 7 + 9 + 11
Check that these are equivalent fractions. Can you explain why this works?
Here is a picture that might help explain what is
happening:
Talking of ‘odd’ fractions, here are some equivalent fractions:
Check that these are all equivalent.
I hope you found they are all equivalent to ½.
Now, here’s a very unusual method for
‘proving’ this to be true – note: this is NOT
how to simplify fractions!
Why does this ‘work’?
Can you find other sequences of fractions that behave like this?
58
3.5 Fraction trees
One German mathematician, Moritz Stern, and one French clockmaker Achille
Brocot, independently discovered our first fraction tree, the Stern-Brocot tree, in the
19th century. Brocot used the tree to design gear systems for clock designs.
Starting with 0/1 and 1/0 (ignoring the fact that 1/0 is not allowed), we construct a
new fraction called the mediant from this by just adding the tops and bottoms (note
that this is NOT how to add fractions!).
So here we construct 1/1, and write the mediant between the previous two in
sequence: 0/1, 1/1, 1/0. Now we insert mediants in the two gaps between these
fractions to give 0/1, 1/2, 1/1, 2/1, 1/0.
Find the next set of mediants between these fractions, then the next. What do
you notice about the fractions this procedure is creating?
Here is the sequence of fractions shown
in a tree:
You can see that no fraction is
repeated, in that there are no
equivalent fractions, and that all
fractions are simplified.
What is more, it can be shown that this
procedure will create all the positive
fractions!
To see why there are no equivalent
fractions is easy; the mediants are
always between two existing fractions
by the way they are constructed.
To see why they are all simplified fractions is slightly tricky but if you’d like to then
here it is. Consider the first two fractions 0/1 and 1/0. Calling these a/b and c/d we
have:
bc – ad = 1
Now if a and b are relatively prime (have no common factors) then this equation
means that so are c and d. This is an example of something called a Diophantine
equation: more of these later. For now, you can just check this with some numbers
of your own.
Now, the next fraction we create will be (a+c)/(b+d) and putting this in place of a/b
in this equation we get (b+d)c – (a+c)d = bc – ad = 1. So the top and bottom of any
59
new fraction we create are also relatively prime – so all the fractions we create are
simplified!
It’s much more tricky to show that we also don’t miss any out; can you convince
yourself this is true?
A different way of thinking about the generating the next rows in the Stern-Brocot
tree is to consider how the ‘parent’ and ‘siblings’ are related.
Consider the parent 3/2 and its siblings 3/5 and 5/2. Can you think of a rule that
tells you how to create the siblings from the parent?
Calling the parent a/b, you might have noticed that the left sibling is a/(a+b) and the
right sibling is (a+b)/b. This gives us an easy way of generating the next rows of the
tree.
Use this method to generate the next row of the tree and compare it to the
mediant method – are they the same?
Interestingly, the Stern-Brocot tree gives us a different way of representing all the
fractions. If we use 0 or 1 to represent travelling left or right down the tree, then
each fraction can be represented by a binary string of zeroes and ones, for example
010 = 3/5.
Further than this, we can also construct the binary string from the fraction:
Starting with 3/5, if top is smaller than the bottom this is equivalent to a move Left
and we subtract the top from the bottom to give 3/2. Now the top is bigger than the
bottom, which is a move Right. This time we subtract bottom from top to give 1/2,
which is a Left, giving the root of the tree, 1/1.
Find the strings for other fractions, and construct the fractions for other strings.
Can you find any patterns?
Can you find any other patterns in this tree?
Here’s another interesting property of this tree: for each fraction a/b in the tree,
calculate 1/ab. Then add together all these values for each row and see what
happens. For example, in the third row we have 1/3, 2/3, 3/2 and 3/1. Calculating
1/ab for each of these gives 1/3, 1/6, 1/6 and 1/3. Now try this for some more
rows… anything interesting?
For more on the Stern-Brocot tree, see the book Concrete Mathematics by Graham,
Knuth and Patashnik.
60
The famous Farey series is another set of fractions constructed in the same way but
with starting numbers 0/1 and 1/1. This creates all the fractions from 0 to 1. It has
some interesting properties but I am not going to go into them here – they are freely
available on the internet.
Find out more about the Farey series.
Another interesting fraction tree is the CalkinWilf tree that has a similar construction:
Can you see how this has been constructed? Can you see any interesting patterns
in this sequence?
Do you think it produces all the fractions between 0 and 1? Can you convince
yourself this is true?
Considering parents and siblings, if the parent is a/b then each left sibling is made
from a/(a+b) as for the Stern-Brocot tree, and each right sibling is b/(a+b), which is
the reciprocal (the upside down version) of the Stern-Brocot tree.
This tree also produces the fractions between 0 and 1.
One last thing; notice how we started with different top numbers in the two
fraction trees. What happens with other starting numbers, or perhaps the same
starting number in each tree; can you find any links between them?
I’ll leave this one open to you!
61
3.6 Leibniz’s fractions
We are going to look at another one of Leibniz’s discoveries called the harmonic
triangle but before we do, a few investigations to get you started.
First let’s try adding the whole number sequence 1, 2, 3, 4, … together one by one
like this: starting with 1, then 1 + 2 = 3, then 1 + 2 + 3 = 6, then 1 + 2 + 3 + 4 = 10, …
What do you notice about the totals? Have you seen this sequence of numbers
before?
These totals are called the partial sums of the sequence. The partial sums of the
whole numbers are the triangle numbers, which makes sense if you think about it
(draw a picture if you’re not sure why)!
Here are some more to try:
Find the partial sums of the odd number sequence 1, 3, 5, 7, …
Find the partial sums of the even numbers 2, 4, 6, 8, …
Find the partial sums of the doubling sequence 1, 2, 4, 8, 16, …
Try some more of your own. What do you notice about any of them? Can you
explain why?
You may have noticed that the partial sums of the odd
numbers are in fact the square numbers. Here is a ‘proof
without words’ that shows why this is true:
The partial sums of the even numbers are double the triangle numbers (which also
makes sense if you think about it).
The partial sums of the doubling sequence are one less than the powers of 2 (think
back to the section on finger maths).
If we carry on calculating these partial sums forever (called the sum to infinity), we
will get bigger and bigger numbers that get closer and closer to infinity. Must this
always happen with the partial sums of any sequence?
Find the sum to infinity of the sequence 1, -1, 1, -1, 1, …
62
What do you think the answer to this one is? In Leibniz’s time this was a cause for
great debate. Some people though 1, others thought -1, some went for 0, while
others went for 1/2! In fact, it can be anything you want it to be. For example, if I put
brackets like this:
( 1 + -1 ) + ( 1 + -1 ) + ( 1 + -1 ) + …
then we could justify the answer being 0, but if we put brackets like this:
1 + ( -1 + 1 ) + ( -1 + 1 ) + …
then we can justify the answer being 1. It’s probably safest to say this one doesn’t
really have a sum to infinity.
Things get more exciting when we look at series involving fractions!
Find the partial sums for the halving sequence: 1/2, 1/4, 1/8, 1/16, … What do
you think the sum to infinity is?
We calculate the partial sums to be 1/2,
3/4, 7/8, 15/16, 31/32 …
If we keep doing this forever, we see that
the top number is always one less than the
bottom number, so the partial sums are
getting closer and closer to 1.
In other words, the sum to infinity of this
series is 0.999…. or is it 1? Well, a
mathematician would say they are the
same thing!
Do you agree with the statement that 0.999…. is the same as 1? Explain why you
believe what you do!
Here’s one way I think about it. What is 1/3 as a decimal? I guess you would
probably say 0.333… so let’s multiply this by 3: 3 x 1/3 is definitely 1, and 3 x 0.333…
is 0.999… so they are the same thing…?
These questions about infinity have troubled mathematicians for thousands of years
so don’t worry if you are slightly troubled too. A classic example of someone who
was troubled by infinity is Greek mathematician/philosopher Zeno.
He came up with lots of paradoxes about infinity; here is one of them, called the
Dichotomy:
63
Suppose you are in your house somewhere and want to get to the kitchen. To get
there, you must go halfway. Then once you have got halfway, you must go half of
what remains (by now you have gone 3/4 of the way), and then you must go half of
what remains again (starting to look familiar?). If we keep doing this forever, you will
never reach the kitchen therefore motion is impossible.
Do you think motion is impossible? Or alternatively do you believe that infinite series
can have finite sums, that 0.999… is the same as 1?
Find out about some more paradoxes about infinity, such as Hilbert’s Hotel or
Thomson’s Lamp.
So where were we? OK… we have seen that the sum to infinity of the previous
sequence 1/2 + 1/4 + 1/8 + … = 1. Does this mean that all fraction sequences that get
smaller like this have a sum to infinity?
Find the partial sums for these sequences and try to work out their sums to
infinity:
A.
B.
C.
D.
1/3 + 1/9 + 1/27 + ...
1/4 + 1/16 + 1/64 + ...
1/1 + 1/2 + 1/3 + 1/4 + ...
1/1 + 1/3 + 1/6 + 1/10 + …
You might have realized that A has a sum to infinity = 1/2. Here is a proof without
words to show this is true:
You might recognize B from the section binary fractions; it does have a sum to
infinity of 1/3!
How about series C and D? Well, this is where Leibniz comes in… Series C is called
the harmonic sequence, and he discovered it in his harmonic triangle:
Before reading on, can you work out how it is
constructed?
Can you see the harmonic sequence?
Can you find any other interesting patterns in the
triangle?
Can you see how it is related to Pascal’s triangle?
64
Every fraction in the triangle is calculated by adding the two below it.
For example, 1/12 + 1/4 = 1/3.
Or you could think of this as 1/3 – 1/12 = 1/4.
Now let’s concentrate on the harmonic sequence – it is there in the first diagonal.
Let’s try finding its sum to infinity.
Starting with the first two we have 1/1 + 1/2 = 3/2, then we have 1/1 + 1/2 + 1/3 =
11/6 (which is just a bit less than 2), then we have 1/1 + 1/2 + 1/3 + 1/4 = 50/24
(which is a bit more than 2)…
What do you think is the sum to infinity of the harmonic series? Can you prove it?
In fact, the sum to infinity of the harmonic series is… infinity! Here is a proof:
1/1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 + 1/8 +...
> 1/1 + 1/2 + (1/4 + 1/4) + (1/4 + 1/4 + 1/4 + 1/4) + ...
(why?)
= 1/1 + 1/2 + 1/2 + 1/2 + ...
We say that the harmonic series is divergent, compared with the previous ones,
which had a (finite) sum to infinity and are called convergent.
What is the sum to infinity for the second diagonal 1/2, 1/6, 1/12, 1/20, ...?
Finding partial sums we get 1/2, then 2/3 (=1/2 + 1/6) then 3/4 (=1/2 + 1/6 + 1/12)
then 4/5 and so on… and it looks like the top number is always one less than the
bottom one (can you prove this?). This is just like the halving sequence, and so we
should be safe to say its sum to infinity is 1.
Finally, How about the last one, series D: 1/1 + 1/3 +
1/6 + 1/10 + …? For this one, look closely again at the
harmonic triangle:
65
To find this sum, Leibniz noticed that the sum of the differences of any increasing
sequence a, b, c, d, e, ... , z is just the last term subtract the first term, that is z - a.
Try this out to see if it is true.
By the way it is constructed, the numbers in the second diagonal of the harmonic
triangle are the differences of the first diagonal. So the sum of the differences 1/2 +
1/6 + 1/12 + ... is the same as the last term subtract the first term of the first
diagonal, namely 1/1 - 0 = 1.
Now we can see that series D: 1/1 + 1/3 + 1/6 + ... is double this series, so must have
sum to infinity = 2.
Leibniz's exploration with infinite series and the harmonic triangle led to his
discovery of the calculus, one of the most important mathematical developments in
history.
66
3.7 Euler’s Totient Numbers
Leonard Euler was possibly one of the most famous mathematicians of all time.
He lived during the 18th century and made many discoveries about mathematics,
in areas such as calculus, analysis, trigonometry and number theory, proving
many results that had not previously been proved. He also invented whole new
branches of mathematics such as graph theory.
He also invented much of the notation we used today, including function notation
and complex numbers, and has a number named after him: e = 2.71828….
I am a particular fan of his formula V – E + F = 2 which gives a relation between
the vertices, edges and faces of any convex polyhedron, but most people prefer
his other equation 𝑒 𝑖𝜋 = 1.
Here is one of the questions he pondered:
For how many of these fractions is n the least possible denominator?
1
2
, ,…,
𝑛 𝑛
𝑛−1
𝑛
For example, with n = 4 we have ¼ and ¾ where 4 is the least possible denominator,
and 2/4 where it is not. So there are 2 fractions with 4 the least possible
denominator.
Find the number of fractions for n up to 12. Any patterns?
Here is a table of results for denominators bigger than 2:
67
You might have spotted a few interesting things, such as the number of fractions is
always even. Will this always be true, and if so, why?
Also, for prime numbers, the number of fractions is one less than the denominator.
This makes sense because all fractions do not simplify if the denominator is prime.
So this clearly has something to do with prime-ness.
We can think of it in a different way as being the number of numbers that are
relatively prime to the denominator. This number is called Euler’s totient function,
usually written using the Greek letter phi 𝜙(𝑛). So we would say that 𝜙(12) = 4.
Here are some more exciting things about it.
Find 𝜙(𝑛) for some more non-prime numbers n. Can you see any connection
between 𝜙(𝑛) and the totient numbers for the factors of n?
You might have spotted that 𝜙(12) = 4 = 2 × 2 = 𝜙(4) × 𝜙(3), or that 𝜙(15) =
8 = 4 × 2 = 𝜙(5) × 𝜙(3). In fact, it is always true that 𝜙(𝑚𝑛) = 𝜙(𝑚) × 𝜙(𝑛) if m
and n are relatively prime (this is called a multiplicative function).
If we try really hard, we might be able to find a formula for working out 𝜙(𝑛). Let’s
consider 𝜙(100).
What is 𝜙(100)? Can you think of any systematic ways of working it out without
having to list everything?
Well, numbers that have common factors are those with a factor of 2 or a factor of 5
(why?). So of the 100 numbers we can get rid of 1/2 of them (for the factors of 2),
which is 50, and then another 1/5 of those left (for the factors of 5) which is another
10, leaving 40. So 𝜙(100) = 40.
We could have calculated this as 100 x 1/2 x 4/5 = 40. This is leading us to conjecture
a formula.
Try some other calculations like this. Can you come up with a formula yourself?
Don’t worry if you couldn’t follow in the footsteps of the great Euler. It turns out that
the formula is:
1
1
1
𝜙(𝑛) = 𝑛 × (1 − ) × (1 − ) × (1 − ) × …
𝑝
𝑞
𝑟
Where p, q, r, … are the different prime factors of n. We can test this formula out for
ones we know, like this:
68
1
1
2
4
𝜙(15) = 15 × (1 − ) × (1 − ) = 15 × × = 8
3
5
3
5
Test the formula out for some other numbers to check it works.
One last amazing thing about Euler’s totient function is that if we add up all the
totient numbers for the factors of some number n, it will equal the number itself.
For example:
𝜙(10) = 𝜙(1) + 𝜙(2) + 𝜙(5) + 𝜙(10) = 1 + 1 + 4 + 4 = 10
69
3.8 Recurring decimals*
You should try the section on binary fractions and Babylonian fractions before trying
this section.
Have you ever wondered why some fractions have nice well-behaved decimals like
1/4 = 0.25, which stop after a couple of decimal places (terminating), while others
are more badly behaved like 1/7 = 0.14285714… which go on forever (recurring)?
Well, after looking at binary and Babylonian fractions you may have already realized
it has something to do with our number system. For example, 1/3 = 0.333… is badly
behaved for us, but for the Babylonians it equals 0;20 which is nice!). So what exactly
makes a fraction recur?
Investigate different decimal fractions on a calculator. Put them into two lists of
terminating and recurring ones. Can you describe exactly what makes a fraction
terminate or recur?
For the recurring ones, can you see any further patterns?
After a bit of investigating you may have noticed that terminating fractions have a
denominator that is a multiple of 2 or 5. Why exactly does this mean that they
terminate?
Let’s look at 1/4, which means 1 divided by 4, which means ‘how many 4s are there
in 1?’ Using long division we get the terminating decimal 0.25. Looking at the way
long division works, for a decimal to terminate we need a zero remainder at some
point in the calculation:
70
Another way of thinking about this is to say that 4 doesn’t go into 1 or 10, but does
go exactly into 100, which is exactly why this terminates after 2 decimal places.
To use the terminology of modular arithmetic, we can say that 100 ≡ 0(𝑚𝑜𝑑 4). So
really this is about powers of ten. If any power of ten is congruent to 0 for the given
denominator then it will terminate.
Let’s look at the congruences of powers of 10 under different mod n, where n can be
thought of as the denominator of some fraction.
mod
2
3
4
5
6
7
8
9
100
1
1
1
1
1
1
1
1
101
0
1
2
0
4
3
2
1
102
0
1
0
0
4
2
4
1
103
0
1
0
0
4
6
0
1
104
0
1
0
0
4
4
0
1
105
0
1
0
0
4
5
0
1
106
0
1
0
0
4
1
0
1
107
0
1
0
0
4
3
0
1
108
0
1
0
0
4
2
0
1
These are basically the remainders you get when you do the long divisions for each
one (try them).
You might have noticed a few things from this table:





10 is congruent to 0 mod 2 and 5, which means 1/2 and 1/5 have only one
decimal place in their decimals.
100 is congruent to 0 mod 4 as we saw earlier, which means 1/4 has two
decimal places in its decimal.
1000 is congruent to 0 mod 8, so 1/8 terminates after 3 decimal places
(=0.125)
The fractions 1/3, 1/6, 1/7 and 1/9 never terminate as they never have 0
remainders.
The red squares are examples of Fermat’s Little Theorem in action:
1 ≡ 10𝑝−1 (𝑚𝑜𝑑 𝑝) for p = 3 and 7.
Let’s look at the recurring decimals in more detail now. We can see from the
remainders how the decimals recur. For example, all the remainders for 3 and 9 are
the same, which is why they have the same number in their recurring decimal.
Similarly, 6 = 0.16666 has the same remainder (4) apart from the first one.
71
The most interesting number here modulo is 7. It cycles through all the remainders 1
to 6 before going back to the start (remainder 1). We say it has cycle length 6.
Here are the steps in the long division of 1/7 set out one after another:
1=0x7+1
10 = 1 x 7 + 3
30 = 4 x 7 + 2
20 = 2 x 7 + 6
60 = 8 x 7 + 4
40 = 5 x 7 + 5
50 = 7 x 7 + 1 ≡ 0 x 7 + 1
We can see by step 6 we are back to where we started, with a remainder of 1, which
is why it has a cycle of 6. If we think about this for a bit longer, it’s fairly obvious that
the longest cycle we can ever have is one less than the denominator, and this only
happens if we cycle through all the possible remainders.
Investigate the cycle lengths of other decimal fractions. Can you find any fractions
with cycle lengths one less than the denominator like 7? What can you say about
the cycle lengths of different fractions in general?
It turns out the next fraction with cycle length 1 less than the denominator is 1/17.
You might have conjectured that 1/13 = 0.07692307 was going to be one, but it only
has a cycle length of 6.
You might have also have noticed that all the cycle lengths are factors of one less
than the denominator (6 is a factor of one less than 13).
At this point you have probably realized that it has something to do with primality.
Well, yes it has; all numbers that are relatively prime to 2 or 5 will not terminate as
they will never have 0 remainders.
Putting this all together, we can finally say that 1/n will be a recurring decimal with a
cycle length a factor of n-1 if n is relatively prime to 10.
72
3.9 Greek Ladders
Here is something called a Greek ladder from around 100AD, although there is
evidence it may have been known to Indian mathematicians 500 years earlier as it
appears in their Sulba-Sultras, religious texts that contained instructions on how to
construct altars to high levels of precision. The Sulba-sultras gave a way of
constructing squares equal to the sum of two smaller squares, also showing that
they were aware of Pythagoras' theorem before the Greeks.
A
1
2
5
12
29
70
B
1
3
7
17
41
99
Write down as many patterns as you can see in these numbers.
One pattern you might have noticed is that each row is created from the one above
it as (A+B, 2A + B).
What do you think these numbers represent? [Hint: try writing A and B as a
fraction]
You can get more of an idea what the numbers might represent by squaring each
number like this:
1
4
25
144
841
…
1
9
49
289
1681
…
Now you might see that 𝐵 2⁄𝐴2 is approximately 2. So 𝐵⁄𝐴 is an approximation for
the square root of 2. The approximation gets better as the ladder goes down. We
can never use this method to get the exact value of √2 as it can’t be written down as
a fraction – it is called an irrational number (fractions are called rational numbers).
Try typing 90/77 into your calculator. How close is it to √2? Find the next few
numbers on the ladder and see how close they are to √2.
73
A different way of thinking about the numbers for A and B are as solutions to the
equation 𝐵 2 − 2𝐴2 = ±1, which is an example of a Pell’s equation, named after
English mathematician John Pell.
A different way of making the ladder is to start with A = 1, 3, … and B = 1, 2, … then
use the rule that the next number is 2x the one before it plus the one before that.
So the A numbers are 1, 3, 7, 17, 41, … and the B numbers are 1, 2, 5, 12, 29, …
This method is linked to something
called continued fractions.
The continued fraction of root 2 is
given by the (infinitely) repeated
fraction on the right.
Understanding continued fractions is a
bit tricky; if you want to skip this bit that’s OK. If not, then here goes:
1
3
Starting with 1, we then have 1 + 2 = 2, followed by 1 +
1
2+
1
2
=1+
1
5
2
2
7
= 1+5=5
and so on.
Here is a different Greek ladder:
1
1
3
4
11
15
1
2
5
7
19
26
Can you work out what it is for?
Another way of thinking about this is to choose different rules for creating fractions.
For the first Greek Ladder, we could have created these numbers using the rule
(a+2b)/(a+b), so starting with 1/1, we then get 3/2, then 7/5 and so on.
What fractions does the rule (a+3b)/(a+b) create? Investigate other rules like this
and see what sequences of fractions you can create. Why not try different
starting numbers too?
If you start with 1/1 and do (a+3b)/(a+b) you get the sequence of fractions 1/1, 4/2,
10/6, 28/16, 76/44 which at first sight doesn’t look familiar, but if you simplify each
fraction you get the Greek ladder above, which is an approximation for √3.
Why not find out more about irrational numbers, Pell’s equations and continued
fractions?
74
3.10 Problem of the points
Fractions are also used to work out probabilities. Here is a little taste:
In 1654, two French mathematicians Pascal and Fermat sent each other several
letters about an old problem studied by Luca Pacioli (a mathematician friend of
Leonardo da Vinci) as early as 1494. The problem was this:
Two players are playing a game of chance (let’s say throwing a coin) and the winner
is the first to get to an agreed number of points (heads). How should the winnings be
divided fairly if the game is interrupted before the end?
Suppose it is first to 10 and the score is 9-8. How would you share out the
winnings of (say) £100 if the game is interrupted at this stage?
Pacioli’s solution was to divide the winnings according to the points the players had
scored before the game was interrupted. However, Pascal and Fermat noticed that
this lead to unfair results; suppose the score was 1-0 and it was first to (say) 10. Then
player 1 would get all the money but it is by no means certain that they are going to
win.
So they devised a way of sharing the winnings that was based on the probabilities of
what might happen in the future.
Suppose it is first to 10 and the score is 9-8. Can we work out the probability of each
player winning? Yes we can, using a probability tree like this:
It is clear from the tree that player 1 has a ¾ chance of winning, compared with
player 2’s chances of ¼. So the winnings should be shared in the ratio 3:1 in this
case.
Calculate the ratios for sharing the winnings for some other scores. Can you find
an easy way to work out the ratios? [Hint: it is connected to Pascal’s triangle]
75
In the example given, the score is 9-8 and the winner is the first to get 10 points.
Player 1 requires only 1 point (head) whereas player 2 requires 2 points (tails). We
showed (using a tree diagram) that the probabilities of winning were ¾ and ¼
respectively, so the winnings should be shared in the ratio 3:1.
Instead of drawing a tree diagram, we could have just looked at the number of ways
of getting 1 or more heads (player 1 win) in two tosses of a coin compared with the
number of ways of getting 2 tails (player 2 win). Note that although the game ends if
the first throw is a head, we can still analyse it in this way.
So player 1 wins if the ‘two’ tosses are HH, HT or TH compared with TT only for
player 2, and we have the ratio 3:1.
We could work out this ratio even quicker using Pascal’s triangle as this is exactly
what the numbers represent. Looking at the third row we can work out the fair way
to share the money by doing 1+2:1
To see the ease of this method, suppose that the score is 8-7 so that player 1
requires 2 points and player 2 requires 3 points. If you draw the (rather large) tree
diagram or list all the possible outcomes you will see that the winnings should be
split in the ratio 11:5.
However, a glance at the fifth row of Pascal’s triangle reveals this answer
immediately:
We will find out more about Pascal’s life and discoveries later.
76
3.11 Pigeonhole fractions
Pick any 5 numbers from 1 to 30 and make all the possible fractions out of them.
Can you choose 5 numbers so that none of the possible fractions are between 1
and 2 inclusive?
For example, suppose we choose 2, 15, 24, 6 and 12. Then we have failed because
15/12 and 24/15 are both between 1 and 2, and 24/12 is equal to 2.
OK, so it seems like it might not be possible – can you prove why?
One way to think about this is to say if we choose 1, then we must choose 3, 7, 15
and our fifth number would have to be 31, which we haven’t got. These are the
Mersenne numbers.
A different way of thinking about this is to use something called the Pigeonhole
principle. Suppose we split the number 1 to 30 into groups that contain up to double
the first number, then we have:
{1, 2}, {3, 4, 5, 6}, {7, 8, 9, 10, 11, 12, 13, 14} and {15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30}.
Now we can’t choose two from one of these groups, but as we need 5 numbers and
there are only 4 groups, there is no possible solution.
77
4 Primes
Why are many mathematicians obsessed with prime numbers?
Prime numbers are the building blocks of all the numbers – in the 19th century Gauss
proved that all (whole) numbers can be written as a unique product of primes. But
there is no simple formula that can tell us the nth prime, or whether a given number
is prime. Arguably the most important unsolved problem in Pure Mathematics, the
Riemann Hypothesis, concerns the distribution of the primes.
That said, there are some patterns in the primes; this section is designed to be a
gentle introduction to prime numbers and seeking patterns in them.
78
4.0 Prime Clothing
There are numerous items of clothing that have designs based on the primes. I
particularly like this prime factorization jumper created by Sondra Eklund:
Can you see how it works? If you can’t quite work it out, here’s the pattern with the
first few numbers on it:
Can you spot any patterns in the columns or diagonals of this pattern?
Can you create your own prime factorization pattern?
You can see that each prime factor has a colour code (2 = blue, 3 = red, etc.) so each
square shows which prime factors, and how many of them, occur in each prime
factorization.
79
If we put them in 6 columns we get:
You can clearly see the primes in
columns 1 and 5.
We can also see the multiples of 2 and 3
in columns and multiples of 5 and 7 in
the diagonals.
Here is another t-shirt that is
interesting!
80
4.1 Numbers as shapes
What shape is a number? For example, what shape is the number 4? Here are a few
different representations:
If we stick with squares and rectangles, then we get the following
We could think of the prime numbers as 1xp rectangles.
Using blobs, we could have something like this:
81
Notice how the primes appear as circles as they can’t be grouped like the other
numbers.
The online applet ‘Primitives’ groups the first few numbers like this:
These pictures give a beautiful way of showing prime factors; notice how the primes
are colour coded.
Explore some other ways of representing numbers as shapes.
82
4.2 Finding primes
It is not easy to find out if a number is prime; you have to divide it by all the numbers
up to its square root and see if any of them divide into it.
The Sieve of Eratosthenes gives a systematic way of doing this; make a grid of
numbers, say 1 to 100, and cross out all the numbers that are in all n times tables
(apart from n itself).
Here is an example:
I quite like drawing this like this:
What can you say about prime numbers by looking at this grid?
One important aspect of prime numbers is that all the ones bigger than 3 are in
columns 1 and 5 (we say they are of the form 6k+1 or 6k-1, or that they are
congruent to 1 or 5 mod 6).
83
Can you explain why this is true?
We can eliminate all the other possibilities one by one. Numbers in the 6 th column
are in the 6x table, numbers of the form 6k+2 and 6k+4 (columns 2 and 4) are
divisible by 2 and numbers of the form 6k+3 (column 3) are divisible by 3.
The twin prime conjecture says that there are an infinite number of primes that
are 2 apart (such as 5 and 7). Find some twin primes. Why does the above
discussion suggest this might be the case?
As primes either 6k+1 or 6k-1, the often appear in twins one more and one less than
a multiple of 6. The twin prime conjecture appears true but has remained a
conjecture for thousands of years, but recently (2013) there have been considerable
advances towards proving it. It is particularly remarkable that these advances were
made using reasonably simple mathematics by a relatively unknown mathematician.
Find out more about the work towards a proof of the twin prime conjecture.
A prime triple is three primes that are 2 apart, such as 3, 5 and 7. What does this
picture tell us about other triple primes?
The first prime triple is 3, 5, 7. There are no more because that would mean we
would have to have another prime in the third column (of the form 6k+3), but 3 can
be the only one.
Here is another way to find primes. Look at this image of the 2x table drawn as a
curve through the number line:
When we add the 3x table, we get:
84
Notice how some numbers (such as 6) have been crossed twice. Now let’s add the 4x
table:
Make one of these of your own and draw in all the times tables up to say 15.
When you have drawn your curves,
pick a number and highlight all the
curves that go through it, like this
one for 6:
What does the number of curves through a given number tell us about that
number? What more can we say about how many times each number is crossed?
The number of crossings will tell us the number of factors (excluding 1 if we don’t
complete the 1x table).
Note also that all the numbers will be crossed an odd number of times (if we exclude
1) apart from the square numbers (why?).
Incidentally, here is another interesting ‘sieve’ discovered by relatively unknown
Indian mathematician S. P Sundaram in the early 20th century.
Using the numbers 4, 7, 10, 13, … in the first row, the numbers in each column go up
by 3, 5, 7, … and so on like this:
85
Before reading on, try doubling all the numbers and then adding one. What do
you notice?
Doubling the first few numbers and adding one gives 9, 15, 21, 25, 27, 33, 35, and so
on. These numbers are obviously odd (why?) but what else can you say about them?
Have a look at all the odd numbers that are not in this list; what can you say?
You have probably noticed by now that if a number k is in this sieve, then 2k + 1 will
not be a prime number.
We can prove this with a little algebra; ignore this if it’s too difficult:
Let m represent the row number, and let n represent the column number. Then any
given number k in the sieve is given by the expression (1+3m) + (n-1)(2m+1). Now we
can work out 2k + 1 and after a bit of algebra we get 2k + 1 = (2n+1)(2m+1) which is
not prime; it is the product of two odd numbers.
86
4.3 Prime games
4.3.1 Last prime
Here is a Nim-like game to help you get familiar with the prime numbers called Last
prime. Before starting this game you should read about Nim in the Glossary.
Two players alternatively hold up any number of fingers from one to five. The
cumulative total is noted down. The object is to keep the total prime. The first player
unable to raise the total to a higher prime is the loser.
If you play first, how many fingers should you hold up?
Play this again but with both hands (10 fingers). What should you start with this
time?
1 hand: You should hold up 5 fingers on your first go. Then the game is fixed to
follow this pattern: 5, 7, 11, 13, 17 and then there is a gap of 6 to the next prime so
player 1 is the winner.
2 hands: This follows a similar principle but is just a bit longer. The first primes that
are more than 10 apart are 113 and 127. So you are aiming to be the first to 113.
Working backwards, you can create safe positions: 113, 101, 89, 73, 61, 47, 31, 19
and so you should start with 7 fingers.
Oh, by the way, is there a last prime, or do they go on forever?
It turns out that primes go on forever; there is no last, or largest, prime. Greek
mathematician Euclid (more about him later) proved this with the following
argument:
Suppose there is a largest prime, P. Then make the number N = 2.3.5.7…P + 1 which
is made by multiplying all the primes together and adding 1. This number must have
a prime divisor Q (as all numbers are divisible by primes). Now, Q isn’t one of the 2,
3, 5, 7, … , P primes otherwise it would divide 2.3.5.7…P and therefore it would
divide 1 = N – 2.3.5.7…P (why?). This doesn’t make sense; Q can’t divide 1 because
it’s bigger than 1, so we have a contradiction – our assumption that there is a largest
prime P must be false. So we conclude there are infinitely many primes.
This is called proof by contradiction, or Reductio ad Absurdam, and is a common
method of proof.
Why all this fuss, you might say? Can’t we just say that the number N = 2.3.5.7…P + 1
is just a prime bigger than P (as it clearly doesn’t divide by any of 2, 3, 5, 7, …, P) and
we have proved there are infinitely many primes straight away?
87
Work out 2.3.5…P + 1 for different values of P. Is it always prime?
The first few are:
2+1=3
2.3 + 1 = 7
2.3.5 + 1 = 31
2.3.5.7 + 1 = 211
2.3.5.7.11 + 1 = 2311
So far so good, but unfortunately the next one isn’t prime: 2.3.5.7.11.13 + 1 = 30011
= 59 x 509. This is an instance of what mathematician Richard Guy calls The Strong
Law of Small Numbers, which basically says you should be really careful about
making conclusion by just looking at the first few (small) numbers in a pattern.
In that article, he mentions a related pattern that may always produce primes:
Subtract each product from the next prime after the numbers in the sequence above.
For example, the first few are:
5–2=3
11 – (2 x 3) = 5
37 – (2 x 3 x 5) = 7
223 – (2 x 3 x 5 x 7) = 13
[e.g. 37 is the next prime after 31 above]
Find the next few. Do you believe this sequence will keep producing primes?
Unfortunately, a proof of whether this is true does not exist – can you be the first to
prove it??
There are many other proofs that there are infinitely many primes. Here is one that
uses Fermat numbers; it’s quite tricky but let’s have a go at it anyway. Fermat
numbers are of the form 2n+1 where n is a number from the ‘doubling’ sequence 1,
2, 4, 8, 16, …
What are the first few Fermat numbers? What do you notice about them?
88
The first few Fermat numbers are:
F0 = 2 1 + 1 = 3
F1 = 2 2 + 1 = 5
F2 = 24 + 1 = 17
F3 = 28 + 1 = 257
F4 = 216 + 1 = 65,537
F5 = 232 + 1 = 4,294,967,297
You might have noticed that they are all odd, which is definitely true (why?), and you
may have conjectured that they are all prime. If you did, you are in good company;
Fermat himself believed them all to be prime, but could not prove it. In fact, it took
none other that Euler to prove that they are not all prime, by showing that
4,294,967,297 is divisible by 641! For a proof of how he did this, see the book
Journey Through Genius by William Dunham.
Now, back to our proof there are infinite primes. First of all, the fact they are all odd
is going to be important later on. However, if you are really switched on, you might
have also noticed that each one is made by multiplying all the ones before, and
adding 2. For example, 5 = 3 + 2, 17 = 3.5 + 2 and 257 = 3.5.17 + 2. It turns out this is
always true, which we can prove using a technique called mathematical induction
(see the Glossary for this bit).
Now this means that if some number divides any two Fermat numbers, then it must
also divide 2 (why?) so any common divisor of two Fermat numbers must be 1 or 2.
But 2 doesn’t divide any Fermat number as they are all odd! So any common divisor
of two Fermat numbers must be 1. This means all Fermat numbers are relatively
prime.
Why does this mean there are infinity many primes? Well, the Fermat numbers
definitely go on forever – we can just keep making them. This, coupled with the fact
that are relatively prime means that each new one will always have new prime
factors, so there are infinitely many primes!
Investigate other numbers of the form 2n + 1. What can you say about them?
For n = 1, 2, 3, etc we have 3, 5, 9, 17, 33, 65, 129, 257, and so on. You might have
noticed that all the odd ones are divisible by 3.
To see why we first note that 22 is congruent to 1 (mod 3), so that then any power of
this will also be congruent to 1 (mod 3). So any even power of 2 is congruent to 1
(mod 3). Now multiplying this by 2 gives an odd power of 2, which must be
congruent to 2 (mod 3). Now if we add one to this, we are back to 0 (mod 3) – i.e. 2n
+ 1 is divisible by 3 for odd n.
89
4.3.2 Prime Nim
Here is a more complicated variation on the game Nim. Start with one pile of
counters (of any size). Each player can only take 1 or a prime number of counters.
What is a good strategy for this game?
Trivially, if we start with a prime number of counters, player 1 wins straight away.
If we don’t start with a prime number of counters, a few games reveal that we are
trying to get to the safe position of 4 counters, from which our opponent must take
1, 2 or 3 leaving us with a win.
We can do this as player 1 by getting the safe position of a multiple of 4 on each go
(by taking 1, 2 or 3) unless we start on a multiple of 4 in which case player 2 would
win by the same strategy.
Try changing the rules so maybe there is more than one pile.
What happens if we do not include 1 as a prime?
Let’s look at the game with three piles (1 still included). In the first version of the
game about, we simplified the game by only considering the remainder the pile on
division by 4, as we can always reduce piles by 4 by taking 1, 2 or 3 counters.
We can also do this with three piles. In the case of 1, 5 and 10 counters, we can
simplify these to remainders 1, 1 and 2. Now it is clear that we should take 2 from
the large pile to get to the standard safe position of an even number of binary digits.
When we play with 1 not included, this game is much more difficult to analyze
because we can no longer take 1 and use the multiple of 4 strategy.
Playing the games a few times we realize that sometimes we will get to positions
where 1 counter is left. I suppose we should then change the rules to say the last
person who can take any counters is the winner (so leaving your opponent with 1
counter constitutes a win). So if we are on 4 (say), a winning move is to take 3.
The safe positions I have found so far are 9, 10, 18, 24, 30, … For example: 9 is safe
because your opponent can only take 2 (leaving 7), 3 (leaving 6 which is a winning
position), 5 (leaving 4 which is a winning position) or 7 (leaving 2).
It might seem safe positions have something to do with multiples of 6, but not all of
them are; for example 42 isn’t safe because your opponent could take 23 leaving you
with 9 which is a safe (losing) position. It seems that there is no simple formula for
safe positions in this game, which is probably to be expected if we are dealing with
primes!
90
4.4 Prime factorization
4.4.1 Factor trees
The fact that any whole number has a unique prime factorization is very important.
Usually prime factors are found using a factor tree. Here are lots of different ways of
prime-factorizing 300:
However you do it, you probably notice that they all come up with the same answer,
2 x 2 x 3 x 5 x 5.
But did you also notice that:
-
They all have 4 pairs of factors too?
-
There is one even pair of factors in each?
-
There is one pair of factors that are both divisible by 5. (In the third one
above, the even pair is also the pair that is divisible by 5)?
-
The rest of the pairs are relatively prime?
Can you explain any of these facts? Investigate similar facts for other prime
factorizations.
- Why do all the factorizations of 300 have 4 pairs of factors?
One way of looking at this is to think of the prime factors as squares of chocolate
that we are going to snap off into single blocks. Moving along a branch of the factor
tree is like snapping the bar of chocolate along a line. So the factorization of 300 on
the right below could be represented by breaking a chocolate bar like this:
91
We will always need 4 breaks to break this chocolate bar into single squares. In
general we will need n-1 breaks to break up a chocolate bar with n squares (see the
game Choco Choice in the section on Parity).
Another way of thinking about this is join pairs of prime factors together (reversing
the factorizing process) to make composites like this:
Then we can see that there must be four pairings to get 5 numbers to 1.
- Why is there one even pair of factors in all factorizations of 300?
If we look at the even and odd factors in the above diagram, we can see that pairing
two odds created another odd and we pair an odd and even, we create another
even; in each case the number of evens does not change. If we pair two evens then
we reduce the number of evens by one. So as there is only two even prime factors in
300, we can only have one even pairing; as soon as we pair them (whenever we do
it) we only have one even left.
92
Generally, pairing two even numbers reduces the evens by one, so if we have n even
factors we will have n-1 even pairs.
This is also the case with the multiples of 5. So for 300 we have one even pair, one
multiple of 5 pair, and the rest are relatively prime as they are contain combinations
of different factors.
Fermat came up with an algorithm for factorizing large numbers. Starting with the
number N, let m be the smallest number such that m2 is bigger than N. For example,
if we have N = 187, then m = 14 as 142 = 196.
Now work out m2 – N, (m+1)2 – N and so on until a perfect square is reached. In this
case we have 196 – 187 = 9, and we have found a perfect square straight away.
Now as m2 – N = x2 (in this case with x = 3) we can rearrange to give N = m2 – x2 and
you might recognize this as the difference between two squares. It is a fact that we
can write the difference between two squares as (m+x)(m-x), in this case (14+3)(143) and we have our factorization: 187 = 17 x 11.
Check the formula given for the difference between two squares m2 – x2 =
(m+x)(m-x) works for some other numbers m and x.
Now try Fermat’s factorization method for N = 9271. [Hint: 729 = 27 2)
First of all, note that m = 97, then successively calculate 972 – 9271, 982 – 9271 until
you find a square. You should have got the sequence 138, 333, 530, 729, … (this
sequence is increasing by 2 more each time) and then realizing 729 is a square we
have 1002 – 9271 = 272 and so 9271 = 1002 – 272 = (100+27)(100-27) = 127 x 73.
Does this work for all numbers? Let’s try 300. We have m = 18, and so 18 2 – 300 = 24,
then 192 – 300 = 61, 202 – 300 = 100, which is a perfect square, so 300 = 202 – 102 =
(20+10)(20-10) = 30 x 10. Then we perform the same calculation on 30 and 10 until
we get to the prime factorization!
93
4.4.2 Uniqueness
Have you ever thought about the uniqueness of prime factorization?
To prove that the prime factors of a number are unique, we need something called
Euclid’s Lemma, which says that if a prime p divides a composite number r x s, then
either p divides r or p divides s.
Try this out for yourself.
Suppose there were two different prime factorizations of 300. We know one
factorization is 2.2.3.5.5; the other one could either have 5 different factors, or a
different number of factors altogether.
Let the other factorization be p.q.r.s.t.u…. for some other primes p, q, r, … How
can you use Euclid’s Lemma to prove that the factorization 2.2.3.5.5 is unique?
Suppose there are two different prime factorizations of 300. One is 2.2.3.5.5, the
other is p.q.r.s.t.u…. for some other primes p, q, r, …
By repeated applications of Euclid’s Lemma, the prime p must divide one of the
factors 2, 3 or 5, in which case it must be one of 2, 3 or 5. If we carry on this logic,
the other factors q, r, etc. must also be one of each of the other factors of 2.2.3.5.5
and so all prime factorizations are unique.
Here is a different proof. Suppose we know that all the numbers up to n have a
unique prime factorization. If n is composite then let’s suppose it can be written as
the product of primes in two different ways as above. These two factorizations can’t
share a prime otherwise we would cancel by this prime and we have a number
smaller than n that can be written as the sum of two primes, which is not true by our
assumption.
Let p be the smallest prime in the first factorization, and P be the smallest prime in
the second one. As n is composite (so has at least one other factor) then n > p 2 or n >
P2 and we definitely have n > pP. Now consider n-pP, which has a unique
factorization (by assumption, as it is smaller than n). As p divides n, it must divide n –
pP, as must P. So pP divides n – pP, which means that pP divides n.
But this can’t happen. If pP divides n, then P must be one of the prime factors in the
first factorization of n, which we have said at the start can’t happen. So our
assumption that n has two different factorizations is false. Now because it’s true for
all numbers less than, and true for n, we can say by mathematical induction that it is
true for all n.
94
4.4.3 Defining primes
How would you define a prime number?
One common definition is to say that a prime is any number with exactly two factors,
1 and itself. A different way of saying this is that if a prime number (greater than 1)
is written as the product of two numbers, exactly one of them must be 1.
Consider a world in which only even numbers existed. Would these definitions of
primes be any good now? How would you define primes now? Which numbers
would be prime under your definitions?
We haven’t even got the number 1 anymore, so we definitely have to change these
definitions! To start with, we must define the basic unit of our number system – for
normal numbers it is 1 (or -1), but for the even numbers it might make sense to say
the unit is 2.
If we stick with the usual rule that the unit can’t be a prime, we then have the first
few primes for the even numbers: 4, 6, 8, 10, 12 and 14. The first non-prime is 16,
which can be made from 4 x 4. Notice that some of the numbers don’t even have a
product any more, like 6, as there is no number 3.
What are the primes in the world of odds, assuming 1 to be the unit?
Investigate other worlds of numbers, such as a world where the only numbers are
1, 5, 9, 13, 17,…? (Let’s call these Hilbert numbers, after the mathematician David
Hilbert who invented this example, and make the unit 1).
Strictly speaking, our normal definition of primes is actually called irreducibility.
Primes are more exactly defined in an alternative way: a prime is any number p such
that if p divides any number made by multiplying two numbers together (a x b), then
p must divide one of these numbers.
Are these two definitions the same thing? If not, how are they different?
Can you find an example where a number has more than one factorization into
irreducibles? [Hint: use the Hilbert numbers]
In Hilbert numbers, 693 can be written as 9 x 77 and 21 x 33. Each one of these
factors is irreducible; factorization into irreducibles is not necessarily unique.
Consider a different world where the only numbers are 1 and the evens. If 1 is the
unit, what are the primes now?
95
4.5 Greatest Common Divisors
4.5.1 Relative primes and the GCD
Two numbers are relatively prime if they do not share any common (prime) factors.
This is strongly tied up to the idea of a greatest common divisor (GCD). If two
numbers are relatively prime then their GCD is 1.
Find some pairs of numbers that are relatively prime.
Two numbers being relatively prime is important in maths. We have already seen
that if two numbers a and b are relatively prime, then we will not be able to simplify
the fraction a/b.
A good way of presenting numbers and their prime factors is through a Venn
diagram, named after English mathematician John Venn (although they were
possibly invented by Leonard Euler).
Here are the prime factors of 300 =
2.2.3.5.5 and 36 = 2.2.3.3 placed in a
Venn diagrams.
We can see that they are not relatively
prime as they share common factors.
In fact, we can say a bit more than this. The GCD of these two numbers is the
product of the factors in the middle, which here is 2.2.3 = 12.
A further by-product of this method is that you get the Lowest Common Multiple
(LCM) for free! If you take the product of all the numbers in the Venn diagram you
get the LCM, so here it is 2.2.3.3.5.5.
What are the drawbacks of this method? Try it for two larger numbers like 3108
and 5291.
This method suggests that the GCD and LCM are closely connected – can you see
how?
The Venn diagram method is good for small
numbers; we would not want to use it for large
numbers as the prime factorization takes a long
time.
96
Using the example shown, 300 = 2.2.3.5.5 and 36 = 2.2.3.3 and we have that GCD =
2.2.3 and LCM = 2.2.3.3.5.5.
How are these connected? Well, if we do GCD x LCM we get 2.2.2.2.3.3.3.5.5 which
is the same as 300 x 36. This is indeed always the case, so we have the rule:
𝑙𝑐𝑚(𝑎, 𝑏) × gcd(𝑎, 𝑏) = 𝑎 × 𝑏
This gives us a handy way of finding the LCM if we know the GCD (and vice versa).
One thing we can conclude from this is that if two numbers are relatively prime, then
gcd(a,b) = 1 and then we have 𝑙𝑐𝑚(𝑎, 𝑏) = 𝑎 × 𝑏.
There are other ways of finding the GCD. The Greek mathematician Euclid came up
with an algorithm for finding the GCD to two numbers.
Euclid took all the Greek work on maths, tidied it all up and put it in his book The
Elements in around 300BC. Little is known about Euclid, and there are some
people who do think Euclid may not have been one person, but rather a group of
scholars.
The Elements is possibly the most important work in the history of maths. For the
first time we are given a rigorous basis of axioms, or definitions, from which many
theorems are proved using sequences of logical steps. This process forms the
basis of mathematics today. The Elements contained many proofs about
geometry and number theory, and culminated in a full description of the Platonic
solids.
The famous first words of The Elements are:
• A point is that which has no part.
• A line is breadthless length.
• The extremities of a line are points.
It is reported by some to be the 2nd largest selling book of all time, and was still
being used in classrooms until the 1950s.
Euclid noticed that any number that divides two numbers (let’s call them a and b)
also divides their difference (can you see why?). So a, b and a - b are all divisible by
GCD(a,b). We can use this to find the GCD by successively taking the smallest from
the largest, until we get two numbers the same like this:
GCD(20,12) = GCD(8,12) = GCD(8,4) = GCD(4,4) = 4.
This is a shortened version of the full algorithm that is usually used; here is the usual
form of Euclid’s algorithm to find GCD(5291, 3108):
97
5291 = 1 x 3108 + 2183
3108 = 1 x 2183 + 925
2183 = 2 x 925 + 333
925 = 2 x 333 + 259
333 = 1 x 259 + 74
259 = 3 x 74 + 37
74 = 2 x 37 + 0
The last non-zero remainder is 37, and this is the greatest common divisor of 5291
and 3108.
We can get an idea of how it works by ‘undoing’ the calculation from the bottom up.
From the bottom line, we can see that GCD(74,37) = 37. Now, moving one line up, as
37 is the GCD of 37 and 74, it must also be the GCD of 259. We can carry on moving
up the calculation like this until we can conclude that 37 is the GCD of 5291 and
3108.
Here is another interesting method for finding GCDs:
Look at these lines. How is the number of lattice points (integer co-ordinates)
connected to the GCD?
If you pick a co-ordinate on one of the lines, say (12,8), and go along its line starting
at the origin, we pass through 4 lattice points (integer co-ordinates). This
corresponds to the fact that the greatest common divisor of 12 and 8 is 4. This works
for any lattice point.
98
Now, let’s consider standing at the point (0,0) and looking out at the ‘forest’ of
lattice points. Some of them will be ‘visible’ from where we are standing and some
will not. For example, (6,4) is obscured by (3,2), so (6,4) is not visible, while (3,2) is.
What can you say about the co-ordinates of the visible points?
From the previous discussion you will probably have realized that the visible points
are all those that are relatively prime (with GCD = 1).
Find all the visible lattice points for axes numbered 0 to 10 (say). Any patterns?
Are there any lines that contain all visible points?
Are there any lines that contain no lattice points at all?
Here are the visible points on axes 0 to 10:
99
There are some simple patterns here, such as symmetry in the diagonal (45 degree)
line from (0,0) (why?). You may have also noticed that the horizontal and vertical
‘prime’ have lots of visible points, the only non-visible ones being multiples of the
number (why).
Perhaps more exciting than this
is the fact that there are lines
that contain all visible lattice
points, shown in the diagram on
the right.
Can you explain what is
special about these lines, and
why they contain only visible
points?
You might have noticed that
these lines all go through prime
numbers on the axes.
Why do they contain only visible points? If we add the co-ordinates (x, y) of each
point on these lines, this equals the prime number they go through, so we have x + y
= prime. Now, there can be no number (apart from 1) that divides into x and y,
otherwise it would also divide into the prime which is not possible (why?). So x and y
are relatively prime, and so they are visible.
There are lines that never touch
any lattice points, such as the
one shown:
This is the line 𝑦/𝑥 = √2. This
number is called irrational; y and
x can never be whole numbers
(lattice points) on this line.
There is a proof that √2 is
irrational in the introduction to
the section on Parity.
We can also link this to our work
on Greek Ladders in chapter 3.
Look at the visible points that come close to the line. They are (2,3) and (5,7), which
are numbers in the Greek Ladder for √2. If we extended the line further up, we
would find that it gets nearer and nearer to lattice points (12,17), (29, 41) and so on,
but never actually goes over one.
100
Euclid’s algorithm can also be used to write fractions as continued fractions:
For example, here is the algorithm for 67 and 24, to help us find the continued
fraction for 67/24:
67 = 2 x 24 + 19
24 = 1 x 19 + 5
19 = 3 x 5 + 4
5=1x4+1
4=4x1+0
So we can see that these numbers are relatively prime (the last non-zero remainder
is 1). Now if we divide through by the middle number on each line we get:
67/24 = 2 + 19/24
24/19 = 1 + 5/19
19/5 = 3 + 4/5
5/4 = 1 + 1/4
Starting at the bottom line, we have 5/4 = 1 + 1/4, the reciprocal of which (4/5)
19
1
appears in the next line up, so we have
= 3 + 1
5
1+
4
We can carry on to the next line up to get
And finally we have
67
24
= 2 +
24
19
1
1+
= 1 +
1
3+
1
1
1+
4
which is nice.
1
1
3+ 1
1+
4
Why are continued fractions useful? Well, we have already seen that they can be
used to approximate irrational numbers (see Greek Ladders), but they can also be
used to solve Diophantine equations – see the next section!
101
4.5.2 Prime stars
You have probably made some star doodles at
some point. If you haven’t, draw some dots
(roughly) evenly round a circle and join them
missing a few each time. Here are a few:
The first number is the number of dots and the
second number is how many missed each time.
Which ones make good stars? Well, they’re all
good, but my favourite are the ones that go back
to the start without taking pen from paper (in
one go).
Find some other stars that can go back to the start without taking pen from
paper. What can you say about the ones that go back to the start?
I was thinking it was something to do with the first number being prime (5 and 7
here), so I drew a few more:
As you can see, it is not as simple as the first number being a prime number, as (8,3)
and (10,3) both work.
So what is it about?
102
If the number of dots and the size of jump
are relatively prime, we get a star that can
be drawn without taking pen from paper.
Generally, the number of stars we get is the
greatest common divisor of the two
numbers.
So if they are relatively prime, the GCD is 1,
and we get a star that can be drawn without
taking the pen from paper.
We can see that for GCD(9,3) = 3, and we get
3 separate stars.
103
4.5.3 Diophantine equations
GCDs are important in the theory of Diophantine equations, named after the first
person to study them, the Greek mathematician Diophantus. They are concerned
with finding integer (whole numbers including the negatives) solutions to equations
and are still being studied by mathematicians to this day.
To start with, we are going to look at Diophantine equations of the form 𝑎𝑥 + 𝑏𝑦 =
𝑐. Here is a classic puzzle:
How can you weigh any object (that weighs a whole number of kilograms) on a
pair of balancing scales with a (infinite) set of 2kg and 3kg weights?
How can we weight this elephant if she weighs 1kg? How about 100kg?
We can weigh the 1kg elephant like this:
This means that we can any integer-weight elephant by putting on multiples of 2kg
and 3kg weights. For example, we could weigh a 100kg elephant with 200 x 2kg
weights on the left pan, and 100 x 3kg weights on the right pan.
So to work out the weight of any elephant (x kg), we just place weights in the ratio
2:1 as shown until we get a balance.
This problem is the same as trying to find two integers x and y that solve
2𝑥 + 3𝑦 = 1. How many different solutions can you find?
104
As we saw above, one solution to the equation 2𝑥 + 3𝑦 = 1 is x = 2, y = -1, where
the negative value represents putting a weight on the opposite scale. There are
infinitely many others (such as x=5, y=-3).
More generally, we can solve any equation 2𝑥 + 3𝑦 = 𝑐 with x = 2c, y = -c.
Now suppose we had 2kg and 4kg weights instead; can we weigh any elephant
now? Which elephants can we not weigh? Can you weigh a 1kg elephant?
After a bit of trial and error you will have realized that you can’t weigh any odd
weighted elephants.
Now try solving 2𝑥 + 4𝑦 = 1. Is it possible?
There are no integer solutions to the equation 2𝑥 + 4𝑦 = 1 for the same reason as
above. Substituting different values of x and y into the expression 2𝑥 + 4𝑦, we soon
realize that we can only generate even numbers.
Why? Substituting values for x and y into expression 𝑚𝑥 + 𝑛𝑦, we can only generate
multiples of the GCD of m and n. So if m and n are relatively prime (as in our first
example with m = 2 and n = 3) then we have a GCD of 1 and we can generate any
multiple of this i.e. any integer. But with m = 2 and n = 4 we can only generate
multiples of GCD(2,4) = 2
Now, can you tell by looking at these Diophantine equations if they will have
solutions?
(a) 2𝑥 + 3𝑦 = 2
(b) 3𝑥 + 6𝑦 = 99
(c) 4𝑥 + 6𝑦 = 99
Based on this we can work out if there are solutions to the following Diophantine
equations:
(a) 2𝑥 + 3𝑦 = 2
has (infinite) solutions as GCD(2,3) = 1
(b) 3𝑥 + 6𝑦 = 99
has (infinite) solutions as 99 is a multiple of GCD(3,6) = 3
(c) 4𝑥 + 6𝑦 = 99
has no solutions as 99 is not a multiple of GCD(4,6) = 2
Now, as promised in the previous section, here is how continued fractions can be
used to solve Diophantine equations.
Let’s use the example 67/24 to solve a Diophantine equation involving 67 and 24,
let’s say 67𝑥 + 24𝑦 = 1. We know this is solvable from the previous section
(why?).
105
Starting with the finished continued fraction, we have
67
24
= 2 +
1
1+
1
1
3+ 1
1+
4
Now we can snip off the very last fraction to get another fraction that is very close to
1
1
1
4
14
67/24, so we have: 2 +
= .
1 = 2 +
1 = 2 + 5 = 2 +
5
5
1+ 1
1+
4
3+
1
4
How close is 14/5 to 67/24?
Subtracting gives
67
24
–
14
5
=
67×5−14×24
120
=
−1
120
This is exciting, but did you notice that we have just solved our Diophantine
equation? Look again at the top line in our calculations: it shows that 67 x 5 – 14 x 24
= -1, or 14 x 24 – 67 x 5 = 1. If we compare this with the equation we are trying to
solve, we have one solution for x and y, namely x = -5 and y = 14.
How can we use this to find other solutions? Well, now we know one solution, we
can use this trick:
Let a general solution be x = -5 + 24t and y = 14 – 67t. Putting this into our equation,
we know that 67(−5 + 24𝑡) + 24(14 − 67𝑡) = 1 because 67 x -5 + 24 x 14 = 1
and 67 x 24t – 24 x 67t = 0. So choosing any integer for t gives us other solutions!
Now let’s turn our attention to other Diophantine equations of other types.
Pythagoras’ Theorem 𝑎2 + 𝑏 2 = 𝑐 2 is a Diophantine equation with infinite solutions,
whereas Fermat’s Last Theorem says that 𝑎𝑛 + 𝑏 𝑛 = 𝑐 𝑛 has no solutions for n > 2.
What (integer) solutions can you find to the equation 𝑥 2 − 𝑦 2 = 1? How about
𝑥 2 − 𝑦 2 = 2?
For which values of c does the equation 𝑥 2 − 𝑦 2 = 𝑐 have solutions?
The first equation has 4 pairs of solutions: x = 1, y = 0, x = -1 y = 0 and x = 0, y = 1 and
x = 0, y = -1. How about the second one, 𝑥 2 − 𝑦 2 = 2? Trying numbers for x and y, it
seems unlikely that there are any solutions.
We could prove this by noticing that the expression 𝑥 2 − 𝑦 2 is the expression for the
difference of two squares. So we can rewrite the second equation as (x+y)(x-y) = 2
which has one solution x + y = 2 and x – y = 1 (or vice versa). Neither of these has
integer solutions; if we add these two equations together, we get 2x = 3 which gives
x = 3/2 (not an integer).
106
A bit of experimentation leads us to realize that all odd values for c have solutions,
which we can see by noticing that the odd numbers are the differences between the
squares numbers 1, 4, 9, 16, ....
How about the even numbers? We have no solutions for 2, solutions for 4 (what are
they?), no solutions for 6, solutions for 8, … which leads us to think that there are
solutions if c is a multiple of 4.
To see why, consider the factors of multiples of 4; we can always find two even
factors (why?) so that (x+y) and (x-y) are both even. When we combine the two
equations together we get 2x = even, so x (and therefore y) have integer solutions.
Why not explore other Diophantine equations, or find out more about Fermat’s
Last Theorem?
107
4.6 Prime sequences
4.6.1 Linear prime sequences
Linear (arithmetic) sequences are sequences that go up by the same amount each
time, such as 5, 9, 13, 17, 21, … (this one is has nth term 4n+1).
You may have noticed that this sequence contains quite a few primes. Roughly
what percentage of the primes do you think are in this sequence?
You can see the primes in this sequence by looking at this grid; the primes are
coloured in red:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
The primes bigger than 2 only appear in rows 1 and 3 (why?).
There are an infinite number of primes, and it was shown by French mathematician
Dirichlet that there are an infinite number of primes in the sequence 4n + 1 and 4n +
3 (and indeed any other linear sequence an + b where a and b are relatively prime).
There are 6 primes in the third row (4n+3) and only 4 in the first row (4n+1) in the
table above. The 4n+3 primes are leading the race so far; do you think they
always will?
Famous English mathematician John Littlewood proved that leader of the race
between 4n+1 and 4n+3 primes changes infinitely often. It has also been shown that
the sequence 4n+1 contains around half the primes, the other half being in 4n+3
(apart from 2 of course).
The sequence at the start of this section has 2 primes in a row (13 and 17). Does
this sequence ever have more than 2 primes in a row?
Can you find a sequence with 3 primes in a row? Or more? Find some other linear
sequences that contain a lot of primes [hint: look at the previous section!].
The sequence 4n+1 can only ever contain at most two primes in a row. To see why,
consider two consecutive primes in this sequence; they must be of the form 6n+1
then 6n+5 (like 13 and 17) as they are 4 apart. But then the next number in this
sequence will be 6n+9, which is not prime. The sequence 4n+3 starts with 3 primes
in a row (3,7,11) but, for similar reasons, this never happens again.
108
From the previous section we know that two other linear sequences containing all
the primes between them (apart from 2 and 3) are 6n+1 and 6n+5. The sequence
6n+5 starts with a run of 5 primes (5, 11, 17, 23, 29) but this is as good as it will ever
get.
Can you prove why? [Hint: use the sieve of Eratosthenes above, or use an
algebraic argument as above for 4n+1].
I’ll leave this one to you! Here’s one last question about 4n+1 and 4n-1 numbers:
Choose any odd number. Work out whether it has more 4n+1 (including 1) factors
or more 4n+3 factors. What do you think is the probability it has more 4n+1
ones?
For example, 21 has an equal number (1 and 21 compared with 3 and 7), whereas
45 has more 4n+1 ones (1, 5, 9 and 45 compared with 3 and 15).
The famous French mathematician Adrien-Marie Legendre proved that there will
always be more 4n+1 factors! In fact, he showed more than this; he showed that the
number of ways of writing a number as the sum of two squares is 4(F +1 – F+3) where
F+1 is the number of 4n+1 factors and F+3 is the number of 4n+3 ones.
So for example, 21 can not be written as the sum of two squares as F+1 = F+3.
However, 45 can be written as the sum of two squares in 8 ways (noting that order is
important!
45 =
(6)2 + (3)2
(6)2 + (-3)2
(-6)2 + (3)2
(-6)2 + (-3)2
(3)2 + (6)2
(-3)2 + (6)2
(3)2 + (-6)2
(-3)2 + (-6)2
How many ways are there of writing 65 as the sum of two squares?
109
4.6.2 Quadratic prime sequences
The spiral on the right is called the Ulam spiral,
named after Polish-US mathematician
Stanislaw Ulam.
Continue the spiral and then circle all the
prime numbers. What do you notice? Why do
you think this is?
Why have I started at 41 instead of 1? Explore
spirals starting with different numbers.
You will probably have noticed that most of the primes
between 41 and 100 lay on the diagonal.
What is the function that generates this diagonal
sequence 41, 43, 47, 53, 61, ...?
We can work out the function that generates this sequence by working out the
differences like this:
Now let’s halve the bottom number and call that a (so a = 1). Subtract this from the
middle number and call this b (so b = 2 – 1 = 1) and call the top number c (= 41).
Now we put these into the expression 𝑎. 𝑛2 + 𝑏. 𝑛 + 𝑐 to give 1. 𝑛2 + 1. 𝑛 + 41; this
is the function we need.
Check that this function produces the sequence given.
Putting n = 0, n = 1, n = 2, … into the function gives 41, 43, 47, … so it works.
110
Here is a larger image of the Ulam spiral showing where the primes occur:
Notice how many of the
primes seem to lie on
diagonals.
The triangle below is called the Klauber triangle, named after Laurence Klauber, an
American amateur mathematician and expert in rattlesnakes (!):
Continue the triangle and circle the primes. Can you find any interesting patterns?
What happens if you start the Klauber triangle with a different number at the top,
like maybe 41?
Here is the Klauber triangle with the primes in red:
26
17
27
10
18
28
5
11
19
29
2
6
12
20
30
1
3
7
13
21
31
4
8
14
22
32
9
15
23
33
16
24
34
25
35
36
111
Notice how primes seem to appear in columns; the column starting with 5 looks
promising as a prime sequence.
What function is it? Let’s extend the columns upwards to create a rectangle like this
-4
-2
2
8
16
26
-3
-1
3
9
17
27
-2
0
4
10
18
28
-1
1
5
11
19
29
0
2
6
12
20
30
1
3
7
13
21
31
2
4
8
14
22
32
3
5
9
15
23
33
4
6
10
16
24
34
5
7
11
17
25
35
6
8
12
18
26
36
Can you work out the function for the column we are interested in?
Using the method above, the three numbers we need are -1 (top), 2 (first difference,
middle) and 2 (difference of the differences, bottom). Our method gives the function
𝑛2 + 𝑛 − 1. [You can test this by putting n=0, n=1, n=2, etc into it and check you get
-1, 1, 5, 11, …]
Unfortunately this function does not produce primes for much longer; the next one
is 41 (prime) but then the next one is 55 (not prime).
As we move along the columns to the right the sequences are all one higher than
before. So the middle column which is two to the right of our original one is the
function 𝑛2 + 𝑛 + 1, which does quite well at generating primes too.
If we keep going along to the right, we’ll eventually get to the function 𝑛2 + 𝑛 + 41,
which we now generates lots of primes. Here is a larger image of Klauber’s triangle
showing where primes occur, with this function shown as a vertical red line:
The function 𝑛2 + 𝑛 + 41 was first discovered by Euler.
112
Does this function generate primes forever? If not, when does it stop?
This function generates primes until n = 40. Putting n = 40 into the expression gives
402 + 40 + 41 = 40(40 + 1) + 41 = 40 × 41 + 41 = 412 = 1681.
So this polynomial generates 40 primes. Other quadratics that generate lots of
primes are 𝑛2 + 𝑛 + 17 and 2𝑛2 + 29. Christian Goldbach, a German
mathematician, proved that there is no function like this (polynomials with integer
coefficients) that will generate primes forever.
There are two ways to work out functions. You can substitute n=0, n=1, n=2 into the
function (as above). Or, supposing I gave you the first few terms of the sequence 41,
43, 47, 53, … then you might notice that the differences go 2, 4, 6, … Carrying this on
you can guess the differences will carry on 8, 10, … and can work out the next
numbers in the sequence.
This idea was used by Charles Babbage when building his Difference Engine. To see
how it worked, look at following sequence and its differences:
Given the function 𝑛2 + 𝑛 + 41 he would work out the first few terms by hand,
which he put into the machine. The machine would then calculate the differences,
and the differences of the differences (called the 2nd differences) and so on. When it
got to a set of differences that stayed the same (here, the 2nd differences are all 2),
the computer then used these to calculate all the rest of the numbers in the
sequence (or values of the function) like this:
The difference engine could find the value of any polynomial function just by using
differences and repeated addition (which was easier to do than multiplication).
Polynomials were important as they were used to approximate logarithms and
trigonometric functions, which were used in engineering.
113
Charles Babbage was an English mathematician and inventor/engineer who lived
in the 19th century. Among other things, he analyzed the post and recommended
that all mail go at the same rate (called the ‘penny post’). He also invented
railway signals and the speedometer, and devised a system of lighthouse
signalling. He was also good at picking locks and deciphering codes.
Babbage was very passionate about mathematics. He was one of the first people
to realise that mathematics was really a branch of logic. This lead to his invention
of the Difference Engine, and later the Analytical Engine.
He came up with the idea when correcting log tables - incorrect log tables were
hugely costly to engineers and navigators – and realized that a machine could do
the calculations much more efficiently. He spent most of his life dedicated to
building this machine although he never saw it built.
Whilst giving a speech about his new machine, mathematician Ada Lovelace
translated his words and added twice as many notes of her own, and in doing so she
created the first ever computer program.
A man called Leslie Comrie who was head of the Nautical Almanac Office in
Greenwich used a Babbage machine to compute motions of the moon for working
out tidal patterns. In 1928 an American man who was doing the same job by hand
came over to Greenwich and found what he had been doing. This man went back to
the USA and told some mathemticians about it, including someone called John von
Neumann, who then built what is regarded as the first ever computer as we know it
today.
Investigate some other quadratic sequences such as n2 + 1 or n2 – 1. Do they
contain primes?
First let’s look at n2 + 1. The first few terms, with the primes in red, are 2, 5, 10, 17,
26, 37, 50, 65, 82, 101, … This sequence seems to generate quite a few primes. It is
not yet known whether it will continue to produce primes forever.
Now let’s look at n2 – 1. The first few terms are 0, 3, 8, 15, 24, 35, 48, 63, 80, 99, 120,
… and we can see that none of these are prime! To see why, consider the difference
of two squares, n2 – 1 = (n+1)(n-1). This suggests why these numbers are generally
not prime; they can be split into factors.
Look at the odd terms in this sequence. What can you say about them? Can you
explain why?
We see that when n is odd we have 0, 8, 24, 80, 120, 168, …You may have noticed
that all of them are divisible by 8, and all alternate ones are divisible by 3 as well, so
are divisible by 24.
114
To see why, use the difference of two squares again. We are looking at odd terms so
that n is odd, which means n – 1 and n + 1 are consecutive even numbers, which also
means that one of them is a multiple of 4 (why?). So n2 – 1 = (n+1)(n-1) is made by
multiplying a multiple of 2 and a multiple of 4, which is a multiple of 8.
For the alternate ones, n is not divisible by 3 (n = 1, 5, 9, etc) so either n – 1 or n + 1
must be (why?). This means that n2 – 1 = (n+1)(n-1) is also a multiple of 3.
115
5 Number sequences
Following on from our investigation into primes, and thinking of numbers as shapes,
here are some further investigations into shapes and pattern in numbers.
There will be some number patterns that you have seen before (Pascal’s triangle and
Fibonacci’s sequence) but hopefully with some new insights, and some patterns you
may not have seen before; enjoy!
116
5.1 Triangle numbers
Triangle numbers appear in the strangest of places…
5.1.1 Counting crossings
How many crossing are there when a number of straight lines cross each other?
What is the maximum number of crossings with 3 straight lines? How about 4?
How about n?
Here is a picture of one of my pupils trying to solve
this problem on a mini-whiteboard:
You can see the pattern 1, 3, 6, 10, … the triangle
numbers.
Can you convince yourself with a good reason
why this is happening?
So we can see the next picture will have 15 dots
(crossings). So how does this answer our question
for how many crossings will be possible with any
number (n) of lines?
One way to see this is if we double each triangle number, giving 2, 6, 12, 20, 30, …
and then noticing that these numbers are 1x2, 2x3, 3x4, 4x5, … so we can say that
triangle numbers are half of these numbers, giving the rule ½ x n x (n + 1).
Another way to see this is to consider two
triangles put together like this:
We can see that each triangle is half a
rectangle.
So the 1st triangle number is ½ x 1 x 2, the second is ½ x 2 x 3 and so on until we have
the nth triangle number is ½ x n x (n + 1) for any number n. We can check this
formula for the 5th triangle number = ½ x 5 x (5 + 1) = ½ x 5 x 6 = ½ x 30 = 15.
Triangle numbers pop up all over the place: Here they
are in Pascal’s triangle.
You should definitely read about Pascal’s triangle in
the Glossary, and maybe go online to find out even
more; it is going to pop up in lots of the investigations
we are going to do here! Make sure you understand
117
the comments about combinations in there before moving on.
Ready for a second puzzle about counting crossings? OK, here goes:
How many crossings are there in these diagrams (not counting the dots
themselves)? Can you see a pattern? Can you predict how many are in the next
pattern with 6 dots?
There are 0, 1 and 5 crossings in these diagrams. What
is this pattern? What comes next? The 6-dot diagram
on the right reveals that there are 15 crossings.
You might have spotted these numbers in the 5th
diagonal of Pascal’s triangle above! You might want to
check the 7-dot diagram has 35 crossings, but then
again you might not!
Why are these numbers in this diagonal of Pascal’s triangle? Well, let’s think
carefully about what the numbers in Pascal’s triangle represent; they are the
numbers of ways of choosing things. The fifth diagonal represents the number of
ways of choosing 4 things…
So each crossing matches to one way of choosing 4
things. What are these 4 things in this puzzle? They are
the four dots from which we draw lines to make each
crossing!
Here is a picture showing one of the ways of choosing
4 dots, and the crossing that comes from it.
Let’s dig a bit deeper:
118
How many lines are there in these diagrams (ignoring the lines that make the
circle?
How many regions (spaces) are there inside the circle for each of the diagrams?
Can you see any patterns? Can you see any connections between the crossings,
lines and regions?
No prizes for guessing that the number of lines follows the triangle numbers!
As for regions, the first diagram has 4 regions, the second has 8 and the third one
has 16. From this you might conjecture that the next one has 32, but it doesn’t.
Counting them in the 6-dot picture, there are 31 – no, you haven’t miscounted and
no, there isn’t a way of drawing it so there are 32. Assuming you draw them so there
are no double crossings (thus giving the maximum number of triangles possible), you
will always get 31.
So the sequence goes 4, 8, 16, 31, … Can you predict how many regions will be in
the 7-dot circle?
Now draw it nice and big, without any double crossings, and see if your prediction
was correct.
I bet you didn’t guess there would be 57? If you draw it correctly, this is how many
there should be. So where are these numbers coming from? To see how, notice
something extraordinary - that the number of regions is always one more than the
number of lines plus the number of crossings.
So we have a pattern in the lines (3, 6, 10, 15, …) and a pattern in the number of
crossings (0, 1, 5, 15, …), giving the sequence in the number of regions:
4=3+0+1
8=6+1+1
16 = 10 + 5 + 1
31 = 15 + 15 + 1
57 = 21 + 35 + 1
This is just another example of Richard Guy’s Strong Law of Small Numbers – don’t
jump to conclusions! You can’t tell just by looking!
We have to dig deeper to understand why before we can start making predictions!
119
Here’s one last puzzle that involves counting crossings, taken from James Tanton’s
fantastic book Math Without Words.
Draw two lines and make a few points on each (here
I’ve done 2 at the top and 3 at the bottom). Now
connect each top dot to each of the bottom ones and
count the crossings (making sure no crossings overlap):
here the number of crossing is 3.
Can you come up with a general rule for this puzzle with any number of dots on
the top and bottom? Can you explain it?
Using * to represent the number of crossings, we have 2 * 3 = 6 for the diagram.
Working systematically, here are a few more:
2*2=1
2*3=3
2*4=6
3*3=9
3 * 4 = 18
3 * 5 = 30
4 * 4 = 36
4 * 5 = 60
It seems that there are triangles of triangles going on here. For example, for 2 * n we
have just the triangle numbers, for 3* n we have 3 x triangle numbers, and for 4 * n
we have 6 x triangle numbers.
So generalizing to m * n, I think we can go for a formula something like:
m * n = ∆𝑚−1 × ∆𝑛−1
where ∆𝑚 is the mth triangle number from 1, 3, 6, 10, ....
Test the formula to see if it works!
It seems to; for example 3 * 4 = ∆2 × ∆3 = 3 x 6 = 18.
120
5.1.2 Triangle patterns
So, what other rules and patterns can we find about triangle numbers 1, 3, 6, 10, …?
What happens if you add two consecutive triangle numbers together?
How about adding triangle numbers 2 terms apart? Or 3 terms apart?
Try squaring triangle numbers… explore what happens when you add/subtract
consecutive triangles squared?
You will have noticed that any two consecutive triangle numbers
add to make a square number (eg 6 + 10 = 16).
More precisely, the 3rd and 4th triangle numbers sum to make the
4th square number, which you could write like this:
Δ3 + Δ4 =⊡4
Or more generally, Δ𝑛−1 + Δ𝑛 =⊡𝑛 .
If we add triangle numbers that are two terms apart, we get a
picture like this, which suggests the identity:
Δ𝑛−2 + Δ𝑛 = 2. Δ𝑛−1 + 1
This basically says that if you add triangle numbers two terms apart, you get double
the one between them plus 1 - check this to see if it works.
There are lots of other identities you can find by dividing the
triangles up in different ways, like this:
This one suggests the identity: Δ2𝑛 = 3. Δ𝑛 − Δ𝑛−1
Or perhaps: Δ2𝑛 = 2. Δ𝑛 +⊡𝑛
You can put triangles together in other ways to give some
more interesting identities… this one is a classic:
This suggests that the (odd) squares can be made by adding
8 triangles + 1, or more precisely:
⊡2𝑛+1 = 8. Δ𝑛 + 1
What do you get if you do 9. Δ𝑛 + 1? Can you explain what is happening using a
diagram?
121
Squaring triangle numbers leads to some interesting identities too. Here is the
squared triangle sequence: 1, 9, 36, 100, …
Can you see any interesting patterns in this sequence?
The difference between the terms gives to the sequence 8, 27, 64, which is the cube
numbers, which we could write as ∆2𝑛 − ∆2𝑛−1 = 𝑛3
Can you use a diagram (or better still, multi-link cubes) to explain why this is
happening?
Here is a diagram showing how this might work for n = 3. Try making the same
diagram for n = 4 and convince yourself it is works.
122
Here’s another way of thinking about it: Make a square from two triangles as above,
using Δ𝑛 + Δ𝑛−1 =⊡𝑛 . We need n of these squares to make a cube; here’s a picture
of this for n = 3:
Now, we know that 𝑛 = Δ𝑛 − Δ𝑛−1 so that we have:
𝑛(Δ𝑛 + Δ𝑛−1 ) = (Δ𝑛 − Δ𝑛−1 )(Δ𝑛 + Δ𝑛−1 ) = 𝑛3
Multiplying out the brackets (see difference of two squares) gives ∆2𝑛 − ∆2𝑛−1 = 𝑛3 as
required.
If all this wasn’t enough, here’s one last pattern involving triangle numbers:
How many triangles are in each one?
If you just count the black and white ones you have sums of consecutive triangle
numbers, which we know gives the square numbers.
Hold on, but what about all the other sized triangles? For example, in the second one
you have the 4 triangles plus the 1 large (2x2) one, which makes 5 in total.
So then looking at the third triangle again we have 9 small ones, 3 2x2 ones, and one
3x3 one, which makes 13.
123
Now can you come up with a rule the total number of triangles in each one?
If all this counting triangles is not enough for you, try this one:
How many triangles are there in each of these diagrams (you might recognize
them from counting crossings)? Can you find a pattern? Can you explain it?
How many triangles will be in the next one with 6 dots?
The number of triangles in these 3 diagrams is 1, 8 and 35. To see how there are 8 in
the second one, there are two ‘types’ of triangles (red and green in the diagram
below) and in the third one there are three types of triangles (red, green, blue).
To see how we get 35 in the third one, there are 5 reds
(points of the pentagram star), 20 blues (4 triangles are
made by the crossings of 4 points, and there are 5 ways
of choosing these 4 dots), and 10 greens (there are 10
ways of choosing 3 dots to make a triangle).
We can use this idea to visualize the 111 triangles in the
6-dot example:
124
Where do the numbers 20, 15, 6 and 1 come from? Well, they are the numbers of
ways of choosing 3, 4, 5 and 6 dots from the total of 6 - see the notes on Pascal’s
triangle in the Glossary for more on this.
Just another example of Richard Guy’s Strong Law of Small Numbers!
125
5.1.3 Triangle cakes
Here is a puzzle about triangle numbers:
Danny likes eating cake, and he likes triangle numbers. He comes to a round table
with 25 types of cake around it numbered 0 to 24. He decides to go round the
table trying every triangle numbered cake. So he starts by eating cake number 0,
then cake number 1, then cake number 3, then numbers 6, 10, 15 and 21.
However, he doesn’t stop when he gets to 24, he keeps going as though cake 0
was cake number 25, cake 1 is now cake 26 and so on, so next he would have
eaten cake 3 (or cake 28 depending on how you look at it) if only he hadn’t eaten
it already!
What is the next cake he will eat?
If he carries on in this way, will he eat all the cakes? Will he eat half the cakes?
This is the order in which he eats the cakes: 0, 1, 3, 6, 10, 15, 21, 3(already eaten),
11, 20, 5, 16, and back to 3(still already eaten).
You may have noticed something strange: at all the places he arrives from now on,
he has already eaten the cake. In fact, he goes back to all the cakes in reverse, so he
only gets to eat 11 of the cakes!
Suppose Danny had decided to eat the square number cakes instead… would he
have had more success? Can you explain why?
This time Danny gets to eat cakes 0, 1, 4, 9, 16, 11, 24, 14, 6, 21 and 19 – still only 11
cakes!
This happens because there is a 1-to-1 match between triangle numbers and squares
numbers, given by the identity ⊡2𝑛+1 = 8. Δ𝑛 + 1.
This is linked to quadratic residues – more about these later.
126
5.1.4 Multiplication tables
This investigation is derived from the excellent book What to Solve? by Judita
Cofman.
Everyone loves multiplication tables.
Investigate numbers given by the
squares and L-shapes shown.
What did you find out? You might have spotted that the sum of the numbers in each
increasingly large square are 1, 9, 36, 100, ... This is the squared triangle numbers we
found earlier on.
The sums of the numbers in each L-shape are the cube numbers, which, as we found
before, are the differences between the squared triangle numbers.
You could prove this algebraically if you wanted to (do you?).
Now let’s investigate some other squares
on this multiplication grid.
In the square shown, the oranges sum to
12, and the purples sum to 13. If we take
the difference of the purples we get 5.
What is interesting about these numbers?
Explore some other square sums in this grid – can you explain what is happening?
It turns out that this creates some of the Pythagorean triples, numbers that satisfy
Pythagoras’ Theorem 𝑎2 + 𝑏 2 = 𝑐 2 .
Here is the classic 3-4-5 Pythagorean triple:
We can show why this works with a bit of algebra. Let’s
call the rows and columns we are interested in m and n,
like this:
The two purple numbers are square numbers, 𝑚2 and 𝑛2 ,
and the orange numbers are both 𝑚𝑛.
127
So we have:
Sum of oranges = 2𝑚𝑛.
Sum of the purples = 𝑚2 + 𝑛2
Difference of purples = 𝑚2 − 𝑛2
These are formulae for generating Pythagorean triples, where m and n are chosen to
be one odd and one even and where m and n are relatively prime.
Create some more Pythagorean triples and check they satisfy Pythagoras’
Theorem. What interesting patterns do you notice in Pythagorean triples?
There are lots of patterns in primitive Pythagorean triples, such as that one of the
numbers is odd and the others are always even. If we take one generated by a 2x2
square in the original multiplication grid (i.e. with m and n consecutive) we get two
consecutive numbers in the triple, but we don’t necessarily need to.
One last interesting pattern: In the 3-4-5 triple (n = 1, m = 2),
we have the two shortest sides consecutive numbers. The
next time this happens is the 20-21-29 triple, with n = 2 and
m = 5:
The next time this happens is 119-120-169, when n = 5 and
m = 12.
If we put these in a table we start to see some familiar numbers:
1
2
5
2
5
12
difference = 1
difference = 3
difference = 7
These numbers are related to those in the Greek ladders in the section on fractions!
This gives us a way of finding Pythagorean triples with consecutive small numbers if
we needed to!
Apart from being an important mathematician and philosopher, Pythagoras
(around 500BC) was one of the first people to recognize that maths wasn't just
something you would study to help you do the shopping or measure a field. He
saw it had beauty and value in its own right, so he set up one of the first schools
for studying mathematics.
He is most famous for his theorem, and although we have seen that he didn't
invent it - the Babylonians, Chinese and Indians knew about it before him – he
may have been the first to prove it.
128
5.1.5 Triangles from triangles
Mike Ollerton first introduced me to this curiosity.
Consider making triangles from matchsticks. There is only one triangle you can make
from 3 matchsticks, the 1-1-1 triangle.
There are 3 triangles you can make from 4 matchsticks: 1-1-2, 1-2-1 and 2-1-1, which
are all considered different for this investigation.
How many triangles can you make from 5 matchsticks? 6 matchsticks?
Can you find a pattern? Can you explain why?
From 5 matchsticks you can also make 3 triangles, and from 6 matchsticks you can
make only 1. Note that you can’t make 1-2-3 triangles (why not?).
I have tabulated the next few solutions:
matchsticks
5
6
7
8
9
10
11
12
number
3
1
6
3
10
6
…
…
types
1-2-2
2-2-2
1-3-3, 2-2-3
2-3-3
1-4-4, 2-3-4 (6 of these), 3-3-3
3-3-4, 2-4-4
You can start to see that the numbers of triangles for odd matchsticks are following
the triangle numbers, as are the even matchsticks (but a bit behind).
Why might this be the case? Let’s look a bit more systematically at the triangles
made from (say) 10 matchsticks, starting with the first matchstick. We can’t have 1a-b as the only logical choices for a and b are 4 and 5 which are not valid. So we
have:
2-4-4
3-3-5
3-5-3
4-2-4
4-3-3
4-4-2
We can start to see the triangle structure. It turns out that the number of ways of
writing the blue numbers for each red number is always one less than that number.
This is still far from satisfactory; I hope you explore this further for yourself. If you
have any further insights, please let me know!
129
5.2 Squares and beyond
Here are some investigations about square numbers and beyond.
5.2.1 Square sort
Suppose there are (say) 25 people sitting in a row. Number each person 1 to 25.
Now, you are going to call out each times table, one after another. So, starting with
the 1 x table, call out: “1, 2, 3, … , 25”. Then call out the 2 x table: “2, 4, 6, …” and so
on.
The rules are this: If a person hears their number called, they must stand if they were
sitting, or sit if they were standing.
So everyone will stand when the 1x table is called out. Then when the 2x table is
called out, all the even numbers will sit down (and the odd numbers remain
standing).
Continue in the way until all the times tables up to 25 have been called out.
Who will be left standing at the end? Can you explain why?
[Hint: consider how many times each person
changes position]
You will find that the square numbers should
be left standing… but why?
Factors usually come in pairs (such as 2x3 = 6)
so numbers usually have an even number of
factors. But a square number has one factor
that does not have a pair – its square root – so
will have an odd number of factors.
So the square numbered people will change
position an odd number of times. If they began
in a seated position they will be standing at the
end.
Number
Factors
Number of
Factors
1
1
1
2
1,2
2
3
1,3
2
4
1,2,4
3
5
1,5
2
6
1,2,3,6
4
7
1,7
2
8
1,2,4,8
4
9
1,3,9
3
10
1,2,5,10
4
Non-square numbers have an even number of factors because they come in pairs, so
will return to a seated position.
130
Can you find a pattern in the how many factors a number has? Or better still, a
formula? [Hint: Explore the prime factors of each number]
Well clearly, all prime numbers have 2 factors. And we have just found out that
square numbers have an odd number of factors.
What about all the other numbers? Is there a rule to find out how many factors any
integer will have, without just finding them all?
Well, yes there is – let’s consider the number 12. It has 6 factors (1, 2, 3, 4, 6, 12).
If we look at each of these factors more closely they share something with 12 –
prime factors! 12 can be written as a product of prime factors like this:
12 = 22 × 31
We can use this to generate all the factors by changing the value of the indices like
this:
1 = 20 × 30
2 = 21 × 30
4 = 22 × 30
3 = 20 × 31
6 = 21 × 31
12 = 22 × 31
We have 3 choices (0, 1 or 2) for the power of 2, and 2 choices (0 or 1) for the power
of 3, so there are 3 x 2 = 6 choices (factors) in all.
We just look at the indices of the prime factorization and this tells us the number of
factors, generally for any number n:
𝑘
𝑘
𝑘
𝑛 = 𝑝1 1 × 𝑝2 2 × … × 𝑝𝑟 𝑟
Then the number of factors = (𝑘1 + 1) × (𝑘2 + 1) × … × (𝑘𝑟 + 1)
If we now consider the values of k for a square number, they will always be even
(why?), so the number of factors will be the product of odd numbers, so will always
be odd.
131
5.2.2 Sums of squares
Can you write all the numbers from 1 to 10 as the sum of square numbers?
Is there more than one way to do them all?
What is the minimum number of squares needed for each one?
What about numbers bigger than 10?
You should find that the most square numbers we need for any number between 1
and 10 is 4, which is 7 = 4 + 1 + 1 + 1. We can some of them in more than one way,
such as 9 = 4 + 4 + 1 or just 9 = 9.
If we limit ourselves to a maximum of 4 squares, can we write all the numbers
from 11 to 20? How about higher than this?
Here are 1 to 20 written using the minimum number of squares possible:
1=1
2=1+1
3=1+1+1
4=4
5=4+1
6=4+1+1
7=4+1+1+1
8=4+4
9=9
10 = 9 + 1
11 = 9 + 1 + 1
12 = 9 + 1 + 1 + 1
13 = 9 + 4
14 = 9 + 4 + 1
15 = 9 + 4 + 1 + 1
16 = 16
17 = 16 + 1
18 = 9 + 9
19 = 9 + 9 + 1
20 = 16 + 4
You can see that we start of with a kind of pattern, where numbers need increasingly
more squares until the ‘pressure’ is relieved by a new square number, or one that
only needs two squares. However, the pattern seems to break down a bit at the end.
Do you think that 4 squares will always be enough?
What other patterns do you notice?
132
Fermat was one of the first mathematicians to work out which numbers needed
which numbers of squares, although he left it to others to prove his results.
Interestingly, the results have a lot to do with prime numbers, so let’s look at those
first:
Look at the prime numbers from 1 to 20. How many squares are needed for each?
How many different ways are there of writing them?
If you investigate this question, you will probably notice that some of the primes
behave ‘nicely’ and some don’t. By nicely, I mean that they seem to only need a
couple of primes: these are 2, 5, 13, and 17. The badly behaved ones need 3 or 4
squares.
Apart from 2 (which is nearly always a special case!) these nice primes are all one
more than the four times table (i.e. of the form 4k+1). Let’s explore this further by
looking at other 4k+1 primes:
5=4+1
13 = 9 + 4
17 = 16 + 1
29 = 25 + 4
37 = 36 + 1
41 = 25 + 16
It seems that all 4k+1 primes can be written using only two primes, and what’s more
than this, there is only one way of doing it. This is in fact true, and was proved by
Leonard Euler in the 18th century. Of the other primes, one less than the 4 times
table (4k-3), all need at least three primes.
To see why we can’t write any of the 4k+3 primes as the sum of two squares,
consider all the possibilities, using modular arithmetic:
𝑛 (𝑚𝑜𝑑 4) 𝑛2 (𝑚𝑜𝑑 4)
0
0
1
1
2
0
3
1
This table tells us that square numbers are all of the form 0 or 1 (mod 4). Therefore
adding any two square numbers can only be of the form 0, 1 or 2 (mod 4). So no
sum of two square numbers can be of the form 3 (mod 4), or 4k+3.
Although the proof that all 4k+3 primes can’t be written as the sum of two squares is
easy, the proof that 4k+1 primes can be written as the (unique) sum of two squares
is quite complicated and is not included here.
133
What about non-primes? How many squares are needed for these?
Ignoring the squares themselves, we have:
6=4+1+1
8=4+4
10 = 9 + 1
12 = 9 + 1 + 1 + 1
14 = 9 + 4 + 1
15 = 9 + 4 + 1 + 1
18 = 9 + 9
20 = 16 + 4
Again, some of them are nicely behaved and some are not. Let’s list the nicely
behaved ones that only need two squares and see if we can spot anything about
them: they are 8, 10, 18 and 20. Perhaps it has something to do with 2? But then 6
and 14 are not included, so let’s look a bit more deeply.
Let’s suppose it has something to do with primes; we know that the ‘good’ primes
are 2, and the 4k+1 ones. What are the prime factors of 8, 10, 18 and 20?
8=2x2x2
10 = 2 x 5
18 = 2 x 3 x 3
20 = 2 x 2 x 5
We can see that most of these are made from 2 or the 5 apart from 18, so this
doesn’t quite back up our conjecture that the good ones are made from (2 or) 4k+1
primes. How about the ones that can’t be written as the sum of two squares:
6=2x3
12 = 2 x 2 x 3
14 = 2 x 7
There are definitely plenty of 4k+3 primes here, so we might be on to something
after all; let’s keep looking for a pattern.
22 = 2 x 11 = 9 + 9 + 4
24 = 2 x 2 x 2 x 3 = 16 + 4 + 4
26 = 2 x 13 = 25 + 1 (OK)
28 = 2 x 2 x 7 = 16 + 9 + 1
30 = 2 x 3 x 5 = 25 + 4 + 1
Again, the only one that can be written using two squares is one with a 4k+1 prime,
and all the bad ones contain a 4k+3 prime.
134
So generally the numbers with 4k+3 prime factors can’t be written as sums of two
squares… let’s revisit our special case, 18, which contains two bad primes… but wait,
of course this can be written as two squares as 18 = 2 x 3 x 3 = 3 x 3 + 3 x 3 = 9 + 9…
Thinking about this, can you come up with a rule for which non-primes can be
written as the sum of two squares?
If we have an even number of bad primes, then maybe we can split them into two
like for 18. This is definitely true if we have a prime factor of 2 in our number (why?)
but what if we don’t? Let’s try the number 5 x 3 x 3 = 45… can this be written as the
sum of two squares? It can! 45 = 36 + 9. So it doesn’t matter whether 2 is a factor;
we conjecture that any number with an even number (including zero) of 4k+3 primes
can be written as the sum of two squares, which is indeed the case, although we
won’t prove it here.
Let’s test it out. First choose a prime factorization that has an even number of 4k+3
primes, such as 23.32.5 = 360. Can this be written as the sum of two squares?
360 = 9 x 40 = 9 x (36 + 4) = 324 + 36 = 182 + 62 so it works for this one.
Explore some more numbers with and without an even number of 4k+3 primes
and test the conjecture.
Finally, we have seen that some numbers need 3 or 4 squares, but is 4 always
enough? Surprisingly, it is! The French mathematician Joseph-Louis Lagrange proved
this in the 18th century.
Test out Lagrange’s Four Square Theorem for yourself.
Finally, there is another way of finding the number of ways of writing a number as
the sum of two squares; I included it in Prime Sequence, but here it is again for
completeness
French mathematician Adrien-Marie Legendre showed that the number of ways of
writing a number as the sum of two squares is 4(F+1 – F+3) where F+1 is the number of
4n+1 factors and F+3 is the number of 4n+3 ones.
So 45 can be written as the sum of two squares in 8 ways (noting that order is
important!
45 =
(6)2 + (3)2
(6)2 + (-3)2
(-6)2 + (3)2
(-6)2 + (-3)2
(3)2 + (6)2
(-3)2 + (6)2
(3)2 + (-6)2
(-3)2 + (-6)2
135
5.2.3 Summing sequences
We have seen that the triangle numbers
go 1, 3, 6, 10, …
We can think of these as being the sums
of the whole numbers:
1, 1+2, 1+2+3, 1+2+3+4, …
As we have found the nth term of the sequence to be ½.n.(n+1), we can easily use
this to find the sum of (say) the first 100 whole numbers by just putting in n = 100
into the formula, which gives ½.100.101 = 50.101 = 5,050.
What is the sum of the first 100 odd numbers? How about the first 100 even
numbers? Can we find the sum of the first 100 numbers of different sequences?
To find the sum of the first 100 even numbers is easy if you think about it. You just
need to double the answer for the first 100 whole numbers, as each number is
doubled! So we have 5,050 x 2 = 10,100, and the formula for this is just n(n+1).
Even more ingeniously, we can also use this to find the formula for the first 100 odd
numbers. If we take one off for every even number we just take 100 off to get
10,000.
Using algebra, we could just take n from n(n+1), which is:
n(n+1) – n = n2 + n – n = n2. So the sum of the first n odd
numbers is the nth square number! If this is surprising, have a
look at this diagram, which shows why it is true!
We might have guessed this if we remembered that the
differences of the square numbers 1, 4, 9, 16 are the odd numbers 3, 5, 7, … So the
square numbers are also sums 1, 1+3, 1+3+5, 1+3+5+7, …
Do any other sums of sequences like this have an interpretation as a shape?
We can extend this idea further like this:
136
Before reading on, can you find the rules for generating these shape/number
sequences?
The pentagonal numbers go 1, 5, 12, 22, … and are also sums of sequences: 1, 1+4,
1+4+7, … just like the triangle and square numbers.
We are now going to find a formula for the nth pentagonal number; it involves a bit
of algebra so if you want to skip this bit don’t worry.
The pentagonal numbers are sums of arithmetic sequences, which means they go up
by the same amount each time, so we can use a trick to find them. First, add the first
and last term together and then divide by 2. This is the same as finding the middle
(average) number of the sequence. Then all we have to do is multiply by how many
numbers we’ve got.
For example, to work out 1+4+7+10, we just do 1+10 = 11, divide this by 2 to get 5.5,
which is the ‘middle’ number, then multiply by 4 (because there are 4 of them) to
give the total of 5.5 x 4 = 22, which is the 4th pentagonal number.
We can use this to work out the nth term for the pentagonal numbers. The sequence
1,4,7,10,.. has itself got nth term 3n-2 (as it’s 2 less than the 3x table), so we havefirst
term plus last term = 1 + (3n – 2) = 3n – 1, then divide this by 2 and multiply by how
many we’ve got (n) to give the nth pentagonal number = ½.n.(3n-1).
A different way to find this rule is to consider the identity for triangle numbers,
which is Δ𝑛 = 𝑛 + Δ𝑛−1 . We can then think of square numbers as being made from
the previous two triangle numbers like this:
Can you write down an identity for this pattern?
An identity for this would be ⊡𝑛 = 𝑛 + 2. Δ𝑛−1 . You can check that substituting the
n-1th term for triangle numbers, which is ½.(n-1).n, gives ⊡𝑛 = 𝑛2 .
This suggests that the next type of number in this sequence might be 𝑛 + 3. Δ𝑛−1,
which is like saying pentagons are made from 3 triangles, which makes sense!
You can check that putting the formula for the n-1th triangle number into this
identity gives the correct formula for the nth pentagonal number if you want!
137
There are other types of shape-numbers you can investigate. The last one I am going
to include here is the hex-numbers (not to be confused with the hexagonal numbers
above).
The hex numbers go like this:
What interesting identities can
you find for the hex numbers?
How are they connected to the
triangle numbers? Or the cube
numbers?
Each hex number is made from 6 triangle numbers
+ 1, so for example 7 = 6 x 1 + 1, then 19 = 6 x 3 +
1, so the next one is 6 x 6 + 1 = 37. You can check
this by drawing it as shown on the left
An identity for this might look like this:
𝐻𝑒𝑥𝑛 = 6. Δ𝑛−1 + 1
Finally, notice that summing the hex numbers
leads to the cube numbers. To see why this is true, imagine them as three sides of a
cube, and then try to imagine putting the smaller ones inside the next largest one,
like this:
If you can’t see how, try making them with multi-link cubes!
138
Here are some interesting sums of squares:
12 – 22 + 32 – 42 = -(1 + 2 + 3 + 4)
12 – 22 + 32 – 42 + 52 = 1 + 2 + 3 + 4 + 5
Confirm these are both true. Does this pattern always work? Can you explain
why?
They are indeed true. To see why, you could use the difference of two squares.
Writing the first one as (1+2)(1-2) + (3+4)(3-4) = (1+2)(-1) + (3+4)(-1) and the second
one as 1 + (3+2)(3-2) + (5+4)(5-4) = 1 + (3+2) + (5+4) we can see these patterns will
continue.
What patterns do you get if you sum the odd squares only? How about the even
squares?
Summing the odd squares gives:
12
12 + 32
12 + 32 + 52
= 1
= 10
= 35
= 1 x 2 x 3/6
=3x4x5/6
=5x6x7/6
Can you explain this one using a diagram!?
139
140
5.3 The great Gauss
Here are a few investigations that involve some of the mathematics that German
mathematician Carl Friedrich Gauss worked on.
No history of numbers can be complete without mention of Gauss. Many people
consider him to be the greatest mathematician that ever lived.
He was a German mathematician who lived during the 19th century. He made
contributions to many areas of maths, but for a long period of his life his main
passion was Number Theory. He developed the mathematics of modular
arithmetic and proved the law of quadratic reciprocity, which he called the
‘golden theorem’. We are going to look at quadratic residues, which form the
basis of the law of quadratic reciprocity, described at the end of the section.
5.3.1 Quadratic Residues*
Gauss was the first to study Quadratic Residues in depth. Quadratic Residues are just
the square numbers mod n for different n. We found the QRs mod 25 in the second
part of the investigation triangle cakes.
For example, if you take the square numbers mod 5 you will find that you only get 1
and 4 (as well as 0 which we are not interested in here). We say that 1 and 4 are
quadratic residues (QR) mod 5, and 2 and 3 are non-residues (NR).
Investigate patterns in the square numbers for other mod n before reading on!
Investigate what happens for prime n in particular.
Here are the quadratic residues for different modulo n with prime n:
mod 3
mod 5
mod 7
mod 11
mod 13
1
1
1
1
1
1
4
1
4
4
4
4
9
0
4
2
9
9
16 25 36 49 64 81 100 121 144
1 1 0 1 1 0
1
1
1
1 0 1 4 4 1
0
0
0
2 4 1 0 1 4
2
2
2
5 3 3 5 9 4
1
0
1
3 12 10 10 12 3
9
4
1
If we put these into a table (and add in 17 and 19 as well) we can see that half of the
numbers are QR and half are NR:
n
3
5
7
11
QR
1
1, 4
1, 2, 4
1, 3, 4, 5, 9
NR
2
2, 3
3, 5, 6
2, 6, 7, 8, 10
141
13
17
19
1, 3, 4, 9, 10, 12
1, 2, 4, 8, 9, 13, 15, 16
1, 4, 5, 6, 7, 9, 11, 16, 17
2, 5, 6, 7, 8, 11
3, 5, 6, 7, 10, 11, 12, 14
2, 3, 8, 10, 12, 13, 14, 15, 18
These numbers look fairly random; are there any more patterns here? Well, if we
look at some of the values of n (5, 13, 17 – those of the form 4k+1), we can see that
n-1 is a QR and for the others (of the form 4k+3) it is a NR. This suggests that there is
something different about primes of the form 4k+1 and those of the form 4k+3.
Looking only at the 4k+1 primes we have:
n
5
13
17
QR
1, 4
1, 3, 4, 9, 10, 12
1, 2, 4, 8, 9, 13, 15, 16
NR
2, 3
2, 5, 6, 7, 8, 11
3, 5, 6, 7, 10, 11, 12, 14
Closer inspection reveals that the QRs come in pairs. For example, for 13 we can add
pairs together to make 13 (1+12, 3+10, 4+9). We can also see that NRs also come in
pairs.
Is this true for the 4k+3 primes too?
n
3
7
11
19
QR
1
1, 2, 4
1, 3, 4, 5, 9
1, 4, 5, 6, 7, 9, 11, 16, 17
NR
2
3, 5, 6
2, 6, 7, 8, 10
2, 3, 8, 10, 12, 13, 14, 15, 18
It is not; another difference between 4k+1 and 4k+3 primes! So what patterns are
there in the 4k+3 primes?
In fact, they come in QR/NR pairs. Looking at 11 as an example, we have 1+10, 3+8,
4+7, 5+6 and 9+2. This is true for all of these 4k+3 primes.
When you have found your QRs for different modulo n, try multiplying them
together. For example, here is what happens for mod 5:
QR = {1,4}
NR = {2,3}
If we multiply any two QRs together we get 1 or 4 (mod 5) so we might conjecture
that QR x QR = QR for any mod n.
142
Try this for other QRs mod n. Does it seem true?
What other rules can you come up with for multiplying QRs and NRs together?
For example, what is QR x NR or NR x NR?
Let’s continue to use mod 5 as an example. What about QR x NR? Well, we have
(working in mod 5):
1x2=2
4x2=3
1x3=3
4x3=2
So we can conjecture that QR x NR = NR.
What about NR x NR? Trying it out reveals that NR x NR = QR.
We have a full set of rules for multiplying QR and NR:
QR x QR = QR
QR x NR = NR
NR x NR = QR
Of course, these are the same rules as multiplying positive and negatives if we think
of QR as positive and NR as negatives.
This helps us solve quadratic congruence equations like this:
𝑥 2 ≡ 3(𝑚𝑜𝑑 5)
Can you find a value for x2 that is congruent to 3 mod 5?
In fact, you didn’t even need to try; knowing that 3 is a NR mod 5 means that there is
no solution to this equation.
Now, the law of quadratic reciprocity (LQR) states that if either of the numbers 3 or 5
is a 4k+1 prime, then if 𝑥 2 ≡ 3(𝑚𝑜𝑑 5) has (no) solutions, then so does 𝑥 2 ≡
5(𝑚𝑜𝑑 3). In the other case where neither of the numbers is a 4k+1 prime (both
4k+3 primes) then if one equation has a solution, the other one doesn’t.
This can be particularly useful when the numbers are quite large. For example, does
𝑥 2 ≡ 37(𝑚𝑜𝑑 53) have solutions? Well, as 37 is a 4k+1 prime, LQR says that if 𝑥 2 ≡
37(𝑚𝑜𝑑 53) has a solution then so does 𝑥 2 ≡ 53(𝑚𝑜𝑑 37).
Why is this useful to know? Well, because we can note that 53 ≡ 16(𝑚𝑜𝑑 37). So
solving 𝑥 2 ≡ 53(𝑚𝑜𝑑 37) is the same as solving 𝑥 2 ≡ 16(𝑚𝑜𝑑 37) which we can
see has a solution, 𝑥 ≡ 4(𝑚𝑜𝑑 37). So then LQR tells us the original equation also
has a solution.
143
5.3.2 Wilson’s Theorem
Gauss was the first person to explore something now called Wilson’s theorem. He
decided to use modular arithmetic to see if there was a pattern in the factorials.
What is the remainder of 4! (= 24) for different modulo n? Here is a table:
mod n
4!
1
0
2
0
3
0
4
0
5
4
6
0
7
3
8
0
9
6
10
4
11
2
Nothing interesting here… or is there? First of all, we note that the first non-zero
remainder happens at mod 5 (because 4! = 4 x 3 x 2 x 1). But is it a coincidence that
the first non-zero remainder of 4! is also 4?
Investigate the first non-zero remainder for other factorials. Can you make a
conjecture?
If you look at n! (mod n+1) you get the following results:
𝟐! (𝒎𝒐𝒅 𝟑) ≡ 𝟐
3! (𝑚𝑜𝑑 4) ≡ 2
𝟒! (𝒎𝒐𝒅 𝟓) ≡ 𝟒
5! (𝑚𝑜𝑑 6) ≡ 0
𝟔! (𝒎𝒐𝒅 𝟕) ≡ 𝟔
It would appear that 𝑛! (𝑚𝑜𝑑 𝑛 + 1) ≡ 𝑛 in the cases where n + 1 is prime.
This is Wilson’s Theorem. I am not going to prove it here but will give an example
that will give a suggestion of the proof. Let’s consider 6! = 1 x 2 x 3 x 4 x 5 x 6.
We can take these factors in pairs that are congruent to 1 (mod 7) like this:
2 × 4 = 8 ≡ 1(𝑚𝑜𝑑 7)
3 × 5 = 15 ≡ 1(𝑚𝑜𝑑 7)
We have 1 and 6 left over. So 6! (𝑚𝑜𝑑 7) = 1 × 2 × 3 × 4 × 5 × 6 ≡ 1 × 6 ≡
6(𝑚𝑜𝑑 7).
This pairing is always possible for any n factorial under prime modulo n + 1 – try it!
144
5.3.3 Eight Queens Problem
While we are still talking about Gauss, let’s look at a different problem he
investigated:
Can you arrange n queens on a n x n chessboard so that no queen is attacking any
other?
Start by trying to to arrange 3 queens on a 3 x 3 board, then 4 queens on a 4 x 4
board and so on.
Q
Here is a solution for the 4 queens problem, and below is a
way of representing this arrangement:
1
2
2
4
3
1
4
3
Q
Q
Q
Can you see what the numbers represent? How might this help you solve more
difficult queens problems? [Hint: try adding the columns]
If you look at the solution to the 4 queens problem given you
can see that each column is like a co-ordinate for each queen.
1
2
2
4
3
1
4
3
Q
Q
Q
Q
If you add the columns you will notice that each number is
different. This means that each queen is on a different
diagonal. To see why, consider the co-ordinate sums – they
are the same on the downward diagonals.
So we could think of the n queens problem as finding 4 pairs
of co-ordinates with different sums.
5
6
7
8
4
5
6
7
3
4
5
6
2
3
4
5
But unfortunately there isn’t all! We also need to check the other (upward)
diagonals. Gauss came up with an ingenious way of doing this.
Q
Q
Q
145
If we reverse the order of the top row and plot the queens we
get the following solution:
4
2
3
4
2
1
Q
1
3
This has effectively reflected the board in a vertical line of symmetry. All the upward
diagonals are now downward diagonals, and all we have to do now is check the
column sums for this new arrangement, thus checking upward and downward
diagonals!
Now can you find a solution to the 8 queens problem?
Here’s one that I found:
Q
Q
1 2 3 4 5 6 7 8
5 3 1 7 2 8 6 4
6 5 4 11 7 14 13 12
Q
Q
8 7 6 5 4 3 2 1
5 3 1 7 2 8 6 4
13 10 7 12 6 11 8 5
Q
Q
Q
Q
Apparently there are 11 different ones (ignoring rotations and reflections)… Can
you find them?
146
5.4 Towers of Hanoi
This seems as good a place as any to slip in another famous puzzle with lots of
interesting maths attached.
The Towers of Hanoi puzzle was invented by French Mathematician Eduoard Lucas in
the 19th century. The puzzle is this:
Arrange differently sized discs
on three pegs as shown:
Your task is to get the discs
from this peg to the end peg,
one at a time, but with the
condition that you can never place a larger disc on top of a smaller one, in the
minimum number of moves possible.
Investigate with different numbers of discs. Can you see a pattern? Can you
describe a sequence of moves that will give the minimum number of moves?
Numbering the discs 1 (smallest) to 4 (largest) the sequence of moves that takes the
discs to the end peg is 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1 which is 15 moves.
Experimenting with different numbers leads to the following sequences of moves:
2 discs
3 discs
121
1213121
3 moves
7 moves
Adding this to the result for 4 discs gives a pattern in the minimum number of moves
of 1, 3, 7, 15 (4 discs), 31, and so on. These are the powers of 2 minus 1 (called the
Mersenne numbers), or alternatively each number is double the last. We can see
this structure in the sequence of moves. The previous sequence of moves is
repeated either side of moving the largest disc.
You might have spotted this sequence when looking at the
binary numbers:
You can see from the diagram that the position of the rightmost 1 in each number follows the pattern 1 2 1 3 1 2 1 4 1 …
147
Here are a couple of fun ways of thinking about the solution to the puzzle.
Consider the odd numbered discs as moving clockwise around 3 pegs arranged in a
circle, and even numbered discs as moving anti-clockwise, with the smallest
available peg moving at all times but never twice in a row, and you have an
algorithm for solving the problem. I have shown this in the picture below; note that
the first move determines which peg you finish on with an odd number of discs, and
vice versa for an even number of discs.
You can also think a way of visting all the
vertices on a cube:
Starting at the bottom left corner, we can
think of each move as a move along an edge
in each dimension, giving 1213121.
This is known as a Hamiltonian circuit.
We can extend this idea further by thinking
about the 4-disc example as a Hamiltonian
circuit around a hypercube!
148
5.5 Some unusual sequences
Here are some investigations into some number sequences you might not have seen
before.
5.5.1 Stirling numbers… of the second kind
James Stirling was a Scottish mathematician who lived in the 18 th century. He is
possibly most famous for his discovery of a formula that approximates factorials.
However, he also discovered the lesser know Stirling numbers, which are becoming
increasingly important in computer science.
There are two types of Stirling numbers, the first and second kind. The second kind is
probably the easiest to understand, so we’ll start there.
Consider putting three objects into two different piles (neither of these piles
being empty). How many ways are there of doing this? (order doesn’t matter)
Using letters, we have 3 ways:
{A,B} and {C}
{A,C} and {B}
{B,C} and {A}
3
The number of ways of putting 3 objects in 2 piles is the Stirling number { } = 3.
2
The curly brackets are the standard way of showing sets in maths, and this is
𝑛
probably why they are used here; { } means the number of ways of putting n
𝑘
objects into k sets.
4
4
Can you find a systematic way of working out the Stirling numbers { } and { }?
3
2
4
One way of finding { } is to put the fourth letter (D) into either the first or second
2
set in the list above, giving:
{A,B,D} and {C}
{A,C,D} and {B}
{B,C,D} and {A}
{A,B} and {C,D}
{A,C} and {B,D}
{B,C} and {A,D}
4
And finally we have a 7th arrangement, which is {A,B,C} and {D}, so { } = 7.
2
4
To find { } we have
3
{A,B},{C},{D}
{A,C},{B},{D}
{A,D},{B},{C}
{B,C},{A},{D}
{B,D},{A},{C}
{C,D},{A},{B}
149
5
Use this approach to find the Stirling numbers { } for different values of k.
𝑘
We can put all the Stirling
numbers we have found into a
triangle, a bit like Pascal’s triangle:
Can you find any connections
between successive rows of
the table, like in Pascal’s
triangle?
It’s a bit harder to see, but you can find the numbers in the next row of the table.
4
3
We found { } using { } systematically, which was:
2
2
4
3
3
{ } = 2 { } + { } = 2 x 3 + 1 = 7.
2
2
1
You can see that here in the table:
The blue number is 2 x green +
orange.
Can you adapt this idea to see how the numbers in the bottom row of the table
could be calculated from the numbers in the row above?
Looking closely we can see that the 2 represents the column the green number is in,
which we can write as a general relationship like this:
𝑛
𝑛−1
𝑛−1
{ } = 𝑘{
}+{
}.
𝑘
𝑘
𝑘−1
What other patterns can you see in the table?
You might have noticed the good old triangle numbers make their appearance in the
4
table. To see why, have a look at the way I arranged { } when calculating it above.
3
We could draw this like this:
150
You can see that this is equivalent to the triangle numbers by noticing that A is
connected to the other three letters, then B is connected to the other two and C is
connected to D = 3 + 2 + 1. (You might recognize the picture on the right as the
complete graph K4).
Also, in the second column (n objects into 2 groups), you might have noticed that the
4
numbers are one less than a power of 2. To see why, consider { } again.
2
Fixing one of the objects, say A, in one group (it can’t be empty), we have choices of
whether to put each of the other 3 letters in or out of that group. This gives 2 3 ways
of making this group. However, we have to subtract 1 as we are not allowed
{A,B,C,D} as that would leave the other group empty.
This sequence of 1 less than a power of 2 appears often in counting problems like
this, such as the Towers of Hanoi puzzle from the previous section.
Finally, if you sum the rows of this table
you get what are called the Bell numbers,
named after mathematician and author
of detective novels Eric Bell.
So, for example, b4 = 15 represents the
number of ways of grouping 4 objects
into different groups:
151
5.5.2 Stirling numbers… of the first kind
Now let’s turn our attention to Stirling numbers of the first kind. They are similar to
the numbers above, but slightly different.
𝑛
The number [ ] now represents the number of ways of putting n objects into k
𝑘
cycles. A cycle is like a loop or a bracelet (see number bracelets) like this:
These are different cycles as they are arranged in a different order. Written as a list,
we could write the one on the left in four different ways: [ABCD], [BCDA], [CDAB]
and [DABC] but these are all really the same cycle, or the same order when put in a
loop. None of these are the same as the second cycle, which could be written
[ACBD].
Using this notation from now on, let’s find out if there’s anything interesting about
these Stirling numbers. First, let’s work out some values; starting like before, what is
3
[ ]? We have 3 different ways of putting 3 objects into 2 cycles:
2
[AB] and [C]
[AC] and [B]
[BC] and [A]
So far, they are the same as the other numbers. Can wo
3
3
Can you work out [ ]? Is this the same as { }? Explain why.
1
1
4
4
Can you find a systematic way of working out [ ] and [ ]?
3
2
Are these the same as the other Stirling numbers?
3
Of course it turns out they are different. For example, [ ] = 2, which is different to
1
3
{ } = 1 because the order matters.
1
4
4
You should have also found that [ ] = 11 and [ ] = 6, so they are generally different.
3
2
152
Work out some more of these Stirling numbers and put them in a table. Can you
find any patterns?
Here are the first few Stirling numbers
of the first kind in a table:
You might have noticed that triangle
numbers are still there, and perhaps
you noticed that the factorial numbers
are in the first column.
4
To see why, consider [ ] = 6.
1
Fixing one of the letters, say A, we have 3! ways of positioning the other letters like
this:
[ABCD]
[ACBD]
[ADBC]
[ABDC]
[ACDB]
[ADCB]
Is there a way of working out successive rows from previous rows?
In fact there is a very similar relationship as
above. Looking at the table we see that the
blue number is 3 x green + orange.
Closer inspection reveals that it is the row
number that we multiply green by this time,
instead of the column number.
So this gives us the general relationship:
𝑛
𝑛−1
𝑛−1
[ ] = (𝑛 − 1) [
]+[
]
𝑘
𝑘
𝑘−1
What numbers do you get if you sum the rows of this table?
You get the factorials! To see why, consider the cycle arrangements as different
permutations of letters.
To see what I mean, consider the two different arrangements of letters ABC and
ACB. We can interpret this as saying B has swapped places with C, and A has stayed
in the same place. In cycle notation, we can write this as [A][BC] which is one of our
3
arrangements in [ ]. Here is a list of all the possible ways of writing three letters
2
from the ‘starting position’ of ABC, and their corresponding cycle arrangements:
153
ABC
ACB
BAC
BCA
CAB
CBA
[A][B][C]
[A][BC]
[AB][C]
[ACB]
[ABC]
[AC][B]
nothing has changed
BC swapped
AB swapped
cycled anticlockwise
cycled clockwise
AC swapped
Now you can see all the different cycle structures are here, and we know that the
number of ways of arranging 3 objects is 3!, which shows why the sums of the rows
of the table are the factorials.
154
5.5.3 Moessner sequences
Mathematician Alfred Moessner found the following pattern in the 1950s. Starting
with the numbers in a row 1 2 3 4 … take out all the even numbers (leaving the odds)
1 3 5 7 … Now if we work out the cumulative sum (adding up the total as we go
along) it should be no surprise to you that we get 1, 4, 9, 16, … the square numbers.
But what happens if we take out every third number? We get the sequence
1 2 4 5 7 8 10 11 13 14… and adding these up cumulatively we get 1 3 7 12 19 27 37
48… which are known as the ‘three quarter squares’ (can you see why?)… but more
interestingly, if we now cross out every second number we get 1 7 19 37 and adding
cumulatively again we get 1 8 27 64 … the cube numbers!
We can show this with this
diagram:
Try deleting every fourth number, then add, then delete every third number, then
add, and so on like above. What numbers do you get at the end?
It’s kind of tricky to get right, but if you did it correctly you should have got the
fourth powers 1, 16, 81, ...
Try crossing out some other sequences of numbers, like the triangle number or
the square numbers, and following the process. What do you get?
Here’s what happens when you cross out the triangle numbers:
What is special about the bottom number in each section 2, 6, 24, 120, …?
155
5.5.4 Frequency sequences
Here is the square number sequence: 1, 4, 9, 16, …
How many numbers in the sequence are less than 1? Less than 2? Less than 3?
Less than 4? Make a table and complete these values for up to, say, 10.
Can you see any patterns?
Here is my table:
We can see that there is a pattern to this sequence 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, … There
is one 0, three 1s, five 3s and so on (why?). Now let’s ask the same question about
this sequence:
How many numbers in the ‘less than’ sequence are less than 1? Less than 2?
It may or may not have surprised you to find out that the less than sequence for the
less than sequence takes us back to the square numbers!
Try this for other sequences. Is it always true?
I’m going to leave this one open for you to investigate. The square number and ‘less
than’ sequences are called inverse sequences, meaning that if you follow this
procedure you get back to the original sequence.
However, there is something more interesting about these sequences.
Take the square number sequence and to each number, add its position in the
sequence. So for square numbers we have:
I’ve called this new sequence F.
Now do the same for the less than sequence. What do you notice?
156
Here are the calculations for the less than sequence:
I’ve called this new sequence G. You can see that F and G do not share the same
numbers. In fact, G contains all the numbers not contained in F!
Explore this for other sequences such as the triangle numbers.
Does it always work? Can you explain why?
157
5.5.5 Thue-Morse sequence
This is a strange sequence. It starts with the numbers 0, 01, …
The next number is made by appending the reverse of the previous number to itself.
For example, the next number is 0110.
Find the next few numbers in this sequence. Can you see any patterns in the
sequence?
The first few numbers of the sequence are 0, 01, 0110, 01101001,
0110100110010110, 01101001100101101001011001101001, …
Here is one way of representing the next number in the
sequence if we read line by line with white = 0 and red =
1:
You might have noticed things like there are never more
three of the same digits in a row, or that each odd term
in the sequence is a palindrome (reads the same
backwads).
We can think of the number 01101001100101101001011001101001… as a sequence
in itself; it is known as the Thue-Morse sequence, discovered around the start of the
20th century named by Norwegian mathematician Axel Thue and US mathematician
Marston Morse.
If we call the first 0 the 0th term, 1 the 1st term, 1 the 2nd term and so on, what
observations can you make?
There is a way of working out the nth term in this sequence. If you want to find the
nth term, just count how many 1s are in the binary number for n. If there is an even
number of 1s, the nth term is a 0, else it is a 1.
For example, if we wanted the 5th term, we know 5 is 101 in binary and there are an
even number of 1s, so we conclude the 5th term is a 0 (which it is, remembering the
first term is the 0th term).
Mathematician John Conway calls the numbers corresponding to 1s odious (odd)
numbers and those corresponding to 0s evil numbers. So the evil numbers are 0, 3,
5, 8, 9, …
You may also have spotted some other patterns, such as the 1st term is the same as
the 2nd term. In fact, it is always true that the nth term is the same as the 2nth term.
Or you may have spotted that every odd term is opposite the one before it.
158
One interesting application of the sequence is that it gives a way of picking two
teams more fairly (or of sharing something between two people). It is like taking
turns taking turns…
If 0 represents a pick for Team Zero, and 1 represents a pick for Team One, then we
can use the sequence to produce a fairer way of choosing players than just
0101010101…
Do you think this is a fairer way of picking teams? Can you think of a better way?
Find out more about ways of sharing things fairly.
One thing you should definitely do after this is to find out more about
mathematician John Conway. He has written some amazing books, such as The Book
of Numbers, Winning Ways For Your Mathematical Plays, and The Symmetries of
Things.
159
5.6 Pascal’s triangle
These investigations explore some of the patterns behind Pascal’s triangle.
Blaise Pascal was another great French mathematician who lived during the 17 th
century. He was most famous for his work in the applied sciences, and built one
of the first mechanical calculators. He also made some valuable contributions to
maths; he laid the foundations for probability theory (with Fermat), made
contributions to projective geometry and the study of cycloids, and is famous for
his book ‘Treatise on the Arithmetical Triangle’.
5.6.1 Blob pyramid
Here are the rules for creating a blob pyramid…
and here are the first few rows:
Continue the pattern using the rules. What do you notice? Can you explain why?
You should get something like this:
160
If you carry this on for a while you will get
something that resembles Sierpinski’s triangle.
This is equivalent to colouring the odd numbers
in Pascal’s triangle white and the even numbers
black.
This is the same as colouring the remainders on
division by 2 (mod 2).
Explore the patterns in remainders of Pascal’s triangle with other divisors.
This ‘Pascal’s cube’ was made by one of my pupils; each face is Pascal’s triangle mod
5, with each remainder given a chosen colour, then put together to give the 3D
illusion.
161
5.6.2 Rook moves
Consider a rook placed at square A1 on a chessboard.
How many ways can it get to various squares on the board using the shortest
possible route only? How many ways are there of getting to square H8?
For example, there are 3 shortest ways of getting to square C2 as shown below:
We can see that Pascal’s triangle
has popped up again.
So the number of ways of getting
14
to H8 is… 3432, or ( ).
7
Here’s a related puzzle:
You can make the word
SUM in 4 different ways in
this pattern as shown.
How many ways can you make the word MATHS in the one below?
M
A
T
H
A
T
H
S
T
H
S
H
S
S
S
162
You will notice that there are 4 ways of making the word SUM in the example puzzle.
If you break this down into how many ways of getting to each M, we have 1 + 2 + 1.
It is no coincidence that these are the numbers in row 3 of Pascal’s triangle. You
might have conjectured that there are 1 + 4 + 6 + 4 + 1 = 16 ways of making the word
MATHS in the puzzle given and this is indeed the case.
163
5.6.3 Lines in the plane
Draw lines across a rectangle like this so that every new line divides the rectangle
into as many regions as possible:
How does this pattern continue? Can you find a rule? Can you explain it?
How is this connected to the activities in this section?
The number of regions follows this sequence: 2, 4, 7, 11, 16, …
This is just the triangle numbers plus 1.
So these numbers appear in Pascal’s
triangle as shown.
This is because each line creates one
extra region that the last line.
Here’s a little puzzle involving this line puzzle:
Can you place the numbers 1, 2, 3, 4, 5, 6, 7 into the third picture on the right
above so that there is an equal sum on either side of each of the 3 lines?
Can you find more than one different way of doing it?
This is possible if you think the sum of the numbers is 28, so we need 14 either side
of each line, with one 14 made out of 3 of the numbers, the other out of 4.
The possible sets of three numbers that might work are {1, 6, 7}, {2, 5, 7}, {3, 4, 7}
and {3, 5, 6}. Trying these out gives us three solutions, two of which work and one of
them doesn’t work (which one?).
164
5.6.4 Catalan numbers
Here are some interesting patterns, many of which are taken from the excellent
Book of Numbers by Conway and Guy.
Can you work out how to continue this sequence without any instructions?
You can see that the number of triangles, squares and pentagons is 1, 2 and 5, with
each shape partitioned into triangles in a different way. If you continued drawing the
hexagons you should have found 14 of them.
Now consider this sequence of trees; what comes next? How many trees with 4
‘buds’ are there?
This sequence of trees also has 1, 2 and 5 different drawings, and the next set with 4
buds does indeed have 14 different trees.
Can you see how and why these two seemingly different sequences are
connected? [Hint: think of each bud as being a triangle and each branch as an
edge]
If you try superimposing
the tree on the shapes,
you can see how they are
connected like this:
165
Now have a look at these three different sequences (in columns). Can you make
the connections between them (and the representations above)?
These are different representations of the sequence of numbers 1, 2, 5, 14, 42, …
discovered by Belgian mathematician Eugene Catalan in the 19th century. Catalan
numbers appear in lots of combinatorial problems, and also have applications in
computer science.
To see how, let’s look at the tree again. This is called a binary
tree in computing (as each bud grows two branches) and is
often used as a structure for storing and searching data.
Now, suppose each bud (node) on the binary tree corresponds
to a 0 and each tip of a branch to a 1. Then imagine a snail
crawling up the tree from the root, calling out the numbers of
the nodes and tips as it goes along, but not calling out the same
node/tip twice. If the snail went round this tree clockwise (left
before right) we would have the sequence 0100111.
All the possibilities for 3 nodes are 0001111, 0010111, 0011011, 0101011 and
0100111 (above).
166
These are called Dyck words; typically we ignore the final 1 as they all end in a 1. So
the 6-letter Dyck words are 000111, 001011, 001101, 010101 and 010011.
Find the Dyck words corresponding to other binary trees. What can you say about
Dyck words in general?
The Dyck words are all even length. The Dyck word of length 2 is 01, and of length 4
are 0011 and 0101. You will probably have noticed that they all contain an equal
number of ones and zeroes.
You might not have noticed that if you take the first n letters of any Dyck word, there
will always be more 0’s than 1’s.
Find all the 8 letter Dyck words and confirm that they follow the Catalan
sequence.
We could think of Dyck words as representing votes in an election between two
candidates (0 and 1) where both candidates get an equal number of votes, but
where 0 always leads 1.
I have also seen this considered as the number of ways of drunkard can exit a pub
door, stagger around outside backwards and forwards (without re-entering the pub),
and return to exactly where he started! For example, there is only one way with 2
steps (forward, back), two ways with 4 steps (FFBB and FBFB), 5 ways with six steps
(FFFBBB, FFBFBB, FFBBFB, FBFFBB and FBFBFB) and so on.
Here’s another representation of Catalan numbers: Consider the number of ways of
getting from the bottom left of this square to the top right without crossing the
green diagonal:
Check the number of paths for a 4x4 square is 14. Can you make a link between
this representation and the others in this section?
167
Finally, here’s an
interesting one.
Look at this diagram,
which shows the numbers
of ways of arranging
pennies so that every
penny in the row above
must touch two adjacent
pennies in the row below:
How many ways are there of arranging 7 pennies? Can you find a formula for the
terms in this sequence?
Now, if you rearrange this pennies so that we get all the ones with 1 on the bottom
row, then 2, and so on, we get the following picture:
Do you think this will follow the Catalan sequence? If so, can you explain why?
I can definitely see a link between this representation and the ‘mountain’
arrangement in the earlier part of this section.
So, why are Catalan numbers in this section on Pascal’s triangle? Well, Catalan
numbers appear in Pascal’s triangle! If you look at the numbers in the (vertical) spine
of the triangle, you can see 1, 2, 6, 20, 70, 252, … and if we divide these by their
position in this sequence we get the Catalan numbers (1), 1, 2, 5, 14, 42, …
The amazing Euler found a nice pattern in the Catalan numbers:
2
2!
= 1
2×6
3!
= 2
2×6×10
4!
= 5
2×6×10×14
5!
= 14 …
168
5.7 Fibonacci’s sequence
We are going to investigate the Fibonacci sequence through a few investigations.
5.7.1 Steps
Suppose you walk up a flight of steps either one or two steps at a time.
How many ways are there of walking up a flight of 4 steps? Or 5 steps? Or n steps?
Can you find a pattern?
5.7.2 Partitions
Here are all the ways of partitioning the first few counting numbers using only 1 and
2:
1=1
2=1+1
2=2
3=1+1+1
3=1+2
3=2+1
4=1+1+1+1
4=1+1+2
4=1+2+1
4=2+1+1
4=2+2
Find the number of partitions for 5, 6 and so on. What do you notice?
You will probably have realized these are just two versions of the same problem. You
may also have realized that they give the Fibonacci sequence... but why?
Consider the partitions; if you want to find the (8) ways of partitioning 5 using 1s and
2s just + 2 to all the ways of partitioning 3, and + 1 to all the ways of partitioning 4 like
this:
1+1+1+2
1+2+2
2+1+2
1+1+1+1+1
1+1+2+1
1+2+1+1
2+1+1+1
2+2+1
Equivalently, to get up a flight of 5 stairs we can take a step of 2 from the third step,
or take a step of 1 from the fourth step.
169
There are a lot more interesting results about partitions, not related to Fibonacci’s
sequence, but I will mention them here as it’s as good a place as any:
How many ways are there of partitioning numbers generally if order is important?
What if order isn’t important?
First, let’s consider how many ways there are if order is important (called ordered
partitions, or compositions). For the first few numbers we have:
2
1+1
3
2+1
1+2
1+1+1
4
3+1
1+3
2+2
2+1+1
1+2+1
1+1+2
1+1+1+1
It appears that the number of partitions is doubling each time.
Being sure not to fall into the trap of making assumptions, can you explain why
this might be true?
In fact, there is a very elegant explanation. Consider the number 3 made up of three
blobs . We can partition these blobs in 4 different ways as follows:
 
| 
| 
||

is the same as choosing whether or not to put a line in the two ‘gaps’ between
the three blobs, and there are 4 ways of doing this; 2 choices (line or no line) for the
first gap and 2 choices for the second gap.
With 4 blobs, we have 2 x 2 x 2 choices of where to put the lines, and so on,
confirming our belief that the number of ordered partitions follows the doubling
pattern.
For unordered partitions, where order is not important, it is a much more complicated
story. The first few numbers of partitions are 1, 2, 3, 5, 7, 11, … and there is no known
formula for these numbers, although Euler did find that the partitions into different
(distinct) numbers is the same as the partitions into odd numbers, using some
beautiful and not too complicated mathematics (see the excellent book Euler: The
Master of Us All by William Dunham).
Let’s look a bit closer at these partitions; is there anything else we can say? Let’s use
the number of unordered partitions of 6 as an example:
170
6
5+1
4+2
4+1+1
3+3
3+2+1
3+1+1+1
2+2+2
2+2+1+1
2+1+1+1+1
1+1+1+1+1+1
Let’s rearrange these in order of how many numbers are in each partition:
6
5+1
4+2
3+3
4+1+1
3+2+1
2+2+2
3+1+1+1
2+2+1+1
2+1+1+1+1
1+1+1+1+1+1
Can you see a connection between these two ways of arranging these partitions?
Let’s take one partition and look more closely at it, say
4 + 2. This could be drawn using squares like this,
called a Ferrer’s (or Young’s) diagram.
By looking at it in rows and then columns, you can see
that the partitions 4 + 2 and 2 + 2 + 1 + 1 are related (called conjugate pairs). Now
other connections become clear, for example: The number of partitions with
maximum number 4 (n) is the same as the number of partitions with 4 (n) numbers.
Can you find any other rules like this?
Another similar one is that the number of partitions into less than n parts is the
same as the number of partitions into parts less than n. So for example, the number
of partitions less than 3 parts is the same as the number of partitions with parts less
than 3. In our example, there is a match between 6, 5 + 1, 4 + 2 and 3 + 3 with their
respective conjugates 1 + 1 + 1 + 1 + 1 + 1, 2 + 1 + 1 + 1 + 1, 2 + 2 + 1 + 1 and 2 + 2 +
2.
Here’s a puzzle that involves partitions:
Can you place the numbers 0, 1, 2, … ,
9 (no repeats) in the ten circles shown
so that the sums around the triangles
A to F are all equal?
First of all, note that the sums around A, D and F make up 9 of the circles, with the
centre circle making the 10th. So if the sum around each triangle is S, and the middle
number is M, then 3S + M = 45 (why?) which gives us limited choices for S and M.
What are the possible choices for S and M?
171
As 3S is a multiple of 3, we must choose M to be a multiple of 3, so M must be 0, 3, 6
or 9. This leaves S to be 15, 14, 13 or 12 respectively.
Try putting M = 0. Why can this not be a solution?
If we put M = 0, it will be a part of three triangles: B, C and E. But there are only two
possible sums including 0, namely 9+6+0 and 8+7+0. So this won’t work; so if we
consider M = 3, this gives S = 14.
What are the partitions of 14 into 3 distinct digits from 0 to 9?
We have:
9+5+0
9+4+1
9+3+2
8+6+0
8+5+1
8+4+2
7+6+1
7+5+2
7+4+2
6+5+3
Notice that there are 3 partitions containing 3, so these could form the triangles B, C
and E.
Are you going to go for trial and error from here, or is there some additional logic
you can use to make the task easier?
Trial and error would probably be OK from here, but notice also that the three corner
triangles A, D and F will not contain 3, and also will not share any numbers. There are
only two sets of partitions that fit this bill: 7 + 5 + 2, 8 + 6 + 0, 9 + 4 + 1 and 7 + 6 + 1, 8
+ 4 + 2, 9 + 5 + 0.
Only the second set of these works, and we have the solution shown:
Can you find another completely different solution?
172
5.7.3 Other representations
Here is an interesting diagram showing the number of different ways that rays of
light can reflect between two plates of glass (each horizontal strip is a plate of glass
seen side on).
Why does this sequence generate the Fibonacci numbers?
The way I think of this is to consider the action of the ray of light at the middle line
only. If it bounces off the middle line, count this as a 2, and if it passes through the
middle line, count this as a 1. Bounces off the edges don’t matter.
So, using the 3 bounces as an example, and only looking at the middle line, we have:
2+2
1+2+1
1+1+1+1
2+1+1
1+1+2
2 bounces off the middle
pass, bounce, pass
pass, pass, pass, pass
bounce, pass, pass
pass, pass, bounce
Here we have the 5 partitions of 4 into 1s and 2s as we saw in the previous section!
Can you think of any other interesting ways of representing the Fibonacci
sequence?
Here is a ‘tree’ that is growing
according to the Fibonacci
sequence. Can you see how the
branches are generated? Continue
growing the tree.
What do you notice about the
number of new (white) and old
(blue) buds at each step?
173
Experiment with different ‘growth rules’. For example, what sequence do you get
if you allow new branches to form every third day instead of every second day? Or
perhaps two branches could grow each time… Or?
Each ‘bud’ grows a branch every day apart from the first day it is alive. This is basically
the growth pattern for Fibonacci’s rabbits.
Experimenting with different growth patterns leads to some other Fibonacci-type
sequences:
If a bud doesn’t branch until the third day we get the sequence: 1, 1, 1, 2, 3, 4, 6, 9,
13, 19, … which has the recursion relationship 𝐹𝑛 = 𝐹𝑛−1 + 𝐹𝑛−3
Alternatively, if we keep the growth period to 2 days but allow 2 branches to form
each time, we have the sequence: 1, 1, 3, 5, 11, 21, 43, … and the recursion rule
becomes 𝐹𝑛 = 𝐹𝑛−1 + 2𝐹𝑛−2
Can you generalize these rules? Do you have any other interesting ideas for
growing trees?
Finally, here is a bee that wants to work out the number of ways of getting to each
cell in this honeycomb:
It only travels to honeycombs of a higher number than the one it is currently on, so
for example the different ways of getting to cell 3 are 0123, 013 and 023.
Check this leads to the Fibonacci sequence. Can you explain why?
Can you think of any other interesting ways of representing the Fibonacci
sequence?
174
5.7.4 Dominoes
How many ways are there for putting 1 x 2 dominoes on various 1 x n strips?
Here are the first few values of 1 x n strips:
Continue the sequence for 1x 5 and 1x6 grids. What do you notice? Can you
explain why?
Surprise, surprise: the number of ways of placing dominoes on the strips follow the
Fibonacci sequence! To see why, we can analyze how to get the next number in the
pattern in a similar way to steps and partitions. Look at the picture below:
We can get the number of ways for the 1x4 strip by placing a single (empty) square at
the end of the three 1x3 strips, and a domino at the end of the two 1x2 strips.
175
5.7.5 Cumulative Fibonacci sequence
Make a sequence by adding up the numbers in the Fibonacci sequence cumulatively.
Here are the first few:
1 = 1, 1 + 1 = 2, 1 + 1 + 2 = 4, 1 + 1 + 2 + 3 = 7, …
Find the next few… what do you notice? Can you create a rule that is always true?
Can you explain why it is true?
Now just add up the even terms cumulatively, or perhaps just the odd terms. Can
you come up with some more rules?
How about exploring sums of every third Fibonacci number? Or every fourth…?
[Hint: for finding rules: compare terms to the Fibonacci numbers, or squares of
Fibonacci numbers, or products of consecutive Fibonacci numbers, or near-squares,
or near-products, or half-products, or…]
The cumulative Fibonacci sequence goes 1, 2, 4, 7, 12, 20, 33, … A bit of careful
inspection leads us to the identity 𝐹𝑛+2 = 𝐹0 + 𝐹1 + ⋯ + 𝐹𝑛 + 1 where 𝐹𝑛 is the nth
Fibonacci number with 𝐹0 = 1 and 𝐹1 = 1.
But why? Using dominoes on strips again, consider different positions for the last
domino on the strip. Here is an example for 𝐹4 :
The cumulative sequence of the even Fibonacci numbers leads to the identity
𝐹2𝑛+1 = 𝐹0 + 𝐹2 + ⋯ + 𝐹2𝑛 .
Can you prove why this one is true?
176
5.7.6 Fibonacci identities
We saw a nice identity for the Fibonacci sequence in the previous section. Squaring
Fibonacci numbers leads to some more interesting identities:
Have a look at the three numbers circled. Can you find a relationship (identity)
between numbers in these relative positions in this table?
If you multiply the two top numbers together (3x8) you get one less than the bottom
number (25). But for the next position along, the two top numbers (5 x 13) are one
more than the bottom number (64).
This leads to Cassini’s identity: 𝐹𝑛2 = 𝐹𝑛−1 . 𝐹𝑛+1 + (−1)𝑛
To prove Cassini’s identity we will
go back to dominoes. Consider
two 1 x n strips offset by one
place like this:
We are going to explore faults in the strips – these are the positions not covered by
dominoes as shown. A moments’ thought reveals that the fault pattern actually
defines an arrangement of dominoes.
Now, define a tail of a strip as the bit after the last fault. So here the top strip has a
tail of 3 squares and the bottom strip has tail of 4 squares.
Now we are going to swap the tails over like this:
177
Note that the top strip has become one longer and the bottom strip has become one
shorter.
Now for the proof:
There are 𝐹𝑛 × 𝐹𝑛 ways of arranging dominoes
on the two 1 x n strips (top picture). This is one
more than the number of fault patterns as we
do not have a fault pattern for the case where
dominoes cover all squares (when n is even) as
shown here on the right:
There are 𝐹𝑛+1 × 𝐹𝑛−1 ways of arranging dominoes in the second picture (after
swapping tails) – and this is exactly equal to the number of fault patterns (as they are
now odd there is no all-domino pattern possible).
Putting these two ways of counting the fault patterns together, we can say 𝐹𝑛 × 𝐹𝑛 =
𝐹𝑛+1 × 𝐹𝑛−1 + 1 (if n is even). A few moments more reflection reveals that the extra
arrangement with no faults occurs in the second picture if n is odd, and we have a
proof of Cassini’s identity!
Try adding the Fibonacci squares cumulatively. Here are the first few:
1, 1 + 1 = 2, 1 + 1 + 4 = 6, 1 + 1 + 4 + 9 = 15, …
Continue this pattern. What do you notice? Can you come up with another
identity?
How about just adding or subtracting pairs of Fibonacci squares?
Here is a nice identity for the cumulative Fibonacci squares sequence:
1=1
1+1
1+1+4
1+1+4+9
1 + 1 + 4 + 9 + 25
=2
=6
= 15
= 40
=1x2
=2x3
=3x5
=5x8
This suggests the identity: 𝐹12 + ⋯ + 𝐹𝑛2 = 𝐹𝑛 . 𝐹𝑛+1. Here’s a proof:
178
You can see this pattern by looking at
this picture of the Fibonacci spiral:
If you enjoyed all this, here are a couple more identities involving Fibonacci squares
to try and prove:
2
𝐹𝑛2 + 𝐹𝑛+1
= 𝐹2𝑛+1
2
2
𝐹𝑛+1
− 𝐹𝑛−1
= 𝐹2𝑛
179
5.7.7 Fibonacci remainders
Let’s look at the patterns in the remainders of the Fibonacci sequence. The
Fibonacci sequence starts 1, 1, and then every number after this is worked out by
adding the previous two. So the next number is 2, and then 3, then 5, then 8, …
giving:
1, 1, 2, 3, 5, 8, 13, …
If you tried dividing this by different numbers you would have found some interesting
patterns. Here are the first few remainders of the Fibonacci sequence on dividing by 3
(in modular arithmetic, we would say mod 3):
Sequence
Remainder
1
1
1
1
2
2
3
0
5
2
8
2
13
1
21
0
…
…
To spot patterns, it might help to draw the remainders like this:
What patterns can you see? What can you say about where the zeros occur? Can
you find any other patterns? Can you explain why?
Here’s a bit of maths that explains why – if you don’t follow the bit with 𝐹𝑛 right
away, don’t worry! Let’s start by systematically looking at the sequences of
remainders for the first few divisors:
Div 2: 1, 1, 0, 1, 1, …
Div 3: 1, 1, 2, 0, 2, 2, 1, 0, 1, 1, …
Div 4: 1, 1, 2, 3, 1, 0, 1, 1,
Div 5: 1, 1, 2, 3, 0, 3, 3, 1, 4, 0, 4, 4, 3, 2, 0, 2, 2, 4, 1, 0, 1, 1, …
So there are loops of various lengths, with zeroes every n places. Is there any way of
predicting the loop lengths or occurrences of zeroes? Do you think that the loop for
dividing by 4 seems different to the others? Perhaps this has something to do with
prime numbers (2, 3 and 5), or maybe something else? Let’s keep looking…
Div 6: 1, 1, 2, 3, 5, 2, 1, 3, 4, 1, 5, 0, 5, 5, 4, 3, 1, 4, 5, 3, 2, 5, 1, 0, 1, 1, …
Div 7: 1, 1, 2, 3, 5, 1, 6, 0, 6, 6, 5, 4, 2, 6, 1, 0, 1, 1, …
180
Div 8: 1, 1, 2, 3, 5, 0, 5, 5, 2, 7, 1, 0, 1, 1, …
Some of the most behaved ones seem to be the ones that are divided by the
Fibonacci numbers. If you think about it for a while, this could be expected – when we
get to the Fibonacci number we are dividing by, it will of course turn to 0. So we can
say:
Div 𝐹𝑛 : 𝐹0 , 𝐹1 , … , 𝐹𝑛−1 , 0 , 𝐹𝑛−1 , 𝐹𝑛−1 , …
where 𝐹𝑛 is the nth Fibonacci number.
But why does it loop back to zero and repeat every n terms? To find out, we are going
to do something sneaky to write this last 𝐹𝑛−1 in a different way.
By the definition of Fibonacci numbers, we have that 𝐹𝑛 = 𝐹𝑛−1 + 𝐹𝑛−2, which
rearranges to give 𝐹𝑛−1 = 𝐹𝑛 − 𝐹𝑛−2 . Now, on dividing by 𝐹𝑛 this changes to 𝐹𝑛−1 =
0 − 𝐹𝑛−2 so we can rewrite the last 𝐹𝑛−1 as −𝐹𝑛−2 giving:
Div 𝐹𝑛 : 𝐹0 , 𝐹1 , … , 𝐹𝑛−1 , 0 , 𝐹𝑛−1 , −𝐹𝑛−2 , …
Now we can use the definition of Fibonacci numbers again to find the next number.
We have 𝐹𝑛−1 = 𝐹𝑛−2 + 𝐹𝑛−3 so that we can rearrange to give 𝐹𝑛−1 − 𝐹𝑛−2 = 𝐹𝑛−3 .
So now we have:
Div 𝐹𝑛 : 𝐹0 , 𝐹1 , … , 𝐹𝑛−1 , 0 , 𝐹𝑛−1 , −𝐹𝑛−2 , 𝐹𝑛−3 , …
Maybe now you can see what is happening… the Fibonacci sequence is going back
‘down’ again (with alternating signs) to zero. This suggests why there is a zero every n
digits and a repeating pattern for Div 𝐹𝑛 .
181
5.7.8 Number bracelets
Consider the units digits only of the Fibonacci sequence. So in place of 1, 1, 2, 3, 5, 8,
13, 21, 34, … we have 1, 1, 2, 3, 5, 8, 3, 1, 4, … (This is the same as considering the
Fibonacci sequence mod 10).
Continue this sequence. Does it carry on forever or will it loop back to the
beginning? Note: we require two ones (not just one) in order for it to loop.
This activity is called number bracelets because you always get loops and so can
arrange them like bracelets.
Here is the bracelet when starting with 1 and 3.
There are 100 possible (ordered) pairs of
numbers for the initial investigation (why?). 12
of the possible pairs are part of this bracelet.
What about the other 88?
It turns out there are only a few possible
bracelets (noting that ‘starting with’ doesn’t
really make sense!):
Starting with
Length of loop
(0,0)
1
(1,1)
60
(0,2)
20
(1,3)
12
(2,6)
4
(0,5)
3
Why not investigate other Fibonacci-type rules (such as adding the 3 prior
numbers instead of 2) or other mod arithmetics?
182
5.7.9 Fibonacci factors
We call the position of a number in a sequence its index. For example, the index of 13
in the Fibonacci sequence (assuming we start with 1, 1, …) is 7.
What can you say about the index of numbers in the Fibonacci sequence that have
2 as a factor? Investigate before reading on.
You should have noticed that every third number has 2 as a factor; that is, all
numbers with an index 3n have a factor of 2.
Explore for other factors.
Complete this table for the Fibonacci factors:
Factor
Index
2
3n
3
?
5
?
8
?
13
?
…
…
The table of Fibonacci factors when completed looks like this:
Factor
Index
2
3n
3
4n
5
5n
8
6n
13
7n
…
…
We explored this idea already in Fibonacci remainders; consider the Fibonacci
numbers modulo 5: 1, 1, 2, 3, 0, 3, 3, 1, 4, 0, 4, … every fifth number is a zero.
Now, consider consecutive pairs of Fibonacci numbers. Do they have any factors in
common? How does the preceding investigation help us explain why?
The fact that there are no consecutive zeroes for any mod n leads us to conclude that
consecutive Fibonacci numbers do not have common factors (are relatively prime).
Furthermore, it would appear that prime Fibonacci numbers have prime index –
for example, 13 has index 7. Is this always true? Nearly always true?
Looking at the table above, it looks like prime Fibonacci numbers might have prime
index (apart from 3).
Prime
Fibonacci
number
Index
2
3
5
13
89
233
…
3
4
5
7
11
13
…
183
This turns out to be true! If you’re up for a tough challenge, try proving it!
And finally… investigate the prime factors of Fibonacci numbers - any patterns?
Here is a table of the prime factors of Fibonacci numbers:
Index
𝐹𝑛
Prime factorisation
1
1
1
2
1
1
3
2
2
4
3
3
5
5
5
6
8
2x2x2
7
13
13
8
21
3x7
9
34
2x17
10
55
5x11
11
89
89
12
144
2x2x2x2x3x3
13
233
233
…
…
…
Each prime factorization of successive Fibonacci numbers contains a new prime apart
from 𝐹1 , 𝐹2 (boring) and 𝐹6 and 𝐹12 . This is known as Carmichael’s Theorem.
184
5.7.10 Fibonacci Nims
Here are two variations of Nim that involve the Fibonacci sequence.
Variation 1: Players take it in turns to take a Fibonacci number of counters from a
large pile. The player who makes the last move (takes the last counters) wins the
game.
Who wins this game? How?
In any game of Nim we aim to move to safe positions; what are the safe positions for
Fibonacci Nim? Well, looking at each number of counters in turn, we can see that 4 is
a safe position – if we can reduce the pile to 4 counters then we will definitely win any legal move from the other player (1, 2 or 3 counters) results in a win for us.
We can reduce the pile to the safe position of 4 counters from 5, 6, 7, and 9 counters,
and of course 8 is a straight win. What about 10 counters? Well, we can’t take 6… so
this is a safe position too. Further analysis like this suggests that the safe positions are
of the form 10n and 10n + 4… they are like stepping stones to get to 4. But is this
always true, even for very large piles of counters?
Variation 2: Players take it in turns to take counters from one pile according to the
following rule: they can take up to double the number of counters taken by the
previous person. The only other restriction is that the first player can’t take all the
counters on the first go! The winner is the one to take the last counter(s) from the
pile.
Should you go first or second? What is a good strategy? Why is this in this section
on Fibonacci numbers?
This one is a bit more interesting!
Before we analyze this game, first note the perhaps surprising fact that all numbers
can be written as the sum of 2 or more Fibonacci numbers, for example 12 = 8 + 3 + 1.
Before going any further, convince yourself this is true! Note that this expression may
or may not be unique. For example, 15 can be written as 13 + 2 or 8 + 5 + 2. For this
activity we will assume that the expression containing the largest Fibonacci number is
the one we want (13 + 2 here).
We are now in a position to invent a number system based on Fibonacci numbers
called Fibonacci binary! Just like any place value number system (like the base 10 one
we use) we are going to give each place a value. Let’s give each place a Fibonacci
number value (in the top row of the table below).
Here are 12 and 15 in Fibonacci binary:
185
…
13
12
15
1
8
1
0
5
0
0
3
1
0
2
0
1
1
1
0
Now, let’s analyze the game. What are the safe positions for Double Nim?
Well, they are very closely related to the Fibonacci numbers – hence the name! In
fact, it turns out that we can move from one safe position to another by removing the
smallest number in the Fibonacci binary expression of the current number of
counters.
Here’s an example game:
Starting with 12 counters (say), we will be player 1 and follow this strategy:
Start: 12 = 8 + 3 + 1 = 10101
the Fibonacci sum
Take one counter, the smallest number in
 11 = 8 + 3
Player 2 takes 2, say
 9 = 8 + 1 = 10001
Take one counter
 8 = 8
Player 2 takes 1, say
 7 = 5 + 2 = 1010
the Fibonacci sum.
Take two counters, the smallest number in
 5 = 5
Player 2 must take 1 (so as not to lose on the
next turn).
 4 = 3 + 1 = 101
Take one counter.
 3 = 3
Player 2 will lose whether she takes one or
two counters...
Notice how this strategy moves towards simpler Fibonacci sums. But why does this
work? Here is a list of the first few numbers expressed in Fibonacci binary:
…
1
2
3
4
5
6
7
13
8
5
1
1
1
3
2
1
1
0
0
0
1
0
0
0
0
1
1
1
0
0
1
0
1
0
186
8
9
10
1
1
1
0
0
0
0
0
0
0
0
1
0
1
0
You may notice that all Fibonacci binary numbers do not have any adjacent ones
(why?). Also note that 𝐹𝑛+2 > 2𝐹𝑛 . So, roughly speaking, removing the smallest 1
from a Fibonacci binary number means your opponent can’t remove the next smallest
1, and you then remove it on the next go. In this way you have control over removing
the 1s from the Fibonacci binary numbers and move between subsequent Fibonacci
numbers until you get to the winning position of taking 1 to get to 3.
187
5.7.11 Lucas numbers
Here is a sequence that is closely related to the Fibonacci sequence, first discovered
by the French mathematician Edouard Lucas:
1, 3, 4, 7, 11, 18, …
It is generated in the same way as the Fibonacci sequence, but with different starting
numbers.
Explore identities for the Lucas numbers in the same way as we have for Fibonacci
numbers.
Can you find any identities linking Lucas and Fibonacci numbers?
[Hints:
- Try adding pairs of Fibonacci numbers or pairs of Lucas numbers and
comparing them.
- Try multiplying or dividing Lucas and Fibonacci numbers.]
A bit of exploration leads to this identity linking Fibonacci and Lucas numbers 𝐹𝑛+1 +
𝐹𝑛−1 = 𝐿𝑛 .
Did you spot this one: 𝐿𝑛+1 + 𝐿𝑛−1 = 5𝐹𝑛 ? Or this one: 𝐹𝑛 . 𝐿𝑛 = 𝐹2𝑛 ?
What other identities did you find?
Finally, what do you get if you divide
𝐿𝑛
𝐹𝑛
for large n? [Hint: try squaring the
amounts you get]
188
6 Parity
Parity is an important idea that helps us solve many problems in Maths. Often we
can unlock a difficult problem with a very simple argument involving oddness or
evenness, or an ingenious way of counting something, which is why these activities
are in this booklet.
In order to solve these problems, try and keep a track of how the parity of the
situation changes as you go along. Sometimes you might notice that the parity of
some part of the problem stays the same (called an invariant). Often this will give
you insight into the solution to the problem.
You have probably used parity in the past without realizing it. Here is a classic proof
that uses parity in a very powerful way.
𝑛
Suppose you can write √2 = 𝑚 , where n and m are relatively prime (so that n and m is
simplified as far as possible.
𝑛2
Squaring both sides gives 2 = 𝑚2 which we can rearrange to give 2𝑚2 = 𝑛2 [*]
So 𝑛2 must be even, and so n must be even (as even x even = even).
So we can write n = 2k for some integer k.
Now we can substitute this into [*] to give 2𝑚2 = (2𝑘)2 = 4𝑘 2
Dividing both sides of this equation by 2 gives 𝑚2 = 2𝑘 2 which means that m is also
even.
𝑛
But this contradicts the original assumption that √2 = 𝑚 where n and m are relatively
prime (and so not even).
So it follows that √2 is irrational.
I promise that this is it pretty much it for algebra for the rest of this section; these
activities are designed to be intriguing and fun, without the need for much algebra!
189
6.1 Cogs and chains
This section is about cogs…
Look at the picture on the right. Which way will the
smaller cog turn?
Consider a row of cogs like the one below…
Which way will each cog turn? Can you
come up with a rule?
What will happen if we put another cog
between the first and last one to make a
closed loop?
Investigate for other cog loops…
Now consider cogs joined by chains
like this:
Clearly the two cogs rotate in the
same direction…
What if we cross the chain over
in the middle something like
this?
Which way will each cog turn in
these pictures (if at all)?
Here are some more cog/chain loops:
How is this related to the
(closed) loops of cogs above?
Explore other systems of cogs
and chains…
Any cog will rotate in the opposite direction to its neighbor. So in a closed loop of
cogs, the ‘odd-numbered’ cogs rotate one direction (say anti-clockwise) while the
190
even numbered cogs rotate in the other direction. So if we put a 5 th cog in a loop, we
have a problem.
Why? Because the 5th cog and the 1st cog are neighbours in the loop so should turn
in opposite directions… but they are also odd-numbered cogs so want to turn in the
same direction, resulting in a jam! We can conclude that we need an even number of
cogs in a loop for the system to rotate freely.
In fact, the ‘crossed chains’ problems are equivalent to the
cogs as neighbouring cogs rotate in opposite directions, so
we need an even number of crossed chains in a loop for it
to work! We can combine systems of crossed and noncrossed chains…
Will the one on the right rotate freely?
Note that it is not the number of cogs that matters here, but rather the number of
crosses…
191
6.2 Invariants
Here are some puzzles that can be solved using the idea of an invariant – a quantity
that doesn’t change through the course of an investigation. Invariance is a useful
tool for solving parity problems.
6.2.1 Odd blobs
Here are the rules for this investigation:
Here’s an example of how it works; starting with some set of black and white blobs
(here I have chosen 2 white, 3 black):
Try cancelling different pairs for this example. Do you still get the same outcome?
Try some other combinations of black and white blobs. Can you find any
patterns? Can you work out what the final outcome will be at the start?
[Hint: keep a record of the number of black blobs at each step of your
investigations… what do you notice? Why do you think this is? How does this help
you come up with a rule?]
One way of thinking about this is to replace the black blobs with ones and the white
blobs with zeroes. Then my starting position has a sum of 3. If you keep a track of
the sum it will remain odd throughout the cancelling. The sum is an example of an
invariant.
Remember Blob Pyramid? Complete the pyramid using the
same rules as above…
What patterns do you see in the pyramid you have
created?
What if you change the rules for combining blobs?
192
6.2.2 Odd cups
Start with 3 cups in this position:
Turn over 2 cups at a time… can you get them all the right way up?
Now try the same thing for different numbers of cups arranged in the same up down
up down pattern…
…..
Can you come up with any rules for which arrangements of cups can be turned
face up?
[Hint: like in odd blobs, keep a record of the number of cups facing up at each step
of your investigations… are there any invariants?]
Here is a table of results:
This is all a bit confusing… you might have thought it was going to be possible for all
even ones after trying 3 and 4 cups…
However, a bit of further investigation of
different starting positions reveals the true
structure of the problem (the up down up
down positions we have been looking at are in
red):
If you follow the hint and keep a record of the
number of up-facing cups at each stage you will
see that each flip of 2 cups maintains the parity
of up-facing cups…
193
For example:
You can only have an even number of cups facing up, so we will never have 3 facing
up. A similar analysis will show which ones will be possible.
Try different combinations of cups, or try turning different numbers of cups each
time… can you come up with a general rule?
Note that flipping 3 cups at a time reverses the parity, which suggests that it will be
possible to flip any number of cups in any starting position…
6.2.3 Binary strings
This investigation is adapted from the excellent book The Inquisitive Problem Solver
by Vaderlind, Guy and Larson.
Suppose we start with chains of binary strings and wish to change them to
something else. There are three rules for changing strings:
01 ↔ 100
10 ↔ 111
11 ↔ 000
So for example we could change 010 to 111 using the following sequence of
changes:
010 → 1000 → 111
Which other three digit strings can you change 010 into? How about 110?
Investigate other 3-digit strings, then 4-digit strings, then…
Can you make any conclusions about which ones are possible and which are not?
I am not going to give the game away yet, just to hint that you might want to keep a
track of invariants while carrying out your investigations.
You can also change 01 into 10; here is the first couple of steps you get you started:
01 → 100 → 1110 → …
194
I don’t think you can change either 01 or 10 to 11 though (can you?).
Using this fact, you can just replace 01 in any string with 10! Does this idea make
your investigations easier?
Can you change 01 to 1000? Or 10000? How about 11111?
Make up some problems of your own.
OK, now here’s the spoiler! You may have noticed that any change maintains the
parity of 1s in the string, so we can only change between strings with the same
number of 1s.
It turns out it is possible to change 10 into any string with an odd number of 1s and
110 into any string with an even number of 1s.
195
6.3 Coins
6.3.1 Coin tricks
Here’s are some variations on a coin trick.
Ask a volunteer to put some coins on the table like
this:
H
H
H
I am going to explain how these tricks work, but see if
you can work it out for yourself first.
T
T
Before performing these tricks, quickly count the number of heads (here it’s 3).
Version 1: ask the volunteer to turn over 2 at a time silently while you turn your
back. Then before you turn back round, ask them to cover one of the coins with their
hand.
You should be able to tell whether the coin they have covered is heads of tails…
but how?
Version 2: Now ask them to cover 2 coins…
How can you decide whether the 2 coins are the same or different?
Version 3: How about if they turn over one at a time, calling out the word FLIP each
time they do it…
Version 4: How about if they turn over 1 then 2 then 3 coins, then 1-2-3 again, the 12-3 again…
These tricks are based on the same ideas as the odd cups puzzle. If you practice this
trick on your own and keep track of the number of heads after each flip you will see
that if the number of heads starts odd (even), it will remain odd (even).
Here’s how these puzzles work:
Version 1: supposing there is an odd number of
heads at the start, when you turn back round there
will still be an odd number of heads facing up.
A quick count of the heads showing will tell you
what is hidden under their hand (here it would be a
head).
H
H
H
T
T
196
Version 2: If they cover two coins you can
determine whether they are the same or
different in the same way (although if they are
the same you will not be able to tell whether they
are heads or tails!).
H
So here, the covered ones could be two heads or
two tails, but they are definitely the same!
H
H
T
T
Version 3: If they call out FLIP each time then you need to count the number of times
they call FLIP. If it is even, then the parity of heads will be the same. If it is odd, the
parity of heads will have changed and you can perform the trick in the same way.
I’ll leave you to puzzle out how version 4 works for yourself!
Can you invent any other versions of this trick?
197
6.3.2 Coins in a row
Now let’s try a different kind of coin trick: Put a row of any number of coins of
different denominations on the table, for example:
5p
10p
£1
10p
£1
£2
1p
Now, two players take it in turns to take a coin from either end of the row. The aim
of the game is to get the most money.
What is the best move to make? Who will win this game?
Change one of the coins… does it change who wins this game? Try adding an extra
coin on one of the ends…
Investigate for different numbers of coins and denominations. Can you make a
general rule?
The original game (as shown) should be won by player 2. The best move for player 1
is to take the 5p. Then player 2 should take the 10p. Player 1 will then take the £1,
player 2 the 10p, player 1 the other £1, giving player 2 the £2 and finally player 1
takes the 1p. So player 2 wins by £2.20 to £2.06.
Now try changing one of the coins, for example changing the 1p on the right end to
£1. It might seem like player 1 would now win this game… but again it turns out to
be a player 2 win… try it!
If we choose another 7 random coins and play again, player 2 usually wins, although
it depends on the denominations (consider the case where all the coins are the same
value). Play it a few times and see! Generally, all we can say is that the winner of the
game with an odd number of coins depends on the arrangement of coins.
However, if we add a coin so that there are an even number of coins, player 1 can at
least draw in all cases! If they are all the same, it will be a draw. If at least one of the
coins is different to the others, player 1 will definitely win… to see why consider a
simple example such as 2 or 4 coins and generalize.
198
6.4 Fair game?
Here are some games of strategy, which do no involve any luck. What are the best
strategies for each game? Are the games fair?
6.4.1 Choco choice
Consider a game where players take it
in turns to break a (large) bar of
chocolate into squares as shown,
making one break along the lines:
The winner is the last person to make a break… and they get to eat all the chocolate.
What is the best strategy to win this game with the 3 x 4 bar shown? How about
any m x n bar of chocolate? Or any shaped bar?
Let’s consider the 3x4 example. This game might seem quite complicated to analyse
at first sight… But playing it a few times you start to realize it doesn’t matter what
you do because player 1 always wins.
To see why, consider each break – it creates one extra piece. We must eventually
end up with 3x4 = 12 pieces. So there must be 11 breaks, that is 11 moves... so
player 1 must always win!
We can generalize this to say that if the number of squares is even (for any shape),
player 1 will win and if not then player 2 will win… not much of a game at all!
6.4.2 Poisoned square
Now suppose one of the squares is poisoned
(shown in red).
The loser of this game is the one left with the
poisoned square at the end.
Make a move by choosing a (non-poisoned) square and breaking off all the squares
above and to the right:
199
Now, player 2 might move by choosing the green square:
Who should win this game and why?
This game will always be won by player 1, assuming they play optimally (i.e. always
do the right thing). Why? Because any move player 2 can make, this could have been
played earlier by player 1. So suppose a certain move is the winning move, then
player 1 always has the opportunity to play it first! Unfortunatley this does not tell us
what this winning move is…!
6.4.3 Clobber
The normal starting position for the game of Clobber is:
 


 







Blue starts… by moving horizontally or vertically to take a red counter. If you can’t
take an opposition counter you lose!
So an example start of a game might be:





















Play the game a few times… what is a good strategy?
Would you have played the same moves as in this game above?
200
The first move made by blue in the game shown turns out to be a bad one… red can
win by playing a ‘mirroring’ strategy. So if blue plays the move shown, red can mirror
it (consider the board rotated 180 degrees)…
Try playing this strategy… you will see that red will win this game as it can always
‘copy’ any move blue makes.
Now consider this different starting clobber position:








Who should win this game, player 1 or player 2? How?
Investigate other similar 2xn boards?
How is this similar to 2-pile Nim?
The mirroring strategy will also work for the 2x4 board, for example:
201
…and red wins. A bit of investigation will reveal that red will win on a 2xn board set
up like this for n even if you use this strategy. However, this mirroring strategy is not
possible if n is odd (why not?) and it would appear that red has the advantage now.
Who has the advantage on an m x n board for different values of m and n?
Answers on a postcard please! Note that this game is similar to 2-pile Nim; if the 2
piles have the same number of counters then player 2 wins by playing a mirroring
strategy.
6.4.4 Stomp!
This puzzle is loosely based on the game Whack-a-Mole. Consider a square ‘garden’
made from 4 x 4 squares, any of which may contain a mole. The aim is to eradicate
the moles from the garden by squashing them with your foot. But if you step on a
blank square then a mole will pop up when you lift your foot up.
Let’s start by considering what happens with a ‘foot’ shaped
like a domino 1 by 2 squares like this:
So, let’s suppose you come out one morning and there is one mole in the garden in
some square and you step on it. This is what happens:
Can you completely eradicate the mole from this garden? If not, can you explain
why not?
Explore different positions and numbers of moles in this garden with this 1x2
foot. Which ones are possible and which are not?
After a while you will notice that the single mole puzzle is not possible with the 1x2
foot. To see why, keep a record of the number of moles after any step – it is always
odd, so we can never get to zero moles (as zero is even). This is the case with any
foot with an even number of squares.
Now try different shaped feet like these:
202
Can you remove a single mole from the garden with any of these shaped feet?
You might think this would mean it would be possible with
the 1x3 foot, but it isn’t! To see why, consider a colouring
of the garden like this:
Now putting a 1x3 foot in any position on this board will
cover exactly one of each colour, therefore changing the
parity of the number of moles on each colour with every
stomp.
If we start with (say) 1 mole on a white square (and 0 on blue or red squares) then if
we stomp on the ‘white’ mole with a 1x3 foot we will now have white = 0 , blue = 1 ,
red = 1 … and the parity of each colour has changed.
So if we start with differing parity on the different coloured squares then the puzzle
will be impossible. Note, however, that this does not mean that if the parity is the
same on all the coloured squares then the puzzle is definitely possible!
In fact, the single mole puzzle is only possible with the L-shaped foot.
To see how, consider the following sequence of moves:
So if we can cycle through different numbers of moles like this we conclude that all
puzzles are solvable with an L-shaped foot.
Using the T-shape, can you work out a sequence of moves that will ‘move’ a mole
in any direction, as shown in the diagram below?
 
203
Using the T-shape, you can move moles one square horizontally (or vertically) using
this sequence of moves:
Can you use technique this to eradicate the moles from this garden?
Moving a mole on top of another one will ‘cancel it out’… so this same sequence of
moves will solve the 2-mole puzzle given.
Make up puzzles of your own and try and solve them.
Can you make up any rules about which numbers of moles can be eradicated with
different shaped feet?
Why not experiment with different garden shapes...
6.4.5 Seat swap
This is not really a game, more of a puzzle. Suppose you have a 25 people sat in a
5x5 square.
Can all the people move from their seat to
an adjacent seat, so that they all finish one
seat away (horizontally or vertically, not
diagonally) from where they started?
If not, can you give a convincing argument
why?
It is not possible to move the people so that they are all one seat away. To see why
this is the case, we are going to use a colouring argument like that above.
204
Suppose the chairs are coloured like a chessboard. Then each person moves from a
black to a white square or vice versa. But there are 13 black squares and 12 white
squares, so it will not be possible for everyone to move.
Can they move so that they are 2 squares away from where they started? How
about if they make moves like a knight?
The knight’s puzzle on this board is not possible for the same reasons as above – a
knight’s move changes parity.
The 2-move puzzle is not possible on this board either. Consider the people sat at
the black squares: there is a 3x3 ‘sub-board’ inside the larger board, so will not be
possible.
For which m x n grids is the 1-move puzzle possible and which grids is it not?
This puzzle will only be possible on m x n boards if either m or n is even, so that the
number of black and white squares are even (see equal rectangles). This is the same
puzzle as placing 1x2 dominos on a chessboard.
205
6.5 Colouring in
Here are some puzzles about map colourings. Map colouring problems are famous in
mathematics; the general aim is to colour adjacent regions (regions sharing an edge,
but not a corner) using the minimum possible different number of colours.
6.5.1 Two-colourable maps
Before we get to colouring maps, consider the Venn diagram shown.
How many circles overlap in each region?
What do you notice about any two adjacent
sections (with their edges touching)?
You will probably notice that adjacent regions have opposite parity.
Now make a weird Venn diagram
however you want like this one – lets call
it a map - and count overlapping shapes
again…
In the map here, the same is still true of
adjacent regions. Try some more and see
if the same is true for yours.
Can you explain why?
To see why, consider walking across a border. As you leave one region, you go to a
region with either one less overlap or one more overlap, so the overlap count
changes parity.
Now try colouring this map (so that no adjacent regions have the same colour).
What is the minimum number of
colours needed? Can you prove
why?
You should have been able to colour any of these
maps using only 2 colours, like the one shown.
206
To explain why, consider colouring odd sections black and even sections white…
Now pick two points in separate regions.
The shortest line between these two points
passes through an even number of region
‘borders’.
Investigate for other pairs of points.
Why does this also show that these maps
are 2-colourable?
Any line between these two points passes through an even number of borders…
Look at the example with 2 points shown; the
paths go from an odd-numbered region to
another odd region.
By the above argument every time we cross a
border we move from an even to an odd region.
Equivalently, we move from a region of one
colour to a different colour.
So to travel between two regions of the same parity, we must cross an even number
of borders, and return to a region of the same colour. Any line between these points
will cross through an even number of regions for the same reason.
Any line between regions of different parity will cross through an odd number of
regions. So every region will either be one colour or another.
6.5.2 Three-colourable maps
What is the minimum number of colours you
need to colour this map so that no adjacent
regions are the same colour?
Make another map like this one, where every vertex (points where borders meet) is
of degree 3 (ie has 3 edges coming out of it). Let’s call this a degree-3 map.
Can you make a degree-3 map that can be coloured in fewer colours than this
one? Can you make one that needs more colours?
207
Here is another degree-3 map.
What is the minimum number of colours needed
for this one?
Can you come up with any rules about degree-3
maps?
The first map needs a minimum of 4 colours. You can see
here that the middle region will need a 4th colour…
This is because we need 3 colours for the outer loop. We
can’t colour it in only 2 colours because there are an odd
number of regions in the loop.
This suggests that if there is an even number of regions
in the outer loop then we would only need 3 colours,
which is indeed the case.
The outer loop only requires two colours, and the inside
can be coloured with a third.
If we analyse this a bit further, we can think of an ‘odd loop’ as being equivalent to
the central region having an odd number of edges (5 in the first map above). So
having regions with an odd number of edges will lead to 4 colours being needed.
However, if all the regions in the degree-3 map have an even number of edges (and
so are surrounded by even loops), we could conjecture that only 3 colours are
needed.
Is this logic sound? Test it out!
208
6.5.3 Four-colourable maps
Here’s a bit of history about the famous Four-Colour Theorem.
In 1852, Francis Guthrie, then a student at University College London, was colouring
a map of England and found that he required only four colours to colour this map so
that no two counties with a common border have the same colour.
By common border we mean that the common border is a line, not a point. Here are
some examples of acceptable map colourings:
He conjectured that for any map, only four colours would be sufficient. Was this
true? Finding a proof for this simple conjecture has tantalized mathematicians ever
since; surely such a simple conjecture must have a simple, elegant proof?
Many great mathematicians of this era such as Augustus De Morgan and Arthur
Cayley could not find a proof. However, 27 years later, Sir Alfred Kempe found a
more convincing proof, which he published in the journal Nature. An outline of the
proof is as follows:
Suppose there exists at least one map that requires five colours; let’s call the one with
the fewest regions M.
Now, it can be shown (using Euler’s Theorem) that any map must have at least one
region with 5 edges or less. As every map must contain at least member from this set of
regions, it is called an unavoidable set.
Consider the case where M contains a region with 3 or fewer edges. We can reduce this
region to a point, creating a map with fewer countries. By our assumption, this map must
be four-colourable as it is smaller than M.
Now we reinstate the triangle (by expanding this point). As it has only three neighbours,
we can colour it using a fourth colour – meaning that M is four-colourable. We say that
the triangle is a reducible configuration and conclude that M cannot contain a triangle
(otherwise M would be four-colourable).
Kempe then went on to use similar arguments (using an idea called Kempe chains) to
show that the square and pentagon are also reducible.
So as M must contain (at least) one region from this unavoidable set, and each member
of this set is reducible, then our assumption is false; there is no such map M, and so four
colours are sufficient for all maps.
209
This proof soon became part of undergraduate courses in mathematics and
remained so for 11 years until Percy Heawood found a flaw in the proof – the
pentagon is not reducible in the way shown by Kempe. However, Kempe’s idea was
sound: if we could find any unavoidable set of reducible configurations, then the
conjecture would be proven true.
In the early 20th century the search began for other unavoidable sets made from
more complex reducible configurations of regions. However, the size of unavoidable
sets appeared to be much larger than the number of reducible configurations and it
was hard to see if a match would ever be found.
Heinrich Heesch, who began work on the conjecture in 1936, was perhaps the first
mathematician to publicly state that it would be possible to find an unavoidable set
of reducible configurations. He developed a method called discharging to eliminate
irreducible configurations, and was the first mathematician to use a computer
algorithm to check reducibility in 1965. He conjectured that there might be an
unavoidable set of around 10,000 reducible configurations. Unfortunately, computer
power at the time was not sufficient to check this number of configurations.
Two US mathematicians Kenneth Appel and Wolfgang Haken finally proved the
conjecture to be true in 1976. They developed the methods of Kempe and Heesch,
and invented other probabilistic methods to predict which configurations might be
reducible. Their final unavoidable set still contained 1,936 configurations (which was
later reduced to 1,482), which they checked for reducibility using a computer
algorithm.
The checking procedure was only feasible due to their ingenuity and incredibly hard
work, and to the increasing power of computers. To check all configurations at the
time took around 1,200 computer-hours; they estimated that a single configuration
would take around 10,000 man-hours to check by hand. The proof contains 100
pages of summary, and hundreds more pages of detail. As Kenneth Appel stated on
declaring the proof:
“It was terribly tedious with no intellectual stimulation. There is no simple elegant
answer, and we had to make an absolutely horrendous case analysis of every
possibility. I hope it will encourage mathematicians to realize that there are some
problems still to be solved, where there is no God-given answer, and which can only
be solved by this kind of detailed work.”
Their proof was initially treated with skepticism as it relied on the use of computers
and could not be checked by hand. The proof has since been independently verified
it is now widely accepted that the proof is valid, although it raises questions about
what constitutes a mathematical proof.
It has since been shown that there is an unavoidable set containing 663 reducible
configurations, and there have been improvements to the algorithms developed by
Appel and Haken. However, the search for an elegant proof continues.
210
6.6 In and out
Here are three investigations about things that intertwine.
6.6.1 Bridges
Make any closed loop with a pencil (without taking your pen off the paper) then add
in ‘over’ and ‘under’ bridges like this:
You will notice that the bridges alternate between
over and under bridges.
Is it always possible to make an over-under
pattern like this for any closed loop? Why?
Consider the simple loop on the right with the
bridges numbered. Now tracing a route along the
path, we pass the bridges in the sequence 1 2 3 1 2 3
1…
Now look a bit closer at this pattern. If a bridge is an over bridge the first time we
pass it, it will be an under bridge the next time… This is a consequence of the fact
that we pass an even number of bridges before we come back to between
occurrences of any bridge in this sequence.
Check this for your bridge pattern – is it the same? Can you work out why this
happens?
To see why, note that it is always the case that
there is an even number of bridges between
repeats.
Let’s number the bridges in the main example:
Tracing a route round the path we get
12345361772645…
211
You can see that there is always an even number of bridges between each pair.
To see why, consider the path as made of two separate loops made between
occurrences of bridge 1.
The first (blue) loop is 1 2 3 4 5 3 6 1 and the
second (red) loop is 1 7 7 2 6 4 5 1.
Consider (say) the red loop. It crosses through
itself at bridge 7 (so passing bridge 7 twice) and
then crosses the blue loop four times.
So it crosses 6 bridges before it returns to 1. This is
an even number. Will this always be even?
Well, there are two types of crossings. When a loop crosses itself, this will always
contribute an even number (2) to the total.
The other type of crossing is when we
cross the other half of the loop. To see
why this is also even, consider the
diagram on the right.
As we are passing in and out of the blue
section, there will be an even number of
crossings here too.
So there will be an even number of
crossings in total, and we will always get
the over-under pattern.
Here’s a related game… Ask someone to make a closed loop like these ones and label
the crossings (bridges) in the same way. Then ask them to trace a path once around
the loop and read out the bridge numbers in the order they pass them… but… ask
them to try and trick you and tell a lie somewhere by swapping the order of just two
of the bridges.
Without looking at their picture, how can you work out where they lied?
212
6.6.2 Inside/outside
Draw any closed loop, any shape, and put a few
vertices on it like this:
Is it possible to draw another closed loop
that passes through each segment
(between vertices) once only?
You might have found that it’s not possible with this one as you can see.
Why not?
Under what conditions is it possible?
You will find that it is only possible to draw the second (red) closed loop if you have
an even number of vertices (and hence segments).
If you consider the original closed loop as
having an inside and outside then if you start
from the outside, you must cross the line an
even number of times to return to the
outside (and so create a closed loop).
This is related to the Jordan Curve Theorem,
which basically states that a closed loop in
the plane has an inside and an outside.
Now draw any line and put vertices on it in a similar way. This time, label each
vertex with a zero or one however you choose.
:
Now calculate the value of each segment as the difference between its end points,
so in this example we will have:
213
Adding the green values in this example we get 3.
Do this for lots of different lines and vertices… what do you notice? Can you
explain why? [Hint: consider the values of the end vertices]
You might have found that the sum of the green values will be odd if the end vertices
have different values (such as the line shown) and even otherwise.
If you think of this as being 0 = outside and 1 = inside then getting from a 0 at one
end to a 1 at the other end requires an odd number of changes from 0 to 1, and so
an odd sum.
Now do this numbering for your closed loops like this one below… what do you
notice?
If you ‘open out’ the loop into a line, then it will have the same value at each end, so
the green sum will always be even.
214
6.6.3 Odd triangle
We can extend this idea. Draw any triangle, label each corner A, B and C. Then make
as many points on the edges and inside the triangle. Triangulate between these
points. Label the points A, B or C however you want (in red).
The green numbers inside the triangles have been worked out according to the
following rules:
Add up all the green numbers in my triangle. Then make some of your own.
What do you notice? Can you explain why?
You will have noticed that the total is always odd. To see why, notice that lines
connecting different letters have a value of 1, and lines connecting the same letters
have value 0.
Now, lines inside the triangle contribute 2 to the total, because they form part of 2
triangles, so will contribute an even amount in total.
From the previous investigation, the lines on the edge of the main triangle will
contribute an odd number to the total (why?) and they are only counted once. So
the overall total will be even + odd = odd.
215
6.6.4 Weaving
Consider weaving two threads so they intertwine with each other like this, and then
return to their starting positions:
Notice that it takes an even number of crossings (swaps) for the threads to return to
their starting positions. Convince yourself that you will always need an even number
of crossings to return to the starting positions for 2 threads…
Will always be true for 3 threads, or 4 threads, or more?
Here is a set of three threads returning to their starting positions:
How many crossings are there here? Is it odd or even? Will this always be the case
for 3 threads? Can you explain why?
Can you find a rule for any number of threads?
We are going work out what is happening in the 3-thread example.
216
The first change switches the position
of all three threads. You could think of
it as doing 2 swaps in one go (R with B
then R with G), and it will always give
2 crossings.
A single swap can either result in one
crossing:
…or sometimes three crossings:
So if the number of swaps is even/odd, then so are the crossings. This table records
what happened in the example given:
Number of
crossings
Letters in the
original cycle
order?
Order
Swaps
Number of
swaps
Start: (G,B,R)
-
0
0
Y
(R,G,B)
(R,B) (R,G)
2
2
Y
(B,G,R)
(R,B)
3
5
N
(B,R,G)
(G,R)
4
6
Y
End: (G,B,R)
(B,G) (R,G)
6
8
Y
The final column in the table records whether the letters are in the
original ‘cyclic order’ (G,B,R) as shown on the right:
A single swap changes the cyclic order (basically it reverses the direction of the
arrows). Every time an even number of swaps/crossings has passed, we are back to
the original cyclic order. So to return to the original starting position we must
eventually go through an even number of swaps or crossings.
217
6.7 Graphs
These puzzles involve a branch of mathematics known as graph theory. They are not
graphs like you might be used to, but have edges and vertices (nodes) and are used
to represent things.
6.7.1 Ghost house
Is it possible to walk through this house using each door
exactly once?
You are allowed to start and finish in different rooms.
We can represent the house as a network with rooms as vertices and doors as edges
like this:
A
B
It is a well-known fact of graph theory that we can traverse a graph (travel along
each edge exactly once) and return back to the start if there is an even number of
edges coming out of each vertex. This is because if we enter a vertex by one edge,
we need another edge out of the vertex to carry on our path. For our puzzle, this is
equivalent to requiring an even number of doors in a room.
218
If there are an odd number of doors in a room then eventually we will enter a room
by one door and there will be no door to come out of…. Does this happen in our
house? Well, yes – at rooms A and B. But if we start at (say) room A then as long as
we finish at room B it will be OK.
If you were a ghost (and so pass through walls instead of doors) could you pass
through every wall segment (between two vertices) exactly once?
We could represent the ghost-house using a graph too, this time with wall segments
as edges. If you do this you will notice that are 4 rooms with an odd number of wall
segments. This time we can’t do the same ‘trick’ of starting and finishing at the ‘odd’
rooms because there are too many of them, so we can’t perform a ghost-tour of this
house.
6.7.2 Domino loop
It is possible to place a set of ‘normal’ 0-6 dominoes in a complete loop?
Now take out all the dominoes with a blank (zero) on. Is it possible now?
Now take out all the dominoes with a 0 and/or 1 on… is it possible now? Any
conjectures? Can you explain why?
We can represent a set of 0-6 dominoes by this
diagram, known as the complete graph K7.
To see how, let the vertices represent one ‘half’
of the domino, so for example the edge between
0 and 1 represents the 0-1 domino.
219
Then finding a loop containing all the dominoes is equivalent to finding a path that
traverses all edges in this network. So this will be possible for any set of dominoes
with even vertices (the 0-6 set but not the 1-6 set).
6.7.3 Vertex game
This game is for 2 players.
Draw any graph, like the one shown here.
Each player takes it in turns to delete an even vertex
(one with an even number of edges attached) and
also any of the edges that are attached to it.
There are three even vertices on this graph. It is not a very interesting game because
player 1 can win straight away with this move:
Play the game with some more interesting graphs. Can you make any
conjectures? Can you prove them?
[Hint: you might want to consider how many (and what type of) vertices there are
after each move]
Let’s look at a more interesting game:
220
Player 1 wins this game. It seems like player 1 wins all the time… is this true?
In fact, it depends on how many vertices we start with. But first, some graph theory.
If we count the number of odd and even-degree vertices in this game we have:
Vertices
7
6
5
4
3
2
Evens
3
4
3
2
1
2
Odds
4
2
2
2
2
0
Notice how the number of odd-degree vertices is always even. This is a famous result
of graph theory known as the ‘handshaking lemma’. It is a consequence of the fact
that the sum of all vertex degrees is always even (as each edge has 2 vertices at the
end). So if we have odd-degree vertices there must be an even number of them to
contribute an even amount to this total.
So if we have a graph with an odd number of vertices then as the number of odddegree vertices is always even, the number of even-degree vertices must be odd.
Vertices
7
6
5
4
3
2
Evens
3
4
3
2
1
2
Odds
4
2
2
2
2
0
Now, suppose we start with an odd number of vertices. If we follow the number of
even-degree vertices throughout the game, there must always be an odd number on
player ones turn. So player 1 always has a move, and will win in this case.
If there is an even number of vertices at the start then the same is true for player 2
and they will always win!
221
6.8 Number puzzles
Here are a couple of number investigations.
6.8.1 Number circles
In the sequence below, each outer circle contains the differences of the numbers in
the inner circle:
Investigate what happens if you continue this pattern.
Explore different starting numbers. Can you find any rules
Agood way to start investigating might be to just use zeroes and ones.
Or perhaps investigate odds and evens?
What happens if you start with 3, or 5, central numbers?
It would appear that we always end up with four zeroes:
222
Why? Well, we could consider all the different combinations of zeroes and ones. In
fact, they are all encapsulated in this example:
Each circle contains one of the possible
combinations of zeroes and ones, which means
that any combination of zeroes and ones will
end with 4 zeroes.
(Note that I am considering three zeroes and a
one to be equivalent to three ones and a zero)
Does this constitute a proof that all numbers will end with 4 zeroes? Not yet; I think
we need to analyze things a bit further.
How about if we analyze odds and evens? The pattern is the same as that above
(consider changing all the zeroes to evens and all the ones to odds), which does
suggest that all circles eventually end up as 4 evens (and so will stay as 4 evens) in at
most 4 goes; let’s call these 2a, 2b, 2c and 2d. Now consider the halves of these
evens (a, b, c, d); whatever they are, they too will end up 4 evens in at most 4 goes.
Now as the halves (a, b, c, d) also end up as evens, then our original numbers (2a, 2b,
2c, 2d) will end up as multiples of 4! If we carry on this logic, we will get numbers
that are divisible by larger and larger powers of 2. But this can’t carry on forever, so
we must conclude that eventually all the numbers go to zero.
Are you convinced by this proof?
Can you think of a better way of proving this is true?
If you can, send them to me!
Now, if we consider three or five numbers, it appears that there are no combinations
that go to all zeroes (unless we start with all the same number of course) as they get
stuck in infinite loops.
Can you prove why this is true?
Again, answers on a postcard please!
223
6.8.2 Oddly even
Can you arrange any 25 (whole) numbers, not necessarily different, so that the
sum of any 3 successive numbers is even but the sum of all 25 is odd?
This is a daunting task! I wouldn’t like to try trial and error for this one, so how could
we go about it? Let’s simplify it!
We can’t simplify it to only 3 numbers as it won’t be possible, which makes me think
25 is an important factor in it being possible. So let’s some other numbers instead.
Can you do it with only 4, 5 or 6 numbers? In how many ways? What do you
notice about the sequence of odds and evens?
With 4 numbers we have 1, 0, 1, 1 as one possible solution. With 5 we have 0, 1, 1, 0,
1. There are others ways too, such as 1, 0, 1, 1, 0. It does not seem possible with 6
numbers. Why do you think this is?
For which numbers will this problem be possible? Will it be possible for the
original question of 25 numbers?
Looking at the above solutions to the 4 and 5-number problem, they have a similar
structure, something like E, O, O, E, O, O, … which suggests that any problem that
does not require a multiple of 3 numbers will be possible. Using this structure for
the 25 number problem reveals that it is indeed possible.
Can you solve the 25-number problem if we require all sets of 5 successive
numbers to have an even sum?
224
6.8.3 Magic squares
Good old magic squares. Is there anything interesting left to do with them?
Here is a 3x3 magic square. What patterns can you
see in the numbers? What can you say about parity in
this magic square?
Can you make a different 3x3 magic square to this
one? Is it really different?
4
3
8
9
5
1
2
7
6
Explore the parity of the numbers in these magic squares:
16
3
2
13
23
6
19
2
15
5
10
11
8
4
12
25
8
16
9
6
7
12
10
18
1
14
22
4
15
14
1
11
24
7
20
3
17
5
13
21
9
Can you make 4x4 and 5x5 magic squares with different ‘parity patterns’? What
types of symmetry do they have?
Here is the parity pattern for the first 3x3 square:
4
3
8
9
5
1
2
7
6
I have coloured the even numbers in red.
The row/column total of a 3x3 magic square is 15, which is
odd, so each row and column must contain an even amount
of even numbers (0 or 2).
This suggests that there are no other possible arrangements for a 3x3 magic square.
225
For the 4x4 magic square, the parity pattern is on the
right:
This time the row/column total is 34, which is even, so
there needs to be an even amount of evens in each
line.
Can you find another possible parity
pattern for a 4x4 square?
Here is the parity pattern for the 5x5 square:
Notice that in fact all magic squares have an even
amount of even numbers in each
row/column/diagonal.
What else do you notice?
226
6.8.4 Golomb’s rulers
Golomb’s rulers are named after mathematician Solomon Golomb (who also wrote
the book on Polyominoes). This investigation is based on the information given in
Martin Gardner’s book Wheels, Life and Other Mathematical Amusements.
Before we find out what they are, here’s a puzzle:
Can you put the numbers 1 to 6 in the shaded squares given so that:
- Each number in row 2 is the sum of the numbers
above it
- The number in row 3 is the sum of all the numbers
in row 1.
This is not too tricky; here’s the solution:
Can you put the numbers 1 to
10 in this triangle, where the
numbers in third row are the
sum of the three numbers in
the first row as shown, and the
number in the fourth row is the
sum of all the numbers in the
first row.
After a bit of trial and error, you might have found this is impossible. The ‘best’ we
can do is put ten numbers from 1 to 11 in here, so there will be one number
‘missing’. By best, I mean the lowest possible numbers we can use.
Can you work out how to do this? If not, what is the best we can do for a triangle
of 15?
Here is the solution for numbers 1 to 11 in the
10-triangle:
I am going to leave the 15-triangle open for you
to try.
227
Golomb thought of this puzzle as being the way in which you can make a ruler with a
certain number of marks so that it can measure the most distances possible. To see
how this works, consider the ruler with 3 marks, at 1, 3 and 2 as shown:
We could use this ruler to measure distances of 1 to 6. Can you see how this is
effectively the same as the triangle puzzle? The 10-triangle problem leads to this
ruler with 4 marks:
Check this ruler can measure all distances from 1 to 11. Compare this with the 10triangle problem above; which distance can it not measure?
What is the ‘best’ ruler with 5 marks?
Golomb discovered this problem when
investigating the ‘distances’ between points on
complete graphs.
Here is the 3-mark ruler represented in yet
another different way, on the graph K4. The
edges are labelled with the difference
(distances) between the two end vertices.
You can see how the all the distances 1 to 6 are
present between the numbered vertices.
Can you draw the corresponding graph for K5?
Golomb found that it was possible to create a graph (ruler) of distances 1 to 9 by
removing one edges of K5. Can you draw this?
Here is a famous graph called the Petersen graph:
Can you label the graph so that all the distances
1 to 15 are represented?
Investigate Golomb numberings for other
graphs.
228
7 The Maths of voting
This section is based on a series of lessons I taught on voting systems. I devised the
lessons with two objectives in mind: to improve students understanding of
percentages and working with data, and to show how maths can be meaningfully
applied to real life situations.
Some of the ideas here come from the excellent book The Mathematics of Voting
and Elections by Jonathan Hodge and Richard Klima, part of the amazing AMS
Mathematical World series.
229
7.1 What makes a good voting system?
What do you think is important in a good voting system?
There are many features of a good voting system, many of which we will discuss as
we go through this section. However, to start with, we are going to analyze some
basic mathematical requirements.
To see what these requirements are, consider these voting systems:
Dictatorship: A dictatorship can be thought of as an election in which only 1 person's
vote counts - whoever that person votes for wins. Clearly all voters are not equal - a
property we probably do not want our voting system to have!
A system in which all voters are equal is called anonymous.
Imposed Rule: With imposed rule, it doesn't matter how anyone votes, so all
candidates are not equal (as opposed to voters). We could think of this as saying it
doesn't matter how voters swap their votes, the winner will not change - again, this
is a not property we want our voting system to have.
A system in which the order of two candidates changes if all voters swap their votes
for these candidates is called neutral.
Minority Rule: Suppose the winner of an election was the one that got the least
votes (which would be a bit weird). Then as a candidate gets more votes they would
eventually lose the election. Clearly this is not desirable.
A system in which increased votes = an increased chance of winning is called
monotone.
These three properties are a good start for any voting system. May's Theorem
(named after US mathematician Kenneth May) says that the only two-candidate
system that has all these three properties is Majority Rule: the winner is the one
with most votes (greater than 50%).
So far, so simple! But what if there are more than two candidates? As we introduce
more candidates it is unlikely that any one candidate will gain a majority. For
example, the last time a UK party had a majority vote was in 1935!
We are going to look at some multi-candidate systems that only have one winner,
and then we are going to look at some systems that have many winners in smaller
regions, leading to one overall winner, such as the UK and US elections.
230
7.2 Some voting systems
7.2.1 Plurality
Plurality is the system in which the winning candidate receives the most (first place)
votes, regardless of whether they gain a majority. You might think this is the perfect
way of choosing a winner.
However, simple plurality is not used in the UK or US national elections. For
example, in the 2000 US election, Al Gore received more votes across the whole
country than George W Bush, but Bush won the election.
The US system uses a system called Electoral College, which we will explore in more
depth later. In simple terms, the winning candidate is chosen in each state using
plurality, which then counts as a certain number of votes in the House of
Representatives and Senate, the number of votes depending on the size of the state.
The UK uses a mixed system called First Past The Post (FPTP): each winning MP is
chosen using plurality, which then counts as 1 seat towards the party total. We will
also explore the UK system in more depth.
What do you think might be the problems with plurality? How about the mixed
version of plurality used by the US and UK?
This example will demonstrate some of the problems with using simple plurality to
elect a candidate. Consider the following table in which voters chose their first
second and third preferences from three candidates Norm, Skip and Jesse. The
numbers at the top are the number of voters who chose that particular order of
preference, so for example 35 people chose Norm first, Skip second and Jesse third.
Under plurality, Jesse wins this election with more first place votes.
This is a representation of the situation that happened in the US Minnesota
Governor elections in 1998, when Jesse ‘The Body’ Ventura was elected into
government.
231
Do you think is the best and fairest representation of the public preferences? If
not, why not?
Can you think of a better method for electing a winner?
You have probably spotted that although Jesse got more first place votes (37) than
the others, he was also the last place vote of the rest (63).
Perhaps you think it would be better to award points for first, second and third? Or
perhaps there should be some kind of knockout competition? These are all ideas we
are going to explore, but for the time being let’s just say it would appear there are
problems with plurality.
232
7.2.2 Borda Count
The Borda Count is a system invented by the French mathematician, physicist and
naval officer Jean Charles de Borda in the 18th century. He was most famous for his
work on fluids, disproving some of Isaac Newton’s theories, as well as inventing
navigational instruments. It is argued by some that his is the most logical choice for a
simple voting system.
It works by allocating points to candidates according to the voter’s order of
preference, so taking account of other places apart from first. Consider this example
of an election between Fred, George, Harriet and India:
According to this system, 0 points are awarded for last place, increasing up to 3
points awarded for a first place. So Fred gains 41 points ( = 12 x 3 + 7 x 0 + 5 x 1 + 3 x
0 ).
Who wins under this system? Do you agree with the winner under this system?
Who would win under plurality?
We can calculate that George would win with 48 points, even though he would lose
under plurality; he only got 7 first place votes compared with Fred’s 12.
Do you think this is fair?
You could argue that it is, as it takes more information into account than plurality,
and we have seen how flawed plurality can be. In fact, the Borda Count satisfies all
the conditions we have stated so far. Further to this, it does not allow for irrational
conclusions; the candidates are ranked in order of top to bottom based on the
points. We will see an irrational conclusion might look like in the next section.
An undesirable property of the Borda Count is that a candidate with a majority can
actually lose under the Borda Count.
Can you create an example where this happens?
233
7.2.3 Pairwise voting
This system is a knockout system. To see how it works, consider the election
between Fred, George, Harriet and India again:
Let's set up a knockout competition, where George 'plays' Harriet, the winner plays
Fred and the winner of that plays India. This ordering is called an agenda and is
written GHFI.
Who wins under this system? Do you think it is fair? What are the problems with
it? What criterion does it not satisfy? Try different agendas; is the outcome still
the same?
Under this agenda, G beats H by 19 votes to 8, then F beats G by 17 votes to 10, then
I beats F by 15 votes to 12. So India is the winner. But this doesn't seem fair – she
would lose under plurality! And we know that George won under the Borda Count.
Who would win if the agenda was changed to IGHF? Can you create agendas so
that each candidate can win?
Fred would win under the agenda IGHF! It is possible that all the candidates could
with under certain agendas. Surely we can't have a system whose outcomes are so
dependent on the ordering.
Now switch all the votes for Harriet and India and use the agenda GHFI again.
What happens? Why does this highlight another problem with this system?
Under neutrality, by swapping Harriet’s votes for India’s, we would expect Harriet to
win in place of India, but this doesn't happen; this time George wins. So this method
fails the criterion of neutrality.
Who would win the Minnesota governor elections under this system? Does it
seem a fair method for this election?
234
In the 18th century another French mathematician Marquis de Condorcet came up
with another criterion that a good voting system should have, called the Condorcet
Winner Criterion (CWC). In a system that satisfies CWC, the Condorcet Winner must
beat all other candidates when compared head-to-head, so pairwise voting would
definitely meet this criterion.
Do you think this is a reasonable criterion or not? Explain why.
Well, as it is tied in with pairwise voting, which seems flawed, we might gather it is
not a sensible criterion. Consider the example with Fred et al.; George and Harriet
win two of the head-to-head comparisons, whilst Fred and India wins one; there is
no Condorcet Winner here.
We can see this more clearly with this simple example:
Who is the Condorcet Winner for this election?
There isn’t one! A beats B, B beats C and C beats A, and we have no winner.
This example shows that pairwise voting, and the Condercet Winner Criterion, allows
for something called non-transitivity. Transitivity is an important mathematical
concept. For example, if we say a = b and b = c, then it seems logical to say a = c; we
say that equality is a transitive relation.
Can you think of any other transitive relations?
Here is an example to suggest why non-transitivity is irrational. Suppose you were
asked to state your preferences for crisp flavours; would it seem rational to say you
prefer salt and vinegar to ready salted, and ready salted to cheese and onion, but
that you preferred cheese and onion to salt and vinegar?
The fact that pairwise voting allows for non-transitive conclusions is the biggest
argument against its use.
235
I have a set of dice that display non-transitivity. You can make a set from these nets:
Suppose we play a game where you choose a dice, then I choose a dice, roll them
ten times and the most highest scores wins.
Which of these dice would you choose to play with? Why?
A logical thing to do would be to add up the dots on each one and choose the one
with the most; unfortunately they all have 21 dots. At this point you might go for the
one with the highest numbers, but it’s quite hard to say… Green looks like a good
bet, so let’s suppose you went for green.
Which one should I choose? Why?
Ah, but look at blue; all the 5s beats all of your numbers, and the 2s beat the 1.
Maybe I have a better chance of winning…
Can you work out my chances of winning if you choose green and I choose blue?
Here is a table showing all the possible
outcomes. My odds of winning are 21:15, or
more simply 7:5. Alternatively you can say the
probability of me winning is 21 out of 36, or
21/36 = 7/12, and for you it is only 5/12.
So you decide that you are going to choose blue
instead.
What dice should I choose now?
Another moments thought and you realize that I am going to choose red, which will
again give me a 7:5 chance of winning (why?). So of course, you should choose red,
but this is the worst possible thing you could do, because then I will choose green!
What are my chances of winning now?
236
Explore these other sets of non-transitive dice:
Can you make a set of your own?
237
7.2.4 Alternative Vote
This method is called Alternative Vote (AV) in the UK and Instant Run-off in the US.
AV is used in the London Mayoral elections.
This is how it works: Voters submit their preference orders (first to last place). The
candidate with the least 1st place votes is eliminated, and the ordering is adjusted
accordingly. Then the candidate with the next least 1st place votes in eliminated and
so on until we have a winner.
Consider this example:
Under AV, D would be eliminated first, leading to this adjusted table:
Can you now work out who wins this election?
Try swapping the preference between A and C for the 2 voters in the last column;
what happens now? Based on this, on which of our criteria does this system fail?
B would be eliminated next, leaving A with 11 first place votes and victory. Note how
B would have won under Borda Count.
This system fails the criterion of monotonicity. If the 2 voters in the last column
change swap their preferences for A and C, this actually leaves A in a worse position
and B now wins!
Also, have a look at the following example:
238
Who wins under this election under AV? Who is the Condorcet winner?
A would lose under AV, even though she is the Condorcet Winner, so AV also fails
CWC.
We will find out more about AV later when we look at the UK and US election
systems.
239
7.2.5 Approval voting
Approval voting is a relatively recent method used to elect the Secretary General of
the UN, among other things. In this system, voters can choose one or more
candidates they approve of using a tick. They leave candidates they do not approve
of blank.
Here is a simple example in which David would win:
What do you think are the pros and cons of this method? What criteria does this
method satisfy? Which ones does it fail?
Do you think this method could be successfully used in UK elections?
It would make sure that unpopular candidates did not get voted in. It also satisfies
all the criteria we have stated so far apart from CWC
Approval voting has been criticized by Fairvote, a US organisation that advocates
voting reform. They have said it is susceptible to certain practical flaws such as
tactical voting, as well as the theoretical flaw that it can allow candidates to win who
may not be the majority choice.
240
7.3 Arrow’s Theorem
This section looks at a famous result in the analysis of voting systems called Arros’s
Theorem
7.3.1 Independence of Irrelevant Alternatives (IIA)
As well as the criterion for voting systems we have already looked at, there are many
other features we could consider. One of these is something called Independence of
Irrelevant Alternatives (IIA). This means that if you remove a third (or lower) placed
candidate, the result should stay the same.
Consider the following election results:
Under (say) the Borda Count, we can see that B wins and A comes second. But if we
remove the third place candidate C, then A beats B. So the Borda system fails the IIA
criterion.
How about the other systems we have been looking at; do they meet the IIA
criterion?
In fact, it turns out that the only one we have studied so far that meets the IIA
criterion is Approval Voting.
Often third candidates can have a huge effect on the outcomes of an election. As we
will see later (Electoral College) in the 2000 US elections, Bush won Florida State by
just 537 votes. The third place independent candidate Ralph Nader got nearly
100,000 votes, along with 40,000 votes for other candidates; if only 538 of these
voters had voted for Gore, he would have been president.
241
At this point, you might find it interesting to investigate other voting systems,
such as:
•
•
•
•
Voting for who will hold the Olympic games
The French presidential elections
The Oscars
Game shows like Weakest Link, Survivor or Pop Idol or...?
242
7.3.2 Arrow’s Theorem
It appears so far that it is hard to create a system that meets all our requirements,
namely anonymity, neutrality, monotonicity, CWC and IIA. Is there a system that
meets all these requirements or not?
In 1972, an American economist called Kenneth Arrow won the Nobel Prize for his
work on voting systems.
He was playing around with the different voting systems we have played with here,
and was coming to the same conclusions: no voting system is perfect. He decided to
try and prove that there was no voting system that would satisfy certain key criteria.
His first 4 criteria (in our words) for a good voting system are that it should be:
•
•
•
•
Anonymous (every voter is equal)
Neutral (if voters swapped votes, the results would also swap accordingly)
Monotone (increase in votes should not result in losing from a winning position)
Independence of Irrelevant Alternatives
We have seen that these are reasonable criteria for a good system. His fifth criteria
was called Universality, which more or less says that voters should be able to vote
for who they wish in whatever order, without restriction. He did not include CWC in
his criteria (we have seen this is a rather flawed criterion).
However, unfortunately, his ‘Impossibility Theorem’ states that it is impossible for
any voting system (with more than two candidates) to satisfy all five of Arrow’s
criteria!
This theorem has interesting consequences. For example, we have already seen that
the Borda Count fails IIA through an example.
How could you use Arrow’s Theorem to prove that the Borda Count does not
satisfy IIA?
We can state that the Borda Count does not satisfy IIA because it satisfies the other
4 criteria (it clearly satisfies universality – why?), and so by Arrow’s Theorem it must
fail IIA.
How about our other methods; can we say anything about them as a result of
Arrow's Theorem?
We can say that plurality also fails IIA for the same reasons. We can’t conclude
anything about whether pairwise voting and AV satisfy IIA from Arrow’s Theorem, as
they fail other criteria.
Approval voting does not really fit with the criteria of Arrow’s Theorem, as voters are
243
not allowed to rate candidates specifically; it can be argued that for this reason it
fails Arrow’s criterion of universality.
Bearing in mind it is impossible to satisfy all five criteria, which ones do you think
a good voting system should aim for?
There is no correct answer to this question; it is dependent on the purposes of the
elections.
Of course, these are not the only five criteria; there are many other (mathematical)
criteria that can be used for deciding between voting systems.
Find out more about criteria for judging voting systems.
244
7.4 UK 2010
7.4.1 How do UK elections work?
The UK elections use a voting system called First-Past-The-Post (FPTP). There are
650 constituencies (regions) in the UK. Everybody who is over 18 years old (and has
lived in the UK for a number of years) votes for an MP (Member of Parliament) in the
constituency where they live. The person with the most votes in the constituency
wins a seat in Parliament.
Each MP is a member of a political party; all the MPs across the country are added
up and the party with the most seats wins. If they get more than half of the seats
they have a majority in the House of Commons and get to run the country.
We are going to have a look at this voting system and see how it works, and if it is a
good system.
Here’s a simplified UK election with only 3 seats; who do you think should win this
election?
You could argue that Party A should win because they won 2 seats. But you could
also argue that Party C should win because they got the most votes.
According to the UK system, Party A would win 2 seats (and gain a majority in the
House of Commons), Party B would win 1 seat, and Party C would get no seats, and
therefore no power. This is an example of one of the key flaws of the UK voting
system.
245
7.4.2 Who won UK 2010?
Here are the results of the 2010
election:
What percentage of seats did each
party win?
Did any party gain a majority
(more than half the votes)?
You can see that the Conservative party gained 47% of the seats, and therefore 47%
of the power. The Labour party gained 40% of the seats, and the Liberal Democrats
gained 9% of the seats. As no party gained a majority of seats (for the first time since
1974), the Conservatives and the Liberal Democrats decided to form a coalition
(joint) government in order to gain a majority in the House of Commons.
Here is a map showing
where the different
seats were won.
What do you notice
about the map?
Why do you think
this is?
It seems that conservatives gained more seats in the South of England (except for
London), perhaps as these areas are more affluent?
246
As I live and teach in London, let’s have a look at
the spread of seats across London:
It would appear that Inner London is mostly
Labour, apart from West London which is
Conservative, with some Liberal Democrat regions.
What can you say about the spread of Conservative
and Labour seats across London?
Here is the full London scorecard:
What else can you say about votes in London from this data?
247
7.4.3 Seats v votes
Now have a look at the table on the
right, which shows how many votes
each party won in the election.
The number of people who voted (called the turnout) was 29,691,380.
What percentage of the turnout voted for each party? Compare these
percentages of seats above. Do you think the number of seats is given out fairly?
The percentage of the turnout who voted for the Conservative party is 36%,
compared with 29% for Labour, and 23% for the Liberal Democrats. You can see
there is a large difference between the percentage of seats and the percentage of
votes.
Why do you think this might be?
This is possibly because the Liberal Democrats have to beat both the Conservative
and the Labour parties to win any seat. Can you think of any other reasons?
You can see the difference between votes and seats even more clearly if you work
out the votes per MP for each party.
How many votes did each party win for each MP?
The Conservatives gained 34,940 votes per MP (=10726614 / 307), Labour 33,370
but the Liberal Democrats required 119,944 votes for each of their MPs.
248
7.4.4 Referendum 2011
Not surprisingly, following this election the Liberal Democrat leader Nick Clegg called
for a referendum of the UK voting system. He proposed that we change the UK
system to the Alternative Vote system described earlier, in order to share the seats
more fairly in line with the percentage of votes. The 2011, the UK public voted to
keep FPTP by 13,013,123 to 6,152,607.
The idea of sharing seats in line with votes is called Proportional Representation (PR).
AV is not a straight PR system, but it does attempt to match seats to votes more
accurately. It has been projected that under AV, the seat share in 2010 would have
been Conservative 282, Labour 264 and Liberals Democrats 74.
How might history have been different under AV?
Working out the percentages, you can see that it might have been possible that the
Labour and Liberal Democrat form a coalition instead, as together they gained 338
seats (52%).
Do you changing the UK voting system to AV, or straight PR would be a good
idea?
Although it has its flaws, FPTP has the benefit that it creates more outright winners
of elections (although not in 2010). Under PR, there would be less outright winners
of elections and more coalitions, which may be a negative thing.
There are other issues with a PR system. Let’s look at one of the more extreme
parties in the UK. The BNP party is a far right party that, to put it politely, has
questionable policies, especially regarding immigration.
In the 2010 election they gained 564,331 votes; what percentage of the vote was
this? How many seats would they gain under straight PR?
This is around just under 2% of the vote, so they would have gained around 12 seats
in the House of Commons; thankfully, they did not gain any under PR. This also raises
a second flaw of PR; if no constituency voted for the BNP (or any other party), where
are these 12 seats to be allocated? Would you be happy with an MP you didn’t vote
for?
249
7.4.5 Single Transferable Vote (STV)
What other options are there apart from FPTP and AV? Single Transferable Vote
(STV) is used in Australian and Irish parliamentary elections, and is preferred by the
Electoral Reform Society in the UK and Fairvote in the US, two leading analysts of
electoral systems.
How does it work? There are many variations, but generally voters rank the
candidates, in a similar way to AV (when there is only one winner it is the same as
AV). Any candidate who attains above the quota of 1st place votes is elected.
The quota is calculated using the according to the Droop formula, which uses the
ceiling function, usually written as ⌈ ⌉. The ceiling function takes any decimal and
rounds it up to the nearest whole number.
𝑡𝑜𝑡𝑎𝑙 𝑣𝑜𝑡𝑒𝑠
The Droop formula is: 𝑣𝑜𝑡𝑒𝑠 𝑛𝑒𝑒𝑑𝑒𝑑 𝑡𝑜 𝑤𝑖𝑛 = ⌈𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑠𝑒𝑎𝑡𝑠+1 + 1⌉. This ensures
that there are not more winning candidates than there are seats.
How does this formula ensure there are not more winning candidates than there
are seats?
Consider the example where there are 10 seats to fill and 1000 votes are cast. Then
1000
the formula gives 𝑣𝑜𝑡𝑒𝑠 𝑛𝑒𝑒𝑑𝑒𝑑 𝑡𝑜 𝑤𝑖𝑛 = ⌈
+ 1⌉ = ⌈91.909 … ⌉ = 92. So each
10+1
candidate needs at least 92 votes to win. So we can only have at most 10 winners;
we can’t have 11 winners as 11 x 92 = 1012.
After counting first preferences, there will probably still be seats left to fill. For
example, if (say) 200 votes were cast for 5 candidates in the example above we
would only have 5 seats filled. In this case, the votes for the winning candidates are
removed and voter’s second preferences become their first preferences. Any
candidates now attaining the quota are elected and so on until the seats are filled.
What do you think are the benefits and problems with this method?
The main argument for STV is that it will give a fairer (more proportional)
representation of overall votes. The arguments against are that it is complicated, but
it is not complicated for the voter – they just have to write their preferences on the
ballot!
It is estimated by the Electoral Reform Society that in the
under STV, the UK 2010 election results (seats) may have
looked like this:
250
7.4.6 Equality in the House of Commons
Last but not least, here is a graphic
showing the split between male
and female MPs in the main UK
parties:
First of all, note that this graphic is
actually rather misleading; it
exaggerates the differences
between men and women.
Can you see why? How could you make this graphic more accurate?
You have probably spotted that the heights of the figures represent the numbers
given, but that the figures are also wider in the same proportions. For example, the
red male is not only around twice as high as the red female (to represent twice as
many MPs), he is also twice as wide; so he is 4 times bigger by area!
Based on the figures, work out the percentage of male and female MP in each
party and in total. Which party has the most equal gender balance? Is the gender
balance of MPs representative of the UK as a whole?
I will leave you to calculate some of these figures. Here is some information about
black and minority ethnic (BME) MPs in recent elections:
251
How would you summarize these figures? What percentage of MPs is currently
BME? How has the number of BME MPs increased over the years?
Is the percentage of BME MPs representative of the UK population?
The percentage of BME MPs in 2010 was 26/650 = 4%. This is an increase of around
(26-15)/15 = 73% on the previous election, so it is increasing.
Is the percentage of BME MPs representative of the UK population? We need more
data on the percentage of BME people in the UK. Here is a map of England (sorry I
didn’t have data for the whole of the UK) with percentages of White-British
residents, available from The Guardian data site:
What can we say about ethnicities across the UK by looking at this picture? Well, it
appears there are low percentages of BME people in the most Northern parts of
England, and there are patches where 0-50% of people are White-British, most
notably London. Here is the numerical data for the main areas of England, in
thousands:
252
Can you work out the split by ethnicity for England? How about the area in which
you live (if you live in England!)?
You can calculate that the percentage of White-British (and Irish) people living in
England is around 43,451,000/51,810,000 = 84%, so there are 16% BME people living
in England.
Looking at London in more detail, we can calculate that the percentage of BME
people living in Inner London is 43%. Looking even more closely at where I live and
teach, here is the split for Greenwich & Woolwich:
However you look at it, the number of BME MPs in the UK does not represent the
population as a whole.
Why do you think this might be?
253
7.4.7 Voter apathy
Many people in the UK feel as though their vote does not count, and many do not
vote in elections (called voter apathy). Here is a graph of voter turnout since 1945:
Confirm the calculation for 2010. The turnout was 29,692,380 from the total
electorate of 45,684,501.
The turnout was 29,692,380 / 45,684,501 = 65%. This is one of the lowest turnouts
in recent history, although not as low as 2001. If you are interesting, why not find
out more about the UK political climate in 2001. Why do you think was turnout so
low?
What percentage of the total electorate voted for a Conservative Prime Minister
in 2010?
The number of people who voted Conservative in 2010 was 10,726,614 out of
45,684,501, which gives 23% percentage. So less than a quarter of the UK population
voted for the current Prime Minister.
This may explain some voter apathy, but of course, if you don’t vote, you can’t moan
about who is in charge!
254
How does the FPTP system contribute to voter apathy? What other reasons might
there be?
Consider the votes in in Greenwich &
Woolwich (shown here). If you wanted to
vote for Conservative, your vote is unlikely
to have much impact on the result in
Greenwich & Woolwich (sometimes called a
wasted vote).
Furthermore, these votes will not count towards the general election result.
There are other issues that lead to voter apathy. A general discontentment with
politics in the UK (lack of real choice in the main parties, perceived corruption) might
lead people to not vote. There may also be feelings of lack of representation (see the
section above on BME MPs for example).
What are the consequences if more and more people did not vote due to these
reasons?
I’ll leave this to you to think about…
255
7.5 Weighted systems
In this section we are going to turn our attention to weighted voting systems, in
preparation for a look at the US voting system. Here we relax the condition of
anonymity, so that all voters are not equal. As an example of where this might be the
case, consider the following shareholders of a company:
Suppose the shareholders wish to vote on some motion, and that they decide it is
fair that the weight of their vote matches their stake in the company. For example, a
vote by David counts for 101 of the 200 total ‘votes’.
How should we decide whether the motion should pass? Should it be based on a
majority? If not, how else should we decide?
If we set the quota (the winning amount) to 100, then we have a dictatorship - only
David's vote counts. So where should we set the quota?
Perhaps we could set it at 102. Then David would need another voter to agree with
him in order to form a winning coalition. So with this quota, the sets of winning
coalitions are {David, Ed}, {David, Nick} and {David, Ed, Nick}.
In fact, it doesn't matter whether the quota is 102 or 103, the sets of winning
coalitions stay the same, and we say that these systems are isomorphic. We will use
the notation [102: 101,97,2] to describe this system, in which the quota is 102 and
the weights are 101, 97 and 2.
Which of these five systems are isomorphic to each other? You will need to work
out the winning coalitions for each system.
[4: 2, 2, 1]
[4: 3, 2, 1]
[5: 3, 2, 1]
[5: 3, 2, 2]
[5: 3, 3, 2]
We can see that [4: 2, 2, 1] and [5: 3, 2, 1] are isomorphic, as the winning coalitions
for both are either {A,B} or {A,B,C}, as are [4: 3, 2, 1] and [5: 3, 2, 2]. Notice how the
256
fifth one is different; it is the only one in which B and C can form a winning coalition.
Now, if a voter is in every winning coalition, we say that voter has veto power.
Who has veto power in the original example with David, Ed and Nick?
More generally, how do you think the power is shared between the three
members?
The sets of winning coalitions are {David, Ed}, {David, Nick} and {David, Ed, Nick}, so
David has veto power – if he doesn’t vote for something, it doesn’t happen.
However, this doesn’t mean that David has all the power. We will answer the
question of how power is shared between the members in the next section
UN Security Council
The UN Security Council has 5 permanent members and 10 temporary members who
change every two years. In order for a motion to pass, all five of the permanent
members must agree on the motion, as well as at least four of the temporary
members.
Who has veto power in this system? What is the quota for this system? What are
the weights of the members?
To calculate this, let's suppose that the weight of vote for each temporary member is
1 and for each permanent member is X. For a motion to pass, we need the total
weight of votes to exceed the quota, which we will call Q.
Can you express this information in an inequality?
Well, the minimal way in which a motion can pass is if 5X + 4 >= Q. Can you think of a
'maximal' way in which a motion does not pass and express this as an inequality?
A motion does not pass is 4X + 10 < Q. Putting these two inequalities together gives
Q = 39 and X = 7, so we can express this system as [39: 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1].
257
7.6 Banzhaf Power
Let's consider the weighted system with weights below and a quota of 102.
We saw in the previous section that the winning coalitions for this system are {D,E},
{D,N} and {D,E,N}, and we saw that David has veto power - no coalition can win
without him... but can we go a bit further an work out exactly how much power
David has?
What do you think? Do you think he has all the power? Do you think he has (say)
50 times more power than Nick? Do you think Ed has 48 times more power than
Nick?
There is no correct answer to this question, but one way of measuring the power of
each voter is to use Banzhof Power. It is calculated as follows:
• D is critical in all three of the winning coalitions - without him they would not win.
• E is critical in only one of the winning coalitions {D,E}.
• N is critical in only one of the winning coalitions {D,N}.
Now, the ratio of critical appearances for D:E:N is 3:1:1. Each of these numbers is
called the Banzhaf Power of each voter. We can also calculate the Banzhaf Power
Index (BPI), which is just each voter’s fraction of the total Banzhaf Power of the
system. Here David's BPI is 3/5, and Ed and Nick each have a BPI of 1/5.
Do you think this is a good measure of power in this voting system? Why/why
not?
Here's a more complex example. Suppose there are 6 board
members with the following shares in a company:
Suppose the quota is 58 (why?). What is the BPI of each
shareholder?
There are 115 votes in total, so 58 is a majority. There are 32
winning coalitions (did you find them all), each of which contain
either A and B, or A and C, or B and C (why?).
258
To find these easily, take these pairs and find all the combinations of others that go
with them:
So we have AB, ABC, ABD, ABE, ABF, ABCD, ABCE, ABCF, ABDE, ABDF, ABEF, ABCDE,
ABCDF, ABCEF, ABDEF, ABCDEF, then AC, ACD, ACE, ACF, ACDE, ACDF, ACEF, ACDEF
and finally BC, BCD, BCE, BCF, BCDE, BCDF, BCEF, BCDEF.
The critical voters are in bold. The ratio of critical votes for A to F is 16:16:16:0:0:0 so
that A, B and C share all the power (1/3 each).
This example is actually taken from a real example in a county election in the US
where the 'shares' (weights) were allocated according to the population of various
districts within a county New York. They realized that the three smaller districts had
no power.
Following an analysis of the BPI of each district, the system was changed to [65: 30,
28, 22, 15, 7, 6].
How did this alleviate the earlier problems? Do you think it is fair to allocate
larger weights even though the smaller districts have smaller populations?
Did you work them all out? Good for you! If you did, you will have found that even
the smallest district has some power (around 2%); although this does not represent
the populations exactly, it does lead to a fairer voting system.
If you really want a challenge you might want to work out the BPIs for the members
of the UN Security Council using the weighting system in the previous section!
If this has interested you, why not find out about some other measures of power,
such as the Shapley-Shubik Index?
259
7.7 Electoral College
7.7.1 How do US elections work?
The Electoral College is the name of the voting system in the US. This section gives a
slightly simplified analysis of this system and explores some of the historical
consequences.
Electoral College is similar to the FPTP system used in the UK, in that the US is
divided into states (constituencies) and the winner of each state is decided by
plurality. However, instead of each constituency contributing one seat to the
parliament as in the UK, each state contributes a number of members to congress
according to its population.
There are 538 electoral votes (seats) in the current US system, made up of the House
of Representatives (435), the Senate (100) and Washington DC (3). The electoral
votes in the House of Representatives are allocated according to population; as
populations change, so do the allocations. Here are the allocations in the House of
Representatives as at 2013:
You can see that California has the largest allocation of votes (53), and some have
only 1. We will look at how these seats are allocated below.
The 100 seats in the Senate are fixed at 2 for each state. This gives a bit of extra
weight in the system to the smallest states - you can't have a total of less than 3
representatives in congress (1 in the House of Representatives + 2 in the Senate).
Washington DC is a slightly odd one out; it has 3 members (total) in congress.
Now, when the election happens, people in (say) California decide who they want to
be president, from the list of candidates. Now, as there are 55 electoral votes (seats)
in California, they could divide these according to the votes cast. However, there is
an unwritten rule in US politics that is obeyed by (nearly) all states called winner260
takes-it-all (just like FPTP) that says that the candidate with the plurality of votes in
that state gains all the seats for that state.
What might be the consequences of the winner-takes-it-all system?
As we have seen from our analysis of the UK FPTP system, this could result in the
candidate with the most overall votes losing the election.
7.7.2 US 2000
Now let's look at the US 2000 election. It was won by George W Bush with 271
electoral votes to Al Gore's 266 (with 1 abstention).
The key state turned out to be Florida; it had a population in 2000 of 15,982,378
(what is this as a percentage of the population of the US?) and was allocated 25
electoral votes. The votes in Florida were as follows:
You can see that Bush gained 537 more votes than Al Gore in this state, but gained
25 electoral votes to Gore's 0 in this state.
Do you think this is fair?
Now, as you might have guessed, here are the total votes:
You can see the flaws in the system here. If the US election was based on the
number of votes, history might have been very different. A tiny difference in the
preference of voters (a swap of 269 from Bush to Gore here) would have resulted in
a different US President!
261
Have another look at the map of allocations between states in the House of
Representatives. Mathematically speaking, what is the minimum number of votes
with which someone could win the US presidential election?
It is actually (mathematically) possible for a candidate to win the US election with as
few as 11 votes - if only one person turned up to vote for them in each of the 11
largest states (which would give a majority of electoral votes)! Of course this
wouldn't happen, but it is possible to win the US election with a relatively small
number of votes.
There is a further flaw in the system. Candidates who have little chance of winning in
certain states do not campaign there. For example, in 2000 Bush did not campaign in
California as he had little chance of winning there (and similarly for Gore in Texas).
7.7.3 Who would have won US 2000 under AV (Instant Run-off)?
Let’s suppose that Gore was
the 2nd choice of all the
Browne (Libertarian) voters,
and Bush was the second
choice of the Buchanan
(Reform) voters, and let's say
the other 2nd votes were split
50-50.
With these assumptions, who would win this election under AV?
In the first two rounds of the AV process, all of Browne’s votes would go to Gore and
Buchanan’s votes would go to Bush, with others split between them 50-50, leaving
the total votes as:
Now, the 2nd choices of Nader voters decide the election.
What percentage of these voters would have to prefer Bush for him to win the
election?
262
The difference between Bush and Gore at this stage is 479,431. So Bush would win
this election if this number of Nader voters preferred him to Gore.
So the percentage, p, that Bush would need is given by 2,882,955 x p – 2,882,955 x
(1 – p) > 479,431 which gives p around 58%.
Find out more about the (2000) US elections. What type of people voted for Bush
and Gore? Was Bush a popular president?
Who was Ralph Nader, and what type of voters who voted for him?
Do you think it is more likely that Bush or Gore would have won this election
under AV?
Again this stresses the importance of Spoiler candidates, but perhaps more
importantly it stresses again the importance of casting your vote!
7.7.4 How are electoral votes allocated?
The allocation of electoral votes (seats) in the
US is reasonably complicated. Consider the
following example from the first US
population census in 1790:
In 1790, the House of Representatives
wanted to allocate 105 seats between the 15
states fairly.
How would you do it? Work out the
figures using your method; does it work?
Assuming that you calculated each allocation
based on the proportion of the overall
population in that state and then rounded in
the normal way, you will find that this
method requires 106 seats.
So how can you fairly allocate the seats?
Who would you take that last seat away
from?
In 1790, a mathematician called Hamilton suggested that the fractional allocation of
seats should not be rounded in the usual way, but instead should be rounded down
(so each allocation is the integer part of the fractional allocation); the seats are then
allocated accordingly.
263
Try out Hamilton’s method. How many seats are left over? How do you think you
could allocate these spare seats fairly?
Using Hamilton’s method you will find that 96 seats are allocated, leaving 9 spares.
Hamilton then suggested that the remaining 9 surplus seats are allocated to the
states with the largest decimal parts left over.
Who would get the 9 remaining seats under this method? Do you think
Hamilton's method is fair?
Here are my calculations:
Is this method fair? Consider Delaware, which has a fractional allocation of 1.594,
but misses out under Hamilton's method. Compare this with Maryland, which gets
one of the surplus seats with a fractional allocation of 8.622. Do you think it is fairer
to allocate the seat to Maryland or Delaware?
Can you think of a fairer apportionment method? Find out more about other
apportionment methods that are/have been used.
264
8 Maths and music
This section was designed to give an introduction to the ideas of ratio, along with
practice with fractional indices and working with fractions.
265
8.1 The standard scale
The diatonic scale (sometimes called the standard scale) is given by the series of
intervals tone-tone-semitone-tone-tone-tone-semitone. If we start with the note C,
the sequence is then C-D-E-F-G-A-B-C. Each (whole) tone is worth 2 semitones, so
the intervals between E-F and B-C are semitones.
We can write this on a normal musical staff like this:
The symbol on the left is called a treble clef (or G-clef) as the note G is on the line
through the ‘centre’ of the symbol. Each line on the staff represents two whole
notes, so these notes represent the standard scale C-D-E-F-G-A-B-C.
If we start with a different starting note (called the tonic) and keep the same scale,
we will get a different sequence of notes. For example, with tonic D we have D-E-F
♯-G-A-B-C♯-D. The symbol ♯ is called a sharp, and denotes that the note is a
semitone higher (so F♯ is a semitone higher than an F). The opposite of a sharp is a
flat, and is written with the symbol ♭. The sharps and flats (called accidentals) are
the black keys on the keyboard.
This describes the key signature for the key of
D, which has two sharps on F and C like this:
The bottom staff has a bass clef, or F-clef,
which is centred on F instead of G.
What sequence of notes do we get with tonic E? Or F? Can you write the key
signatures for these keys?
For the key of E we have E-F♯-G♯-A-B-C♯-D♯-E, which has 4 sharps. Note that
each letter appears once, so we need sharps not flats to make that happen. The key
of F is F-G-A-B♭-C-D-E-F, which has one flat. Here are the key signatures for these:
266
The notes are often given names, according to their position on the standard scale.
For example, the fifth note is called the (perfect) fifth. This is G in the key of C, and is
7 semitones above C. Other names for the notes we will be talking about here are:
Minor third (3 semitones), major third (4 semitones), perfect fourth (5 semitones),
major sixth (9 semitones), minor seventh (10 semitones), major seventh (11
semitones) and octave (12 semitones). We will see where these names come from
later.
If we start at C and go up a fifth (7 semitones), we get to G, which gives the same
note (albeit an octave apart) as going down a fourth (5 semitones). We could think
of this in the language of modular arithmetic by noting that 7 ≡ −5(𝑚𝑜𝑑 12).
There are other scales that are used, some of which are cycles of the standard scale
above. For example, the Aeolian scale is tone-semitone-tone-tone-tone-semitonetone, which in the key of C is C-D-E♭-F-G-A-B♭-C.
Which key in the Aeolian scale is the same (all white keys) as the key of C in the
standard scale?
As the Aeolian scale is shifted one place to the left, we also shift the notes one place
to the left to give D-E-F-G-A-B-C-D, so it’s the key of D.
Where did this musical scale come from? Why are there 12 notes, and why are
they arranged in this way?
We will find out in the next few sections.
267
8.2 Frequency
The history of musical instruments date back to the beginning of human culture, and
it is impossible to say where the first instruments were created. It has been known
for thousands of years that shortening the length of a string and plucking it (by
holding it down on a fret-board) changes the frequency of vibrations and creates
different notes.
For example, shortening the string by half its length creates a note that sounds twice
as high pitched; we say the note doubles in frequency. Shortening a string to 1/3 its
length creates a note with three times the frequency.
This suggests that length and frequency are inversely proportional, or we could say
that the change in frequency is the reciprocal of the change in length; as length gets
shorter, frequency gets higher. We can write this using the sign for proportion:
𝑓𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 ∝
1
𝑙𝑒𝑛𝑔𝑡ℎ
By what fraction would we need to shorten a string to play a note 3/2 times
higher in frequency than the open string?
1
Noting the relationship 𝑓𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 ∝ 𝑙𝑒𝑛𝑔𝑡ℎ from the previous section, if we wanted
to multiply the frequency by 3/2, we can find the change in length by working out
the reciprocal to give 2/3; the length of the string must be reduced to 2/3 its original
length.
It has also been known for many years that some notes sound harmonious when
played together (consonant) and some less so (dissonant). What is it about some
combinations of notes that make them sound more harmonious than others? It must
be connected to the frequency, or more accurately the relative frequency, of the
notes.
What exactly is the frequency of a note? It is the number of times it pulsates in a
second, and is measured in Hertz (Hz, cycles per second). The note A4 has a
frequency of 440Hz, where the subscript 4 denotes where it is in the grand scale of
notes; A5 is the same note but is an octave higher (double the frequency). We can
say the ratio of the frequencies A5 : A4 is 2: 1, or 𝐴5 / 𝐴4 = 2 / 1 = 2, and we can
calculate that A5 has frequency 880Hz.
268
It has long been known that notes with relative frequencies written using ‘small’
numbers are the most harmonious. To see why, we need to think about what is
physically happening when we hear a sound. A simplified account of what happens
(given by Galileo) is to consider sound as waves with a certain frequency; here is a
picture showing two waves an octave apart:
We can see the peaks and troughs of the waves are aligned, so making the sound
more consonant. It turns out this is an oversimplification of what happens, but we
will stick with this explanation for now.
To simplify this even further, we can think of as ‘pockets’ of air hitting our ear every
fraction of a second. For example, pockets of sound travelling with a frequency of
440Hz hit our ear every 1/440 = 0.00227 seconds.
How often would the note A5 hit our ear?
A5 has twice the frequency, so would hit our ear twice as often, around every
0.00114 seconds. We can plot the arrival of these air pockets on a graph:
You can see that the two sounds hit our ear in the ratio 2:1 as described by the
frequency.
Now let’s explore frequencies for notes between the octave, i.e. between 1/1 and
2/1.
What is the simplest ratio (with the lowest whole numbers) between 1/1 and
2/1?
It seems obvious that it is 3/2 (one and a half). A note with frequency in the ratio 3:2
to A4 would have frequency 3/2 x 440, which is 660Hz. We can check this by noting
that the ratio of the frequencies is 660:440 which is equivalent to 3:2.
269
How often would the sound pockets hit out ear for this new sound? Can you draw
a similar graph to that above to show how the pockets of sound hit our ear?
The pockets of air hit our ear every 1/660 = 0.00152 seconds. The graph for the new
sound (the top line, in black) compared to A4 (below, red) looks like this:
seconds
You can see that the notes coincide in the ratio 3:2 as expected. This is why they
sound pleasing to the ear.
What other ratios between 1 and 2 might sound good to the ear?
We are looking for ratios with as low numbers as possible. Here are the ratios with
3 4 5 5 7 6 7 8 9
denominators 5 or less: , , , , , , , , .
2 3 3 4 4 5 5 5 5
Can you put these fractions in order of size, smallest to largest?
The easiest way to do this (without a calculator!) is to change them into 60ths (60 = 2
x 2 x 3 x 5 is the lowest common multiple of 2, 3, 4 and 5). Here they are in 60 ths:
90/60, 80/60, 100/60, 75/60, 105/60, 72/60, 84/60, 96/60, 108/60, and so here they
6 5 4 7 3 8 5 7 9
are in order: , , , , , , , , .
5 4 3 5 2 5 3 4 5
How does this relate to our musical scale? You may have noticed that there are 9
‘notes’ here that sound harmonious to the tonic (10 if you include the octave), but
our musical scale contains 12 notes. How do they match with to these frequencies?
This is the tricky part – it all depends on how you tune your instrument!
270
8.3 Pythagorean tuning
The Ancient Greeks, and in particular Pythagoras, believed that the ratio 3:2
represented the perfection of the universe and based his musical scale upon it.
How did Pythagoras use the ratio 3:2 to make a whole scale of notes? If we use the
example of the key of C, his scale starts with two notes in the ratio 3:2, meaning that
the new note has frequency 3/2 times the tonic. We could write this ratio 3/2 : 1,
and adding in the octave gives three notes in the frequency ratio 1: 3/2: 2 (lowest to
highest).
Can you write these ratios as whole numbers?
What is the ratio between the second and third notes?
The ratios can be written equivalently as 2: 3: 4, so that the ratio of the third and
second notes is 4: 3. This ratio was then used to create a new note, at a ratio 4:3
above the tonic, giving a four note scale: 1: 4/3: 3/2: 2.
Can you write these ratios in the simplest form (with the lowest possible
integers)?
The lowest common multiple of the denominators is 6, so multiplying through to give
denominators of 6 gives the ratio 6: 8: 9: 12.
Pythagoras did not want a scale with just 4 notes (that would make for some boring
music!), so he used the ratio between the middle two notes to create another
interval.
What is the ratio between of the middle two notes?
We can see from the above calculations that the ratio between the middle notes is
9: 8. Pythagoras used this fact to find the ratios for all the other notes in the
standard scale.
Can you work this out how to do this?
Starting with the first note as 1, we have the next new note as 9/8. Using this ratio
again, we can create another new note by just multiplying this one by 9/8 again,
giving 9/8 x 9/8 = 81/64.
Now, if we multiply by 9/8 again, we get another new note (729/512) but Pythagoras
decided against this, because the ratio between the numbers is high, producing a
discordant note. Also, 729/512 is higher than 4/3, which we already have, so he left
271
4/3 as the next (fourth) note, and 3/2 as the fifth. Then starting again with the
interval 9/8, he multiplied to give the sixth and seventh notes 27/16 and 243/128.
So here are the frequency ratios given by Pythagorean tuning:
1
9
8
81
64
4
3
3
2
27
16
243
128
2
This scale forms the basis of the musical scale we use today; the seven notes are the
major notes in our standard scale. In the key of C we would call these C-D-E-F-G-A-BC, with the ratio 9/8 representing a whole tone.
What do you think are the main problems with the Pythagorean tuning?
First of all, we can see that only two of the notes have low-integer ratios, so some of
the notes might sound discordant. Let’s compare this to the low-integer ratios we
6 5 4 7 3 8 5 7 9
found earlier: , , , , , , , , .
5 4 3 5 2 5 3 4 5
The Pythagorean third 81/64 is close to 5/4, the 27/16 is close to 4/3 - Pythagorean
tuning comes close to some of the lowest integer ratios.
However, there is another important problem with Pythagorean tuning. The ratio for
a whole tone is 9/8, but what is the ratio for the semitone?
Looking at the scale above, we can find the semitone ratio by working out 81/64 x
something = 4/3. So we need to work out 4/3 divided by 81/64, which by the rules of
dividing fractions, is the same as 4/3 x 64/81 and we get 256/243.
Can you see a problem with this?
Two semitones should make a whole tone, so using the ratios above, it should be
true that 256/243 x 256/243 = 9/8, but it isn’t!
272
A different way of thinking
about Pythagorean tuning is to
use the circle of fifths:
If we start at the top (C) and go
round (clockwise) in intervals
of fifths, we get the notes
shown.
[Notice also how the key
signatures of each key increase
with one extra sharp (one less
flat) each time.]
How is this related to Pythagorean tuning? We can tune according to Pythagoras’
‘perfect’ ratio 3:2. Starting at C, we move clockwise to G and multiply frequency by
3/2.
Moving one more step round the circle to get D we multiply 3/2 by 3/2 again, which
gives 9/4. This is bigger than 2 so is more than an octave above the starting C. We
can adjust this to be in the same octave by dividing the frequency by 2 (why?) to give
the tuning of D as 9/8, which matches our Pythagorean tuning.
The next note in the circle, A, is then found by calculating 9/8 x 3/2 = 27/16 which
again matches the tuning given above.
Keep going round the circle of fifths and check the tunings match those given
above. Can you suggest why this might be problematic?
The frequencies do indeed match the tunings given above, but the problem comes
when we try and tunes notes above the octave. For example, what is the note that is
a seventh above A?
Starting at 27/16, we multiply by the ratio for a seventh to give 27/16 x 243/128 =
6561/2048, which is a new note not on our scale (it doesn’t simplify to anything on
our scale).
Here is a diagram showing the problems of Pythagorean tuning:
273
You can see the discrepancy between A♭and G♯. Thus the circle of fifths
becomes a spiral of fifths, not quite meeting to make a circle!
We can think of this in a different way. There are 12 fifths (12 x 7 semitones) in 7
octaves (7 x 12 semitones), so these tunings should match.
Work out the Pythagorean ratio for 12 fifths compared with that for 7 octaves.
What do you notice?
Using the Pythagorean tuning of 3/2 for a fifth we have 12 fifths = (3⁄2)12= 129.75
whereas 7 octaves is 27 = 128. So they do not match.
If we think about this a bit more, we could have known this by noticing (3⁄2)𝑛 ≠ 2𝑚
for all n and m as 3𝑛 ≠ 2𝑚 for any values of n and m.
During the thousand years after the Greeks, Pythagorean tuning was the most
common in use. Due to the dissonance between the tonic and thirds and sixths,
these notes were not generally used in music during this time, and notes were often
not played simultaneously. Also, music was not played across many octaves due to
the problems with transposition.
Between around 900AD – 1300AD musicians started to play 2 notes simultaneously
from the limited selection of octave, fifth, fourth, octave + fifth, octave + fourth and
double octave.
Can you work out the ratios for octave + fifth and octave + fourth?
274
Octave + fifth is the ratio 3/1 = 2/1 x 3/2 and octave + fourth is 8/3 = 2/1 x 4/3.
275
8.4 Just intonation
People tried to find a solution to these problems with the Pythagorean tuning for
hundreds of years. In 1558, a musician called Guiseppe Zarlino proposed a different
tuning. He kept the Pythagorean ratios for the tonic, fifth and octave 1: 3/2 : 2
(2:3:4), which also gives 4/3 for the fourth. He then fixed the ratios between the
tonic, third and fifth to be 1: 5/4 : 3/2 (or 4:5:6).
Can you derive the whole (7 note) musical scale that comes from these ratios?
Using the ratio between the fourth and fifth for the whole tone, we get 9/8 again.
Also, using the thirds ratio, we can use the fourth note to derive the ratio of the sixth
to be 4/3 x 5/4 = 5/3, and the fifth note to derive the ratio of the seventh to be 3/2 x
5/4 = 15/8, giving the whole scale C-D-E-F-G-A-B-C as:
1 ∶ 9/8 ∶ 5/4 ∶ 4/3 ∶ 3/2 ∶ 5/3 ∶ 15/8 ∶ 2
You can see that this has much lower ratios than the Pythagorean tuning.
Can you see any problems with this tuning? Consider the ratios between
successive notes, and think about the other problems with the Pythagorean
tuning – do they apply here?
The first thing to note is that the interval for a whole tone depends on which whole
tone we are talking about! For example, the first whole tone is 9/8 but the second
one is given by 9/8 x something = 5/4. So, 5/4 divided by 9/8 = 5/4 x 8/9 = 10/9.
Working out intervals for all successive notes gives whole tones the alternate
between 9/8 and 10/9, with a semitone of 16/15. Zarlino called the larger whole
tone (9/8) the major tone, and the smaller one (10/9) the minor tone.
As you have probably guessed, this creates a problem. Consider transposing from D
to A, up a fifth. D is 9/8 and a fifth is 3/2, so we get 9/8 x 3/2 = 27/16, which is not
the correct ratio for A (it should be 5/3).
Can you explain exactly why this happens?
This happens because the interval for a fifth in the scale above comprises of major
tone, minor tone, semitone, major tone. However, the interval from D to A is minor
tone, semitone, major tone, minor tone; this has a different number of major and
minor tones! The difference between these two intervals is 27/16 divided by 5/3,
which is 27/16 x 3/5 = 81/80, which is called the ‘syntonic comma’.
That said, just intonation brought about more freedom in music, most notably
increasing the use of thirds and sixths, and allowing combinations of 3 or more notes
to be played together.
276
8.5 Equal temperament
All of these problems with tuning come down to the fact that it is not possible to
have a tuning system based on rational numbers (fractions) such as the ratio 3/2 for
a fifth. This is due to the fact that 3𝑛 ≠ 2𝑚 for any whole numbers n and m.
In the 16th century, a Flemish Mathematician called Simon Stevin suggested making
the interval between a semitone 21/12 . This means the twelfth root of 2; if we raise
this number to the power 12, we will get 2. This system of tuning is known as equal
temperament. It was not well regarded for some time but gained favour in the 19th
century as it allows freedom of transposition across many octaves, and is now used
for tuning all keyboard instruments.
What is the second root more commonly known as? What is the second root of
49? How about the third root of 125?
The second root is known as the square root. So the second root of 49 is 491/2 =
3
√49 = 7. The third root is the cube root, so 1251/3 = √125 = 5.
What do you think might be the advantages and disadvantages of equal
temperament?
The main advantage of equal temperament is its simplicity. We can transpose notes
in any way we like without the problems encountered by Pythagorean tuning or just
intonation. If we want to transpose a note by a fifth (7 semitones), we just multiply
the frequency by 27/12.
You are probably thinking, “What about the harmonious ratios? Surely we can’t have
harmonious low-integer ratios now?” and you are right. 21/12 is not a nice ratio; in
fact, it can not be written using a ratio at all – it is an irrational number. To the first
few decimal places, 21/12 is about 1.059463… so why might this system be used?
The answer lies in the fact that it is a good approximation to low-integer ratios, most
notably the fifth.
What is the difference between the ratio 3/2 and 27/12 ?
Explore the difference between other intervals in equal temperament (2𝑛/12 ) and
low-integer ratios. Which ones are close?
It turns out that 27/12 is about 1.498…, which is really close to 3/2, and this is one of
the main reasons why equal temperament ‘works’. In fact, our ears can’t
differentiate between the two notes – the difference has to be around 0.1 for our
ears to notice the difference.
277
Looking at the other notes in the standard scale under equal temperament, they are
all reasonably close to harmonious ratios:
2nd D
3rd E
4th F
5th G
6th A
7th B
22/12 ≈ 1.12 ≈ 9/8
24/12 ≈ 1.26 ≈ 5/4
25/12 ≈ 1.33 ≈ 4/3
27/12 ≈ 1.50 ≈ 3/2
29/12 ≈ 1.68 ≈ 5/3
211/12 ≈ 1.89 ≈ ⋯
In addition, we have the minor third (3 semitones), which has the ratio 23/12 ≈
1.22 ≈ 6/5, the augmented 4th (diminished 5th) with approximate ratio 7/5, the
minor 6th, which is around 8/5 and the minor 7th which is approximately 9/5.
If you can get your hands on a guitar, compare the distances between each of the
frets from the bridge with the reciprocal of these ratios. Do they match?
Remember that the frequency of notes is inversely proportional to the length of the
string played, hence using the reciprocals.
So you can see that equal temperament with 12 semitones seems like a reasonably
good idea; it is reasonably simple and allows transposition, at the expense of some
consonance.
Why are there 12 semitones? Why not some other division of the octave?
Investigate other divisions of the octave: can you find one that is closer to the
6 5 4 7 3 8 5 7 9
harmonious ratios: , , , , , , , , ?
5 4 3 5 2 5 3 4 5
The division of the octave into 12 semitones is probably due to a mixture of historical
reasons and practical simplicity. Other divisions of the octave into 19 ths, 27ths or 31sts
that would match these key ratios more accurately.
Find the ratios for 19ths; how many of the 9 harmonious ratios are met by this
division of the octave?
Although the division into 19ths provides a better match to the harmonious ratios,
that this scale has not been adopted, presumably because it would be too
complicated. It turns out that a division into 53rds gives an almost exact
approximation to the perfect fifth, a fact known by Ancient Chinese musicians
around the time of the Ancient Greeks.
How many ‘semitones’ (n) do we need so that 2𝑛/53 ≈ 3/2?
278
You can solve this by trial and error to give the value n = 31. However, we could use
the ‘inverse’ of powers, which are called logarithms (logs for short), invented by
Scottish Mathematician John Napier in the 16th century.
The inverse of powers of 2 is called log2, by which I mean if we apply log2 to 2𝑛/53 we
just get the power, 𝑛/53. So applying logs to both sides of this equation we get
𝑛/53 ≈ 𝑙𝑜𝑔2 3/2, and multiplying by 53 gives 𝑛 ≈ 53 × 𝑙𝑜𝑔2 3/2 = 31.003, which is
very close to 31.
Logarithms are useful in talking about frequencies as they allow us to add instead of
multiply thanks to the log rule log 𝑎 × 𝑏 = log 𝑎 + log 𝑏. They also allow us to
create a one-to-one correspondence between numbers and intervals.
Suppose we have a tonic; let’s associate this with the number 1. Then we have
already seen that we can think of the octave as being 2 (twice the frequency) and
that a perfect fifth matches the value 3/2.
Using 𝑙𝑜𝑔2 we can directly match the value to the number of semitones above the
tonic using 12 × 𝑙𝑜𝑔2 (3/2) = 7.02, showing that the ratio 3/2 is just over 7
semitones (a fifth) in our 12-semitone equal temperament scale.
Work out 12 × 𝑙𝑜𝑔2 (𝑎/𝑏) for other low-integer ratios and check they match the
number of notes given above.
For example, 12 × 𝑙𝑜𝑔2 (4/3) = 4.98 which tells us this ratio is close to 5 semitones,
or a fourth, in our scale.
How about intervals larger than an octave? What intervals match the integers 3,
4, and so on?
You may have noticed that the integer 4 represents 2 octaves above the tonic. You
can think of this as doubling twice, or alternatively 12 × 𝑙𝑜𝑔2 (4) = 24 semitones.
Perhaps you also realized that 8 represents 3 octaves, 16 = 4 octaves and so on.
What happens with integers that are not powers of 2? Let’s start with 3; we can use
3
the log rule log 𝑎 × 𝑏 = log 𝑎 + log 𝑏 by noting that log 2 3 = log 2 2 × 2 =
3
log 2 2 + log 2 2 and we can see that this is one octave and a fifth.
Taking this further we can use prime factorization to find some intervals matching
other integers, such as log 2 6 = log 2 2 × 3 = log 2 2 + log 2 3 which we know is
octave + octave + fifth.
Some intervals are not particularly near to a whole number of semi-tones. Consider
12 × log 2 5 = 27.86. This is discernibly flat; for this particular reason, equal
temperament was disregarded for many years!
279
8.6 Chords
Chords are when more than one note is played at the same time. Some
combinations of notes give harmonious chords and others don’t; we have seen that
this is due to the relative frequencies of the notes.
The most common chord is the major chord, which is given by the intervals (4,3,5).
What this means is that the interval between the root and the 2 nd note of the chord
is 4 semitones, the interval from the 2nd to 3rd note in the chord is 3 semitones. For
completeness, we give the interval from the 3rd back to the
root note as 5 semitones.
So the C major chord (written as C) is given by C-E-G, and is
written on the musical staff as shown.
The major chord comprises of the major third and the fifth.
There are many other types of chords, each with different intervals invoking
different moods; here are a few of them:








Minor chord (3,4,5), usually written with a small m like this: Cm
Diminished chord (3,3,6), written Cdim or C0.
Augmented chord (4,4,4), written Caug or C+.
Seventh chord (4,3,3,2), written C7.
Minor 7th (3,4,3,2), written Cm7.
Major 7th (4,3,4,1), written CM7.
Diminished 7th (3,3,3,3), written Cdim7.
Augmented 7th (3,3,4,2), written Caug7.
If you can get your hands on a keyboard, translate these into the correct notes
and try playing them. How does each chord make you feel? Can you explain this
with regards to their frequencies?
For example, minor chords have a slightly dissonant, sad quality. My favourite chord
is the minor 7th (3,4,3,2) which comprises of the minor third, perfect fifth and minor
seventh with approximate ratios 1 ∶ 6/5 ∶ 3/2 ∶ 9/5 = 10: 12: 15: 18. Perhaps this
is something to do with low ratios between pairs of
notes?
The structure and feel of a song is determined by the
combination of chords used, called a chord
progression. Just as different notes sound harmonious
when played together, the same can be said for
chords; the circle of fifths gives harmonious chord
progressions. For example, a simple chord progression
that is often used in popular music is A-D-G-A.
280
8.7 Duration of notes
So far we have looked at the melodic aspect of music, but what about the rhythmic
aspect? The timing of the notes in a melody is as equally important as the pitch of
the notes.
The duration of notes are based on powers of 2. Here are some notes and their
durations:
Going from left to right, each note is half the duration of the one before. Adding
more flags to the stem of the note will make shorter
notes. Sometimes beams are used to join notes with
flags together like this:
There is an equivalent set of rests:
We can make notes of different durations to these
powers of two by using a dot, like this:
The dot increases the duration of the note by half its
original value. So the half note with a dot shown here now has duration of 1/2 + 1/4
= 3/8.
What does adding a dot to the eighth note produce? What do you think happens
if you add two dots to a note? Can we produce notes of all durations in this way?
Adding a dot to an eighth note produces 1/8 + 1/16 = 3/16. Two dots adds a half and
a quarter of a note, so adding another dot to an eighth note would produce a note of
duration 1/8 + 1/16 + 1/32 = 7/32.
There are many note lengths that we can’t make using powers of 2. For example,
how do we make a note of length 1/3? To do this we need tuplets; there are
numerous ways of writing these:
281
The 3-tuplet (or triplet) on the left comprises of three quarter notes. Usually three
quarter notes would have a total duration 3/4 but generally in a triplet they have
duration 1/2, so that each note is 1/3 of 1/2, which is 1/3 x ½ = 1/6.
What do you think is the duration of each note in the central triplet? How about
the quintuplet on the right?
Each note in the central triplet has duration 1/3 of 1/4, which is 1/12. The quintuplet
has total duration 4 x 1/16 = 1/4, so each note has duration 1/5 of 1/4 = 1/20.
282
8.8 Time signatures
A time signature of a piece of music
determines its rhythm.
Time signatures are written with two numbers. In simple time signatures, the top
number represents the number of beats in each bar and the bottom number
represents the note that is worth one beat (called the beat unit).
3
So in the time signature we have 3 beats to each bar, and one quarter note is
4
worth one beat; we can think of this as a measure having three quarter beats.
9
There are more complex time signatures called compound signatures, such as . You
8
can tell these from the fact that the top number is a multiple of 3; in compound time
signatures the number of beat notes is the top number divided by 3.
What is the duration of the beat note in
9
time?
8
9
there are 9 eighth notes in each bar (in groups of 3) with three beat notes of
8
value 3/8; they will be dotted quarter notes.
In
Here is a fun investigation that requires clapping different rhythms; you need at least
two people to do it:
While one person repeatedly claps the rhythm shown on
the right, the second person explores other rhythms, such
as 1 2 . 4 . 6 . 8
Why not investigate other clapping rhythms with different time signatures?
Try writing them using the correct musical notation.
283
Glossary
Arithmetic sequences
Any sequence that goes up by the same amount each time is called an arithmetic
sequence. So 2, 4, 6, 8, … is one, and so is 1, 4, 7, 10, …
The nth term for any arithmetic sequence is an + b where a and b are numbers we
have to find. So for example, the nth term of 1, 4, 7, 10 is 3n – 2. This is because it is 2
less than the 3x table.
To find the sum of an arithmetic series, just add the first and last term and divide by 2
to get an ‘average’ or ‘middle’ term, then multiply by how many terms there are.
So for example, to sum 1 + 4 + 7 + 10 + 13 easily we can do 1 + 13 = 14, divide by 2 is
7, then multiply by 5 (number of terms) is 35.
We can use this to find the sum for the first n terms of a series, for example: 1 + 4 + …
+ (3n-2). First term plus last term is 1 + (3n-2) = 3n-1, then divide by 2 and multiply by
the number of terms (n) to give ½.n.(3n-1).
Base-n number system
Our number system is based around the number 10. It is called base-10 because the
value of each place in our number system is a power of 10. Units can also be written
100, tens can be written 101, hundreds can be written 102 and so on, each one 10
times bigger than the last. Moving from right to left for any number, each digit has 10
times the value of the previous one.
This compares with other number systems, which have different bases, such as the
Babylonian system (base-60) and binary.
Binary
Binary is a base-2 number system. Each column in binary is two times larger than the
one to the right, like this:
So for example the number 1011 in binary is 8 + 2 + 1 = 11 in base-10. Sometimes
people write binary numbers like this 10112 so it is clear we are working in binary.
You can think of this as writing numbers as sums of powers of two, so for example
1011 can be written as 8 + 2 + 1 = 23 + 21 + 20. All numbers can be written in this way.
284
Complete graphs
A complete graph is one in which all vertices are joined with
one edge to every other vertex. They are called Kn where n
represents the number of vertices; here is K7 that we
encountered in domino loops:
Continued fractions
Fractions can be written as continued fractions, like this:
67
24
= 2 +
1
1+
1
1
3+ 1
1+
4
We can show these are the same as follows. Starting at the bottom corner, we have
1
1
5
1 + 4 = 4. Substituting this into the fraction above we then have 2 +
1 .
1+ 1
3+ 5
Now,
1
5
4
is the reciprocal of 5/4 which is 4/5. So we have 2
+
4
1
1+
1
.
4
3+
5
4
19
Now, again in the bottom corner, we have 3 + =
so we can rewrite the
5
5
1
continued fraction as 2 +
1 and flipping the last fraction again we have 2
1+ 19
+
5
1
5
.
1+19
One more time: 1
+
5
19
=
24
19
so we have 2
+
1
24
19
=2 +
19
24
=
67
24
To find the continued fraction for a given fraction, follow Euclid’s algorithm. Using the
example in the text, here is the algorithm for 67 and 24:
67 = 2 x 24 + 19
24 = 1 x 19 + 5
19 = 3 x 5 + 4
5=1x4+1
4=4x1+0
Now if we divide through by the middle number on each line we get:
285
67/24 = 2 + 19/24
24/19 = 1 + 5/19
19/5 = 3 + 4/5
5/4 = 1 + 1/4
This forms the continued fraction.
Difference of two squares
The difference of two squares is exactly what it says it is: it is the difference between
two square numbers. For example, 5 is the difference of the two square number 4
and 9, and can be calculated 32 – 22 = 9 – 4 = 5.
Algebraically, the difference of two squares is M2 – N2, which can be factorized as
(M+N)(M-N). To see why, let’s multiply these two brackets together using the grid
method:
You can see that the two terms +MN and –MN cancel out,
leaving M2 – N2.
Diophantine equations
For Diophatine equations we are only interested in integer solutions. The most
famous Diophantine equation is Fermat’s Last Theorem, which states that there are
no integer solutions to the Diophantine equation xn + yn = zn for n > 2. If n = 2, then we
have Pythagoras’ equation; there are infinite solutions to this.
Factorials
These numbers are made by calculating 1, 1 x 2, 1 x 2 x 3, 1 x 2 x 3 x 4, and so on, and
are usually written as 1!, 2!, 3!, 4!, …
A different way of thinking about factorials is that they represent the number of
ways of arranging n objects. So for example 3! Is the number of ways of arranging 3
letters:
abc, acb, bac, bca, cab, cba
Fibonacci numbers
286
Each number in the sequence is the sum of the previous two, so starting with (0 th
term = 0) 1st term = 1 and 2nd term = 1, we get the famous sequence:
1, 1, 2, 3, 5, 8, 13, 21, …
This is sometimes written using a recurrence relation un+1 = un + un-1 which basically
says the next term is the sum of the previous two.
Fractions – calculation methods
Equivalent fractions: When first getting
used to equivalent fractions, you might
find it easier to use a fraction wall to
work these out like this.
However, you soon realize that
multiplying or dividing the top and
bottom of a fraction by the same
number maintains the value of the
fraction.
Dividing a fraction is called simplifying. If
we keep dividing until we can’t go any
further (without making decimals) then
we say the fraction is in its simplest
form. So 6/8 is not in its simplest form, but dividing top and bottom by 2 gives 3/4,
which is in its simplest form.
Adding/subtracting fractions: Once you have mastered equivalent fractions, you will
be able to add and subtract them. Notice that it is easy to add/subtract fractions
when the bottom numbers are the same, such as 2/4 + 1/4 = 3/4 and 2/4 – 1/4 = 1/4.
So in order to add/subtract a pair of fractions, we just need to make the bottom
numbers the same, which we can do using equivalent fractions. So in order to work
out 1/6 + 3/4 we can just change it to 2/12 + 9/12, which is equal to 11/12.
Multiplying fractions: This is easier than adding/subtracting; all you have to do is
multiply the tops together to get the top number and the bottoms together to get the
bottom. For example, 2/3 x 3/4 = 6/12 (which simplifies to 1/2).
Dividing fractions: What does a divide b mean? It means ‘how many b’s are in a?’. So
for example, 3 divided by ½ means ‘how many halves are in 3’, to which the answer is
6. How could we have calculated this? Noting that dividing by ½ is equivalent to
multiplying by 2, we seek a connection between dividing and multiplying.
Continuing this further, we note that dividing by 1/3 is the same as multiplying by 3
and so on, so to divide by 1/n, we multiply by n. Taking this one step further, we
recognize this as the reciprocal, suggesting that dividing by a/b is the same as
287
multiplying by b/a, which is indeed the case. So m/n divided by a/b is equivalent to
m/n multiplied by b/a. For example, 4/3 divided by 81/64 = 4/3 x 64/81 = 256/243.
Fractions, decimals and percentages
Remember that percent (%) means out of a hundred… So 20% means 20 out of a
hundred, or 20/100.
We can draw this like this:
From the picture you might also be to see that we
could write 20/100 as 2/10 (or even 1/5).
So we can write any percentage as a fraction really
easily.
We can change percentages and fractions to decimals using place value: 1% or 1/100
is a 1 in the hundredths column:
We usually write this as 0.01. Now we can keep going until we get to 9% = 9/100 =
0.09:
But when we get to 10% = 10/100, we can’t put all 10 in the hundredths column so
we carry the one up into the next columns (tenths), so it looks like this:
288
So we can write 10% = 10/100 = 0.10. After a while you notice that the two decimal
numbers (in the tenths and hundredths columns) are just the percentage! So for
example, 71% = 0.71.
Functions
Functions have an input and an output. You put numbers into a function, and other
numbers come out. For example, if we put x = 3 into the function x 2 we get the output
9. We write this as function as f(x) = x2, and if we put 3 into it, we write f(3) = 32 = 9.
Functions can be thought of as another way of writing the nth term for a sequence.
For example, the sequence 1, 4, 7, 10, has nth term 3n – 2, but we could equally
describe it as the outputs of the function f(n) = 3n – 2 after inputting numbers n=1,
n=2, etc…
Putting n=5 in the function gives the 5th number in the sequence 3x5 – 2 = 13, so
performing the same job as the nth term.
GCD
The greatest common divisor GCD, sometimes called the highest common factor
(HCF) of two numbers is the largest number that divides into both of them. So for
example, the GCD of 24 and 30 is 6.
Integer
Integers and the positive and negative whole numbers, including zero. The integer
part of a decimal is the whole number part.
Logarithm (log)
Logs are functions that act as the inverse to powers. Consider the statement 32 = 9.
We can write this using logs as 𝑙𝑜𝑔3 9 = 2. The subscript of the log is the base, and
matches the base in the first statement. The log gives you the power you have to
raise the base by, in order to get the value 9. So if we wanted to know the power that
satisfies the equation 32 = 10, we would calculate 𝑙𝑜𝑔3 10.
Logs were invented by Napier to help with large calculations as they make
multiplications into additions due to the log rule: log 𝑎 × 𝑏 = log 𝑎 + log 𝑏. In the
days before calculators they would have large books of log calculations called log
tables.
To see how this could help with large multiplication sums, consider the calculation
256 x 128. You could write 𝑙𝑜𝑔2 256 × 128 = 𝑙𝑜𝑔2 256 + 𝑙𝑜𝑔2 128 which they could
read from a log table as 8 + 7 = 15. Then they could look in the tables again to find
which log matches the answer 15, which is 215 = 32768.
Lowest common multiple
289
The lowest common multiple (LCM) of two numbers is the lowest multiple shared by
both numbers. For example, the LCM of 6 and 8 is 24. If the two numbers are
relatively prime, the LCM is the product of the two numbers.
Mathematical induction
Mathematical induction is used to prove statements are true. I will show it using the
example of Fermat numbers, to prove the ‘statement’ F0 x F1 x … x Fn-1 x Fn + 2 = Fn+1.
Remembering that the nth Fermat number is Fn = 2m+1 for some number m from the
doubling sequence 1, 2, 4, 8, 16, … so the first few Fermat numbers are 3, 5, 17, 257,
…
Step 1: Prove it is true for the first case. Here, we want F0 + 2 = F1 which is true as 3 +
2 = 5.
Step 2: Assume the statement to be true for the nth number. So we assume F0 x F1 x
… x Fn-1 + 2 = Fn.
Step 3: Now, using our assumption, prove it to be true for the (n+1) th number. So we
are trying to use Fn = F0 x F1 x … x Fn-1 + 2 to show F0 x F1 x … x Fn-1 x Fn + 2 = Fn+1.
Well, we have
F0 x F1 x … x Fn-1 x Fn + 2
= ( Fn – 2 ) x F n + 2
= (2m + 1 – 2) x (2m + 1) + 2
= (2m - 1) x (2m + 1) + 2
= 22m + 1
= Fn+1.
(using our assumption)
(for some number m from the doubles)
(multiplying out the brackets)
(2m is the next number in the doubles)
So because the statement is true for the first case (step 1), and is true for every
subsequent case (steps 2 and 3) then it is always true.
Mersenne numbers
Mersenne numbers, named after the French monk Marin Mersenne, are numbers of
the form 2n – 1, so we have 1, 3, 7, 15, 31, 63, …
There are lots of prime Mersenne numbers (3, 7, 31, …) which occur at prime terms
(i.e. n = prime) in the sequence (2nd, 3rd, 5th, …) and it can be shown that any
Mersenne primes have prime n; this is used to find large primes such as the current
largest prime 257,885,161 − 1.
Note that the Mersenne numbers are 1, 11, 111, … in binary.
Modular arithmetic (clock arithmetic)
290
Modular arithmetic is the study of remainders of numbers. They often reveal patterns
in numbers we might not originally recognize.
We use modular arithmetic every day, when telling the time. As the hours get to 11,
then 12, we do not then go to 13 o’clock, we instead reset to 1 o’clock. Hours of the
day work in modulo 12, or mod 12 for short. This is the same as saying the number 13
has remainder 1 on division by 12.
We say a number is congruent to x (mod n) if that number has remainder x when
divided by n. So the number 13 is congruent to 1 (mod 12). This is sometimes written
as: 13 ≡ 1(𝑚𝑜𝑑 12).
nth term
Functions and sequences are closely related. Consider the sequence 2, 4, 6, 8, … this
is also known as the even numbers, or the two times table. Each number in the
sequence is called a term.
We could give a rule for working out numbers in this sequence: it is 2 x something. So
the first term is 2 x 1, the second term is 2 x 2, the 5th term is 2 x 5 = 10.
Using any letter (say n) instead of the word something we could write this as 2 x n, or
even more simply as 2n (ignoring the x sign). This is sometimes called the nth term of
a sequence.
If we choose numbers for n we get that term in the sequence. For example, if we
wanted the 5th term of the sequence, choose n to be 5 and then we have 2 x 5 = 10.
Nim
In standard two-player Nim, there are three piles of counters. Players take it in turns
to take any counters from one of the piles. The winner is the one who takes the last
counter.
The best way to discover how to win at Nim is to play it. As you play, you realize
there are positions you want to get to on your turn, so that you leave your opponent
in a losing situation; these are called safe positions.
In normal Nim we can get to safe positions by looking at the binary digits of each pile
and getting an even number of each binary digit. For example, with 1, 5 and 10
counters (say) we have binary digits:
1=
5=
10 =
8
0
0
1
4
0
1
0
2
0
0
1
1
1
1
0
291
Now there are an odd number of binary digits in the columns 2, 4 and 8. So as player
1 we can move to a safe position by taking 6 counters from the pile with 10 in, to
give:
1=
5=
4=
8
0
0
0
4
0
1
1
2
0
0
0
1
1
1
0
Now there is an even number of binary digits in each column and we will win from
here if we play perfectly by continuing to adopt this strategy. Of course, if you’re
opponent has found a safe position first then there is not much you can do about it!
Pascal’s triangle
Although Pascal didn’t invent the triangle (it was known to
the Ancient Chinese), he wrote a book about it and it was
given his name.
The numbers in each row are made by adding the two
numbers in the row above.
There are many other patterns in there, such as the
triangle numbers (1, 3, 6, 10, …) and tetrahedral numbers
(1, 4, 10, 20, …) and the Fibonacci sequence can be found by summing along skew
diagonals.
Pascal’s triangle occurs in lots of problems as it represents the numbers of ways of
choosing things. For example, in the section on triangle numbers, I stated that the
number of ways of choosing 3 (dots) from 6 is 20; you can test this by drawing or
listing them all.
6
These numbers are often called combinations, and are usually written like this: ( ) =
3
20, spoken as ‘6 choose 3’.
Place value
We use a place value number system; it is one of the first things you learn at school.
Place value means that the place of each digit in a number represents its value.
Using a blob to represent 1, here is the number 736 in our number system:
Hundreds
Tens


Units

292
This is a more efficient way of writing 736 than writing seven hundred and thirty-six
blobs. Every column has a different value. The 6 in the units column represents 6
single objects. Moving to the left, the 3 represents three tens, or thirty blobs, and
then the 7 represents seven hundred blobs. So this represents 700 + 30 + 6 = 736.
Note that each column can contain up to 9 blobs. When we get to 10 blobs in a
column, this becomes one blob in the next column to the left. Of course, we don’t use
blobs, we use 10 numerals 0 to 9 to represent 0 to 9 blobs in any column.
This compares with the Egyptian number system, which does not use place value.
Powers
Powers, or indices, or exponents in the US, are a short way of writing numbers. For
example, 53 is just a short way of writing 5 multiplied by itself 3 times, so 53 = 5 x 5 x 5
= 125. 51 = 5 and 50 = 1, which makes sense as each power is 5 times bigger than the
one before it.
Powers can also be negative (2-1 is the same as 1/2 ) and fractional (21/2 is the same as
√2).
Prime factorization
Every whole number can be written as a unique product of prime factors. We can use
factor trees to find the prime factors. So for example, 60 can be written as the
product of its prime factors as 2 x 2 x 3 x 5.
Pythagoras’ theorem
Pythagoras Theorem says that if we find the area of the squares on the two shortest
sides of a right-angled triangle (only) and add them together, it will be equal to the
area of the square on the longest side of the triangle.
Reciprocal
The reciprocal of a fraction is just the upside down version of it: 2/3 and 3/2 are
reciprocals.
If we multiply two reciprocals together we always get 1, for example 2/3 x 3/2 = 6 / 6
= 1.
The reciprocal of a whole number n is 1/𝑛. To see why, consider the whole number
as a fraction 𝑛/1, then multiply them together: 𝑛/1 × 1/𝑛 = 𝑛/𝑛 = 1.
Relatively prime
Two numbers that are relatively prime do not share any common prime factors. So 6
and 8 are not relatively prime (they have 2 in common) but 5 and 8 are.
293
Triangle numbers
The triangle numbers 1, 3, 6, 10, … are the ones we get by putting dots in triangles
like this:
You can think of each term as the (partial) sum of the whole numbers:
1, 1 + 2, 1 + 2 + 3, …
The nth term of the triangle numbers (which is also the sum of the first n whole
numbers) is:
𝑛(𝑛+1)
2
You can work out this formula as shown in the text, or by this little trick. Write out
the sum of the first n numbers twice, one above the other like this:
1 + 2 + 3 + … + (n-1) + n
n + (n-1) + … + 3 + 2 + 1
Adding each pair gives n lots of 1 + n, or n x (n+1). Then because this gives us twice
what we need (we have just added two sets of the numbers), we just divide by two
to get the formula.
This is a special case of the sum of an arithmetic series with first term 1 and last term
n, so we could also work out the formula that way.
294
Bibliography
Problem/puzzle books
The Inquisitive Problem Solver (Vaderlind, Guy, Larson)
Mathematics Galore (James Tanton)
Solve This: Math Activities for Students and Clubs (James Tanton)
Math Without Words (James Tanton)
What to Solve (Judita Cofman)
Linking Cubes and the Learning of Mathematics (Paul Andrews)
Lessons in Play (Michael Albert, Richard Nowakowski, David Wolfe)
Algorithmic Puzzles (Anay Levitin, Maria Levitin)
History of maths books
Euler: The Master of Us All (William Dunham)
The History of Mathematics (Jeff Suzuki)
Other interesting books and articles related to investigations in this book
Concrete Mathematics (Graham, Knuth, Patashnik)
The Book of Numbers (Conway, Guy)
The Strong Law of Small Numbers (Guy, article)
Proofs from The Book (Martin Aigner, Gunter Zeigler)
Proofs that Really Count: The Art of Combinatorial Proof (Arthur Benjamin, Jennifer
Quinn)
On Numbers and Games (John Conway)
A Friendly Introduction to Number Theory (Joseph Silverman)
Proofs Without Words (Roger Nelsen)
295
Winning Ways For Your Mathematical Plays (Elwyn Berlekamp, John Conway, Richard
Guy)
Mathematics: The Man-Made Universe (Sherman Stein)
Ingenuity in Mathematics (Ross Honsberger)
Fair Game (Richard Guy)
The Enjoyment of Math (Hans Rademacher, Otto Toeplitz)
Your Move (David Silverman)
296
Download