Mathematical Puzzles 2e
Mathematical Puzzles 2e
“Anyone, from novice to expert, with an interest in math or puzzles should have
this book. The puzzles are artfully chosen and lucidly explained in a way that
will boost the math IQ of readers at any level.
“As a reader with a lifelong interest in recreational math I was delighted with
these superb puzzles with many surprises, elegant solutions and detailed infor-
mation on their origins.”
—Dick Hess, author of Golf on the Moon and other puzzle books
“On average, who has more sisters, men or women? When a coin is rolled once
around another one of equal size, with no slipping, how many times does it
rotate? How can you get a 50-50 decision by flipping a bent coin? If you enjoy
challenges like these, you will be enthralled by this latest collection of delight-
ful dazzlers from Peter Winkler. From old classics to new gems, wrestling with
these brain ticklers will provide many weeks of fun and ‘Aha!’ moments.
“Warning: these are addictive, and you’ll need to use a magic combination of
skill, intuition and insight to solve them all!”
—Colm Mulcahy, Professor of Mathematics at Spelman College and author
of Mathematical Card Magic: Fifty-Two New Effects
“This is the third and by far the most substantial of Peter Winkler’s books on
mathematical puzzles, drawing from everyday life and from a wide spectrum
of mathematical topics. Mathematics’ answer to Ripley’s Believe It or Not, Peter
brings out the romantic side of mathematics rather than its utilitarian side.”
—Andy Liu, Leader of the Canadian team to the International
Mathematical Olympiad in 2000 and 2003
“This book may well be the best collection of mind-stretching teasers ever
assembled. You can’t help but be inspired, when Peter winks at you.”
—Donald E. Knuth, Emeritus Professor at Stanford University
and winner of the Turing Award
Mathematical Puzzles
Mathematical Puzzles
Revised Edition
Peter Winkler
Reasonable efforts have been made to publish reliable data and information, but the author and
publisher cannot assume responsibility for the validity of all materials or the consequences of
their use. The authors and publishers have attempted to trace the copyright holders of all material
reproduced in this publication and apologize to copyright holders if permission to publish in this
form has not been obtained. If any copyright material has not been acknowledged please write and
let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or
hereafter invented, including photocopying, microfilming, and recording, or in any information
storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.
copyright.com or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive,
Danvers, MA 01923, 978-750-8400. For works that are not available on CCC please contact
mpkbookspermissions@tandf.co.uk
Trademark notice: Product or corporate names may be trademarks or registered trademarks, and are
used only for identification and explanation without intent to infringe.
DOI: 10.1201/9781032709659
Publisher's note: This book has been prepared from camera-ready copy provided by the authors.
for Miles, Sage, and Beatrix
Contents
Acknowledgments ix
Preface xi
The Puzzles xv
2. Achieving Parity 17
3. Intermediate Math 29
4. Graphography 41
5. Algebra Too 55
6. Safety in Numbers 67
vii
Contents
Bibliography 393
Author 399
Index 401
viii
Acknowledgments
This volume owes its existence to two institutions and many individ-
uals. Dartmouth College has provided inspiring colleagues, a stim-
ulating environment, and steadfast encouragement; special thanks
are due to the endowers of the William Morrill Professorship. The
National Museum of Mathematics (with whom I spent the academic
year 2019–2020), through the generosity of the Simons Foundation,
provided a huge variety of outreach opportunities, with many audi-
ences on whom to test puzzles.
Some of the individual contributors (witting and otherwise) are
listed alphabetically below, with multiple contributors in italics and
the two most prolific in bold. Specific contributions appear in Notes &
Sources. Doubtless many deserving names have been left out owing to
gaps in my knowledge or memory, but I hope to rectify some of those
omissions as time goes on.
ix
Acknowledgments
x
Preface
What's in This Book?
This book contains 300 of the very best mathematical puzzles in the
world. Some have appeared in previous books, including my own, or
in contests; others are brand new. The book is organized as follows:
First, all the puzzles are presented; then, for each puzzle, a hint to-
gether with the chapter number in which you can find the solution.
(The Hints section lists puzzles in alphabetical order by name, so may
be of use in locating a particular puzzle.)
The chapters themselves are classified by solution method, rather
than by general puzzle topic. Each chapter introduces a technique,
uses it to solve puzzles, and ends with an actual theorem of mathe-
matics that uses the technique in its proof. Additional information on
every puzzle is found in Notes and Sources at the end of the volume.
xi
Mathematical Puzzles
xii
Author's Preface
So what are puzzles good for, if the ability to solve them does not
tell us who should become a mathematician?
The key is that a good puzzle is a gem, a thing of beauty. I would
argue that the ability to appreciate a good puzzle, and the willingness to
put effort into solving it, tells us a great deal. (Smart employers know
this and if you are given a puzzle in a job interview, they are inter-
ested in your attitude and approach, not whether you get the “right”
answer.) Do you want to know what math can do? Or, equally impor-
tant, what math can’t do? Do you feel that you are desperate to know
the answer? Then, maybe, math is for you.
And if math is for you, then learning the techniques needed to
solve puzzles is a great way to dive in. As you will see in this volume,
those same techniques show up in proofs of theorems; and as (I hope)
you will also see, solving puzzles is eye-opening and a lot of fun.
xiii
The Puzzles
Bat and Ball
A bat costs $1 more than a ball; together they cost $1.10. How much
does the bat cost?
No Twins Today
It was the first day of class and Mrs. O’Connor had two identical-
looking pupils, Donald and Ronald Featheringstonehaugh (pro-
nounced “Fanshaw”), sitting together in the first row.
“You two are twins, I take it?” she asked.
“No,” they replied in unison.
But a check of their records showed that they had the same parents
and were born on the same day. How could this be?
Portrait
A visitor points to a portrait on the wall and asks who it is. “Brothers
and sisters have I none,” says the host, “but that man’s father is my
father’s son.” Who is pictured?
Half Grown
At what age is the average child half the height that he or she will be
as an adult?
xv
Mathematical Puzzles
Phone Call
A phone call in the continental United States is made from a west
coast state to an east coast state, and it’s the same time of day at both
ends of the call. How is this possible?
Powers of Two
How many people are “two pairs of twins twice”?
Rotating Coin
While you hold a US 25-cent piece firmly to the tabletop with your
left thumb, you rotate a second quarter with your right forefinger all
the way around the first quarter. Since quarters are ridged, they will
interlock like gears and the second will rotate as it moves around the
first.
xvi
The Puzzles
Natives in a Circle
An anthropologist is surrounded by a circle of natives, each of whom
either always tells the truth or always lies. She asks each native
whether the native to his right is a truth teller or a liar, and from their
answers, she is able to deduce the fraction of liars in the circle.
What fraction is it?
Winning at Wimbledon
As a result of temporary magical powers (which might need to be
able to change your gender), you have made it to the women’s singles
tennis finals at Wimbledon and are playing Serena Williams for all the
marbles. However, your powers cannot last the whole match. What
score do you want it to be when they disappear, to maximize your
chances of notching an upset win?
Polyhedron Faces
Prove that any convex polyhedron has two faces with the same num-
ber of edges.
Signs in an Array
Suppose that you are given an m × n array of real numbers and per-
mitted, at any time, to flip the signs of all the numbers in any row or
column. Can you always arrange matters so that all the row sums and
column sums are non-negative?
xvii
Mathematical Puzzles
Birthday Match
You are on a cruise where you don’t know anyone else. The ship an-
nounces a contest, the upshot of which is that if you can find someone
who has the same birthday as yours, you (both) win a beef Wellington
dinner.
How many people do you have to compare birthdays with in order
to have a better than 50% chance of success?
Sinking 15
Carol and Desmond are playing pool with billiard balls number 1
through 9. They take turns sinking balls into pockets. The first to sink
three numbers that sum to 15 wins. Does Carol (the first to play) have
a winning strategy?
Monk on a Mountain
A monk begins an ascent of Mt. Fuji on Monday morning, reaching
the summit by nightfall. He spends the night at the summit and starts
down the mountain on the same path the following morning, reaching
the bottom by dusk on Tuesday.
Prove that at some precise time of day, the monk was at exactly
the same spot on the path on Tuesday as he was on Monday.
Mathematical Bookworm
The three volumes of Jacobson’s Lectures in Abstract Algebra sit in order
on your shelf. Each has 2′′ of pages and a front and back cover each
1 ′′ 1 ′′
4 , thus a total width of 2 2 .
A tiny bookworm bores its way straight through from page 1, Vol
I to the last page of Vol III. How far does it travel?
xviii
The Puzzles
Rolling Pencil
A pencil whose cross-section is a regular pentagon has the maker’s
logo imprinted on one of its five faces. If the pencil is rolled on the
table, what is the probability that it stops with the logo facing up?
Watermelons
Yesterday a thousand pounds of watermelons lay in the watermelon
patch. They were 99% water, but overnight they lost moisture to evap-
oration and now they are only 98% water. How much do they weigh
now?
xix
Mathematical Puzzles
Chomp
Alice and Bob take turns biting off pieces of an m × n rectangular
chocolate bar marked into unit squares. Each bite consists of selecting
a square and biting off that square plus every remaining square above
and/or to its right. Each player wishes to avoid getting stuck with the
poisonous lower-left square.
Show that, assuming the bar contains more than one square, Alice
(the first to play) has a winning strategy.
Whose Bullet?
Two marksmen, one of whom (“A”) hits a certain small target 75%
of the time and the other (“B”) only 25%, aim simultaneously at that
target. One bullet hits. What’s the probability that it came from A?
xx
The Puzzles
Poker Quickie
What is the best full house?
(You may assume that you have five cards, and you have just one
opponent who has five random other cards. There are no wild cards.
As a result of the Goddess of Chance owing you a favor, you are en-
titled to a full house, and you get to choose whatever full house you
want.)
xxi
Mathematical Puzzles
Bacterial Reproduction
When two pixo-bacteria mate, a new bacterium results; if the parents
are of different sexes the child is female, otherwise it is male. When
food is scarce, matings are random and the parents die when the child
is born.
It follows that if food remains scarce a colony of pixo-bacteria will
eventually reduce to a single bacterium. If the colony originally had
10 males and 15 females, what is the probability that the ultimate
pixo-bacterium will be female?
Sprinklers in a Field
Sprinklers in a large field are located at the vertices of a square grid.
Each point of land is supposed to be watered by exactly the three
closest sprinklers. What shape is covered by each sprinkler?
Bags of Marbles
You have 15 bags. How many marbles do you need so that you can
have a different number of marbles in each bag?
Fair Play
How can you get a 50-50 decision by flipping a bent coin?
xxii
The Puzzles
Two Runners
Two runners start together on a circular track, running at different
constant speeds. If they head in opposite directions they meet after a
minute; if they head in the same direction, they meet after an hour.
What is the ratio of their speeds?
Broken ATM
George owns only $500, all in a bank account. He needs cash badly
but his only option is a broken ATM that can process only with-
drawals of exactly $300, and deposits of exactly $198. How much cash
can George get out of his account?
Domino Task
An 8×8 chessboard is tiled arbitrarily with thirty-two 2×1 dominoes.
A new square is added to the right-hand side of the board, making the
top row length 9.
At any time you may move a domino from its current position
to a new one, provided that after the domino is lifted, there are two
adjacent empty squares to receive it.
Can you retile the augmented board so that all the dominoes are
horizontal?
xxiii
Mathematical Puzzles
Second Ace
What is the probability that a poker hand (5 cards dealt at random
from a 52-card deck) contains at least two aces, given that it has at
least one? What is the probability that it contains two aces, given that
it has the Ace of Spades? If your answers are different, then: What’s
so special about the Ace of Spades?
Fewest Slopes
If you pick n random points in, say, a disk, the pairs of points among
them will with probability 1 determine n(n−1)/2 distinct slopes. Sup-
pose you get to pick the n points deliberately, subject to no three being
collinear. What’s the smallest number of distinct slopes they can de-
termine?
xxiv
The Puzzles
Three-Way Duel
Alice, Bob, and Carol arrange a three-way duel. Alice is a poor shot,
hitting her target only 1/3 of the time on average. Bob is better, hitting
his target 2/3 of the time. Carol is a sure shot.
They take turns shooting, first Alice, then Bob, then Carol, then
back to Alice, and so on until only one is left. What is Alice’s best
course of action?
Splitting a Hexagon
Is there a hexagon that can be cut into four congruent triangles by a
single line?
xxv
Mathematical Puzzles
Attic Lamp
An old-fashioned incandescent lamp in the attic is controlled by one
of three on-off switches downstairs—but which one? Your mission is
to do something with the switches, then determine after one trip to the
attic which switch is connected to the attic lamp.
Efficient Pizza-Cutting
What’s the maximum number of pieces you can get by cutting a
(round) pizza with 10 straight cuts?
Fourth Corner
Pegs occupy three corners of a square. At any time a peg can jump
over another peg, landing an equal distance on the other side. Jumped
pegs are not removed. Can you get a peg onto the fourth corner of the
square?
xxvi
The Puzzles
Spinning Switches
Four identical, unlabeled switches are wired in series to a light bulb.
The switches are simple buttons whose state cannot be directly ob-
served, but can be changed by pushing; they are mounted on the
corners of a rotatable square. At any point, you may push, simul-
taneously, any subset of the buttons, but then an adversary spins the
square. Is there an algorithm that will enable you to turn on the bulb
in at most a fixed number of spins?
Bugging a Disk
Elspeth, a new FBI recruit, has been asked to bug a circular room
using seven ceiling microphones. If the room is 40 feet in diameter
xxvii
Mathematical Puzzles
Points on a Circle
What is the probability that three uniformly random points on a circle
will be contained in some semicircle?
Spaghetti Loops
The 100 ends of 50 strands of cooked spaghetti are paired at random
and tied together. How many pasta loops should you expect to result
from this process, on average?
xxviii
The Puzzles
Swapping Executives
The executives of Women in Action, Inc., are seated at a long ta-
ble facing the stockholders. Unfortunately, according to the meeting
organizer’s chart, every one is in the wrong seat. The organizer can
persuade two executives to switch seats, but only if they are adjacent
and neither one is already in her correct seat.
Can the organizer organize the seat-switching so as to get every-
one in her correct seat?
xxix
Mathematical Puzzles
Circular Shadows I
Suppose all three coordinate-plane projections of a convex solid are
disks. Must the solid be a perfect ball?
Attention Paraskevidekatriaphobes
Is the 13th of the month more likely to be a Friday than any other day
of the week, or does it just seem that way?
Unanimous Hats
One hundred prisoners are offered the chance to be freed if they can
win the following game. In the dark, each will be fitted with a red or
xxx
The Puzzles
black hat according to a fair coinflip. When the lights are turned on,
each will see the others’ hat colors but not his own; no communication
between prisoners will be permitted.
Each prisoner will be asked to write down his guess at his own hat
color, and the prisoners will be freed if they all get it right.
The prisoners have a chance to conspire beforehand. Can you
come up with a strategy for them that will maximize their probability
of winning?
xxxi
Mathematical Puzzles
For example, you can break three times to form four rows of
six squares each, then break each row five times into its constituent
squares, accomplishing the desired task in 3 + 4 × 5 = 23 breaks.
Can you do better?
After a while you figured out that her shuffles were defective—
they didn’t change the top five cards, so the magician had picked them
in advance and knew what they were. But she still had to pick the
ranks of those cards carefully (and memorize their suits), so that from
the sum she could always recover the ranks.
In conclusion, if you want to do the trick yourself, you need to find
five distinct numbers between 1 and 13 (inclusive), with the property
that every subset has a different sum. Can you do it?
xxxii
The Puzzles
Half-right Hats
One hundred prisoners are offered the chance to be freed if they can
win the following game. In the dark, each will be fitted with a red or
black hat according to a fair coinflip. When the lights are turned on,
each will see the others’ hat colors but not his own; no communication
between prisoners will be permitted.
Each prisoner will be asked to write down his guess at his own hat
color, and the prisoners will be freed if at least half get it right.
The prisoners have a chance to conspire beforehand. Can you
come up with a strategy for them that will maximize their probability
of winning?
Finding a Jack
In some poker games the right of first dealer is determined by dealing
cards face-up (from a well-shuffled deck) until some player gets a jack.
On average, how many cards are dealt during this procedure?
xxxiii
Mathematical Puzzles
for example, the ith prisoner in line sees the hat colors of prisoners
1, 2, . . . , i−1 and hears the guesses of prisoners n, n−1, . . . , i+1
(but he isn’t told which of those guesses were correct—the executions
take place later).
The prisoners have a chance to collaborate beforehand on a strat-
egy, with the object of guaranteeing as many survivors as possible.
How many players can be saved in the worst case?
Three Sticks
You have three sticks that can’t make a triangle; that is, one is longer
than the sum of the lengths of the other two. You shorten the long
one by an amount equal to the sum of the lengths of the other two,
so you again have three sticks. If they also fail to make a triangle, you
again shorten the longest stick by an amount equal to the sum of the
lengths of the other two.
You repeat this operation until the sticks do make a triangle, or
the long stick disappears entirely.
Can this process go on forever?
Spiders on a Cube
Three spiders are trying to catch an ant. All are constrained to the
edges of a cube. Each spider can move one third as fast as the ant can.
Can the spiders catch the ant?
xxxiv
The Puzzles
Divisibility Game
Alice chooses a number bigger than 100 and writes it down secretly.
Bob now guesses a number greater than 1, say k; if k divides Alice’s
number, Bob wins. Otherwise k is subtracted from Alice’s number
and Bob tries again, but may not use a number he used before. This
continues until either Bob succeeds by finding a number that divides
Alice’s, in which case Bob wins, or Alice’s number becomes 0 or neg-
ative, in which case Alice wins.
Does Bob have a winning strategy for this game?
Candles on a Cake
It’s Joanna’s 18th birthday and her cake is cylindrical with 18 candles
on its 18′′ circumference. The length of any arc (in inches) between
two candles is greater than the number of candles on the arc, exclud-
ing the candles at the ends.
Prove that Joanna’s cake can be cut into 18 equal wedges with a
candle on each piece.
xxxv
Mathematical Puzzles
guess whether that number is the larger or the smaller of Paula’s two
numbers; if he guesses right, he wins $1, otherwise he loses $1.
Clearly, Victor can at least break even in this game, for example,
by flipping a coin to decide whether to guess “larger” or “smaller”—
or by always guessing “larger,” but choosing the hand at random. The
question is: Not knowing anything about Paula’s psychology, is there
any way he can do better than break even?
King's Salary
Democracy has come to the little kingdom of Zirconia, in which the
king and each of the other 65 citizens has a salary of one zircon. The
king cannot vote, but he has power to suggest changes—in particu-
lar, redistribution of salaries. Each person’s salary must be a whole
number of zircons, and the salaries must sum to 66. Each suggestion
is voted on, and carried if there are more votes for than against. Each
voter can be counted on to vote “yes” if his or her salary is to be in-
creased, “no” if decreased, and otherwise not to bother voting.
The king is both selfish and clever. What is the maximum salary
he can obtain for himself, and how many referenda does he need to
get it?
xxxvi
The Puzzles
Missing Card
Yola and Zela have devised a clever card trick. While Yola is out of the
room, audience members pull out five cards from a bridge deck and
hand them to Zela. She looks them over, pulls one out, and calls Yola
into the room. Yola is handed the four remaining cards and proceeds
to guess correctly the identity of the pulled card.
How do they do it? And once you’ve figured that out, compute
the size of the biggest deck of cards they could use and still perform
the trick reliably.
Ping-Pong Progression
Alice and Bob play table tennis, with Bob’s probability of winning
any given point being 30%. They play until someone reaches a score
of 21. What, approximately, is the expected number of points played?
xxxvii
Mathematical Puzzles
Pancake Stacks
At the table are two hungry students, Andrea and Bruce, and two
stacks of pancakes, of height m and n. Each student, in turn, must eat
from the larger stack a non-zero multiple of the number of pancakes
in the smaller stack. Of course, the bottom pancake of each stack is
soggy, so the player who first finishes a stack is the loser.
For which pairs (m, n) does Andrea (who plays first) have a win-
ning strategy?
How about if the game’s objective is reversed, so that the first
player to finish a stack is the winner?
Trapped in Thickland
The inhabitants of Thickland, a world somewhere between Edwin
Abbott’s Flatland and our three-dimensional universe, are an infi-
nite set of congruent convex polyhedra that live between two parallel
planes. Up until now, they have been free to escape from their slab,
but haven’t wanted to. Now, however, they have been reproducing
rapidly and thinking about colonizing other slabs. Their high priest is
worried that conditions are so crowded, no inhabitant of Thickland
can escape the slab unless others move first.
Is that even possible?
xxxviii
The Puzzles
Magnetic Dollars
One million magnetic “susans” (Susan B. Anthony dollar coins) are
tossed into two urns in the following fashion: The urns begin with
one coin in each, then the remaining 999,998 coins are thrown in
the air one by one. If there are x coins in one urn and y in the
other, magnetic attraction will cause the next coin to land in the first
urn with probability x/(x + y), and in the second with probability
y/(x + y).
How much should you be willing to pay, in advance, for the con-
tents of the urn that ends up with fewer susans?
xxxix
Mathematical Puzzles
device with an analog dial that enables you to enter any desired prob-
ability p. Then you push a button and the device shows “Heads” with
probability p, else “Tails.”
Alas, your device is showing its “low battery” light and warning
you that you may set the probability p only once, and then push the
coinflip button at most 10 times. Can you still do your job?
Handshakes at a Party
Nicholas and Alexandra went to a reception with 10 other couples;
each person there shook hands with everyone he or she didn’t know.
Later, Alexandra asked each of the other 21 partygoers how many
people they shook hands with, and got a different answer every time.
How many people did Nicholas shake hands with?
Area−Perimeter Match
Find all integer-sided rectangles with equal area and perimeter.
Prime Test
Does 49 + 610 + 320 happen to be a prime number?
Lost Boarding-Pass
One hundred people line up to board a full jetliner, but the first has
lost his boarding pass and takes a random seat instead. Each subse-
quent passenger takes his or her assigned seat if available, otherwise
a random unoccupied seat.
What is the probability that the last passenger to board finds his
seat unoccupied?
Lemming on a Chessboard
On each square in an n × n chessboard is an arrow pointing to one of
its eight neighbors (or off the board, if it’s an edge square). However,
arrows in neighboring squares (diagonal neighbors included) may not
differ in direction by more than 45 degrees.
A lemming begins in a center square, following the arrows from
square to square. Is he doomed to fall off the board?
xl
The Puzzles
Packing Slashes
Given a 5 × 5 square grid, on how many of the squares can you draw
diagonals (slashes or backslashes) in such a way that no two of the
diagonals meet?
Peek Advantage
You are about to bet $100 on the color of the top card of a well-shuffled
deck of cards. You get to pick the color; if you’re right you win $100,
otherwise you lose the same.
How much is it worth to you to get a peek at the bottom card of
the deck? How much more for a peek at the bottom two cards?
Line Up by Height
Yankees manager Casey Stengel famously once told his players to
“line up alphabetically by height.” Suppose 26 players, no two ex-
actly the same height, are lined up alphabetically. Prove that there
are at least six who are also in height order—either tallest to shortest,
or shortest to tallest.
Curves on Potatoes
Given two potatoes, can you draw a closed curve on the surface
of each so that the two curves are identical as curves in three-
dimensional space?
Falling Ants
Twenty-four ants are placed randomly on a meter-long rod; each ant
is facing east or west with equal probability. At a signal, they proceed
to march forward (that is, in whatever direction they are facing) at 1
cm/sec; whenever two ants collide, they reverse directions. How long
does it take before you can be certain that all the ants are off the rod?
xli
Mathematical Puzzles
Polygon Midpoints
Let n be an odd integer, and let a sequence of n distinct points be given
in the plane. Find the vertices of a (possibly self-intersecting) n-gon
that has the given points, in the given order, as midpoints of its sides.
Bugs on a Pyramid
Four bugs live on the four vertices of a triangular pyramid (tetrahe-
dron). Each bug decides to go for a little walk on the surface of the
tetrahedron. When they are done, two of them are back home, but
the other two find that they have switched vertices.
Prove that there was an instant when all four bugs lay on the same
plane.
Snake Game
Joan begins by marking any square of an n × n chessboard; Judy then
marks an orthogonally adjacent square. Thereafter, Joan and Judy
continue alternating, each marking a square adjacent to the last one
marked, creating a snake on the board. The first player unable to play
loses.
For which values of n does Joan have a winning strategy, and
when she does, what square does she begin at?
Three Negatives
A set of 1000 integers has the property that every member of the set
exceeds the sum of the rest. Show that the set includes at least three
negative numbers.
Numbers on Foreheads
Each of 10 prisoners will have a digit between 0 and 9 painted on his
forehead (they could be all 2’s, for example). At the appointed time
each will be exposed to all the others, then taken aside and asked to
guess his own digit.
xlii
The Puzzles
Bias Test
Before you are two coins; one is a fair coin, and the other is biased
toward heads. You’d like to try to figure out which is which, and to
do so you are permitted two flips. Should you flip each coin once, or
one coin twice?
Non-Repeating String
Is there a finite string of letters from the Latin alphabet with the prop-
erty that there is no pair of adjacent identical substrings, but the ad-
dition of any letter to either end would create one?
Three-way Election
Alison, Bonnie, and Clyde run for class president and finish in a three-
way tie. To break it, they solicit their fellow students’ second choices,
but again there is a three-way tie. The election committee is stymied
until Alison steps forward and points out that, since the number of
voters is odd, they can make two-way decisions. She therefore pro-
poses that the students choose between Bonnie and Clyde, and then
the winner would face Alison in a runoff.
Bonnie complains that this is unfair because it gives Alison a better
chance to win than either of the other two candidates. Is Bonnie right?
Skipping a Number
At the start of the 2019 season WNBA star Missy Overshoot’s lifetime
free-throw percentage was below 80%, but by the end of the season it
was above 80%. Must there have been a moment in the season when
Missy’s free-throw percentage was exactly 80%?
xliii
Mathematical Puzzles
using a red pen after his black one runs out of ink. When he’s done,
he notices that every rectangular tile has at least one totally red side.
Prove that the total length of George’s red lines is at least the length
of a side of the big square.
Unbroken Lines
Can you re-arrange the 16 square tiles below into a 4 × 4 square—
no rotation allowed!—in such a way that no line ends short of the
boundary of the big square?
Baby Frog
To give a baby frog jumping practice, her four grandparents station
themselves at the corners of a large square field. When a grandpar-
ent croaks, the baby leaps halfway to it. In the field is a small round
clearing. Can the grandparents get the baby to that clearing, no matter
where in the field she starts?
xliv
The Puzzles
xlv
Mathematical Puzzles
Flying Saucers
A fleet of saucers from planet Xylofon has been sent to bring back
the inhabitants of a certain randomly selected house, for exhibition in
the Xylofon Xoo. The house happens to contain five men and eight
women, to be beamed up randomly one at a time.
xlvi
The Puzzles
Increasing Routes
On the Isle of Sporgesi, each segment of road (between one intersec-
tion and the next) has its own name. Let d be the average number of
road segments meeting at an intersection. Show that you can take a
drive on the Isle of Sporgesi that covers at least d road segments, and
hits those segments in strict alphabetical order!
Curve on a Sphere
Prove that if a closed curve on the unit sphere has length less than 2π,
then it is contained in some hemisphere.
Biased Betting
Alice and Bob each have $100 and a biased coin that comes up heads
with probability 51%. At a signal, each begins flipping his or her coin
once a minute and bets $1 (at even odds) on each outcome, against a
bank with unlimited funds. Alice bets on heads, Bob on tails. Suppose
both eventually go broke. Who is more likely to have gone broke first?
Suppose now that Alice and Bob are flipping the same coin, so that
when the first one goes broke the second one’s stack will be at $200.
Same question: Given that they both go broke, who is more likely to
have gone broke first?
xlvii
Mathematical Puzzles
Unbroken Curves
Can you re-arrange the 16 square tiles below into a 4 × 4 square—
no rotation allowed!—in such a way that no curve ends short of the
boundary of the big square?
Dot-Town Exodus
Each resident of Dot-town carries a red or blue dot on his (or her) fore-
head, but if he ever thinks he knows what color it is he leaves town
immediately and permanently. Each day the residents gather; one
day a stranger comes and tells them something—anything—nontrivial
about the number of blue dots. Prove that eventually Dot-town be-
comes a ghost town, even if everyone can see that the stranger’s statement
is patently false.
Drawing Socks
You have 60 red and 40 blue socks in a drawer, and you keep drawing
a sock uniformly at random until you have drawn all the socks of one
color. What is the expected number of socks left in the drawer?
xlviii
The Puzzles
Whim-Nim
You and a friend, bored with Nim and Nim Misére, decide to play a
variation in which at any point, either player may declare “Nim” or
“Misère” instead of removing chips. This happens at most once in a
game, and then of course the game proceeds normally according to
that variation of Nim. (Taking the whole single remaining stack in an
undeclared game loses, as your opponent can then declare “Nim” as
his last move.)
What’s the correct strategy for this game, which its inventor, the
late John Horton Conway, called “Whim”?
xlix
Mathematical Puzzles
Chinese Nim
On the table are two piles of beans. Alex must either take some beans
from one pile or the same number of beans from each pile; then Beth
has the same options. They continue alternating until one wins the
game by taking the last bean.
What’s the correct strategy for this game? For example, if Alex is
faced with piles of size 12,000 and 20,000, what should he do? How
about 12,000 and 19,000?
Integral Rectangles
A rectangle in the plane is partitioned into smaller rectangles, each of
which has either integer height or integer width (or both). Prove that
the large rectangle itself has this property.
Losing at Dice
Visiting Las Vegas, you are offered the following game. Six dice are
to be rolled, and the number of different numbers that appear will be
counted. That could be any number from one to six, of course, but
they are not equally likely.
l
The Puzzles
If you get the number “four” this way you win $1, otherwise you
lose $1. You decide you like this game, and plan to play it repeatedly
until the $100 you came with is gone.
At one minute per game, how long, on the average, will it take
before you are wiped out?
Even-Sum Billiards
You pick 10 times, with replacement (necessarily!), from an urn con-
taining 9 billiard balls numbered 1 through 9. What is the probability
that the sum of the numbers of the balls you picked is even?
Strength of Schedule
The 10 teams comprising the “Big 12” college football conference are
all scheduled to play one another in the upcoming season, after which
one will be declared conference champion. There are no ties, and each
team scores a point for every team it beats.
Suppose that, worried about breaking ties, a member of the gov-
erning board of the conference suggests that each team receive in addi-
tion “strength of schedule points,” calculated as the sum of the scores
achieved by the teams it beat.
A second member asks: “What if all the teams end up with the
same number of strength-of-schedule points?”
What, indeed? Can that even happen?
li
Mathematical Puzzles
Locker Doors
Lockers numbered 1 to 100 stand in a row in the main hallway of
Euclid Junior High School. The first student arrives and opens all the
lockers. The second student then goes through and re-closes lockers
numbered 2, 4, 6, etc.; the third student changes the state of every
locker whose number is a multiple of 3, then the next every multiple
of 4, etc., until the last student opens or closes only locker number
100.
After the 100 students have passed through, which lockers are
open?
Gasoline Crisis
You need to make a long circular automobile trip during a gasoline
crisis. Inquiries have ascertained that the gas stations along the route
contain just enough fuel to make it all the way around. If you have an
empty tank but can start at a station of your choice, can you complete
a clockwise round trip?
Soldiers in a Field
An odd number of soldiers are stationed in a large field. No two sol-
diers are exactly the same distance apart as any other two soldiers.
Their commanding officer radios instructions to each soldier to keep
an eye on his nearest neighbor.
Is it possible that every soldier is being watched?
Home-field Advantage
Every year, the Elkton Earlies and the Linthicum Lates face off in a
series of baseball games, the winner being the first to win four games.
The teams are evenly matched but each has a small edge (say, a 51%
chance of winning) when playing at home.
Every year, the first three games are played in Elkton, the rest in
Linthicum.
Which team has the advantage?
lii
The Puzzles
Random Intersection
Two unit-radius balls are randomly positioned subject to intersecting.
What is the expected volume of their intersection? For that matter,
what is the expected surface area of their intersection?
liii
Mathematical Puzzles
liv
The Puzzles
Wild Guess
David and Carolyn are mathematicians who are unafraid of the infi-
nite and cheerfully invoke the Axiom of Choice when needed. They
elect to play the following two-move game. For her move, Carolyn
chooses an infinite sequence of real numbers, and puts each number
in an opaque box. David gets to open as many boxes as he wants—
even infinitely many—but must leave one box unopened. To win, he
must guess exactly the real number in that box.
On whom will you bet in this game, Carolyn or David?
Laser Gun
You find yourself standing in a large rectangular room with mirrored
walls. At another point in the room is your enemy, brandishing a laser
gun. You and she are fixed points in the room; your only defense is
that you may summon bodyguards (also points) and position them in
the room to absorb the laser rays for you. How many bodyguards do
you need to block all possible shots by the enemy?
Chameleons
A colony of chameleons currently contains 20 red, 18 blue, and 16
green individuals. When two chameleons of different colors meet,
lv
Mathematical Puzzles
each of them changes his or her color to the third color. Is it possible
that, after a while, all the chameleons have the same color?
Two Round-robins
The Games Club’s 20 members played a round-robin checkers toura-
ment on Monday and a round-robin chess tournament on Tuesday.
In each tournament, a player scored one point for each other player
he or she beat, and half a point for each tie.
Suppose every player’s scores in the two tournaments differed by
at least 10. Show that in fact, the differences were all exactly 10.
Factorial Coincidence
Suppose that a, b, c, and d are positive integers, all different, all greater
than one. Can it be that a!b = c!d ?
Conversation on a Bus
Ephraim and Fatima, two colleagues in the Mathematics Department
at Zorn University, wind up seated together on the bus to campus.
Ephraim begins a conversation with “So, Fatima, how are your
kids doing? How old are they now, anyway?”
“It turns out,” says Fatima as she is putting the $1 change from the
bus driver into her wallet, “that the sum of their ages is the number of
this bus, and the product is the number of dollars that happen to be
in my purse at the moment.”
lvi
The Puzzles
lvii
Mathematical Puzzles
Slabs in 3-Space
A “slab” is the region between two parallel planes in three-
dimensional space. Prove that you cannot cover all of 3-space with
a set of slabs the sum of whose thicknesses is finite.
Pegs in a Square
Suppose we begin with n2 pegs on a plane grid, one peg occupying
each vertex of an n-vertex by n-vertex square. Pegs jump only hori-
zontally or vertically, by passing over a neighboring peg and into an
unoccupied vertex; the jumped peg is then removed. The goal is to
reduce the n2 pegs to only 1.
Prove that if n is a multiple of 3, it can’t be done!
Filling a Bucket
Before you are 12 two-gallon buckets and a 1-gallon scoop. At each
turn, you may fill the scoop with water and distribute the water any
way you like among the buckets.
However, each time you do this your opponent will empty two
buckets of her choice.
You win if you can get one of the big buckets to overflow. Can you
force a win? If so, how long will it take you?
Game of Desperation
On a piece of paper is a row of n empty boxes. Tristan and Isolde take
turns, each writing an “S” or an “O” into a previously blank box. The
lviii
The Puzzles
Gluing Pyramids
A solid square-base pyramid, with all edges of unit length, and a solid
triangle-base pyramid (tetrahedron), also with all edges of unit length,
are glued together by matching two triangular faces.
How many faces does the resulting solid have?
Part III: How do you explain getting the same answer to Parts I and
II?
Random Intervals
The points 1, 2, . . . , 1000 on the number line are paired up at random,
to form the endpoints of 500 intervals. What is the probability that
among these intervals is one which intersects all the others?
North by Northwest
If you’ve never seen the famous Alfred Hitchcock movie North by
Northwest (1959), you should. But what direction is that, exactly? As-
sume North is 0◦ , East 90◦ , etc.
Missing Digit
The number 229 has 9 digits, all different; which digit is missing?
Coins in a Row
On a table is a row of 50 coins, of various denominations. Alix picks a
coin from one of the ends and puts it in her pocket; then Bert chooses
lix
Mathematical Puzzles
a coin from one of the (remaining) ends, and the alternation continues
until Bert pockets the last coin.
Prove that Alix can play so as to guarantee at least as much money
as Bert.
First-grade Division
On the first day of class Miss Feldman divides her first-grade class into
k working groups. On the second day, she picks the working groups
a different way, this time ending up with k+1 of them.
Show that there are at least two kids who are in smaller groups on
the second day than they were on the first day.
Deterministic Poker
Unhappy with the vagaries of chance, Alice and Bob elect to play
a completely deterministic version of draw poker. A deck of cards
is spread out face-up on the table. Alice draws five cards, then Bob
draws five cards. Alice discards any number of her cards (the dis-
carded cards will remain out of play) and replaces them with a like
number of others; then Bob does the same. All actions are taken with
the cards face-up in view of the opponent. The player with the better
hand wins; since Alice goes first, Bob is declared to be the winner if
the final hands are equally strong. Who wins with best play?
lx
The Puzzles
Precarious Picture
Suppose that you wish to hang a picture with a string attached at two
points on the frame. If you hang it by looping the string over two nails
in the ordinary way, as shown below, and one of the nails comes out,
the picture will still hang (albeit lopsidedly) on the other nail.
Can you hang it so that the picture falls if either nail comes out?
Early Commuter
A commuter arrives at her home station an hour early and walks to-
ward home until she meets her husband driving to pick her up at the
normal time. She ends up home 20 minutes earlier than usual. How
long did she walk?
lxi
Mathematical Puzzles
Powers of Roots
√ √
What is the first digit after the decimal point in the number ( 2+ 3)
to the billionth power?
An Attractive Game
You have an opportunity to bet $1 on a number between 1 and 6.
Three dice are then rolled. If your number fails to appear, you lose
your $1. If it appears once, you win $1; if twice, $2; if three times, $3.
Is this bet in your favor, fair, or against the odds? Is there a way to
determine this without pencil and paper (or a computer)?
Circular Shadows II
Show that if the projections of a solid body onto two planes are perfect
disks, then the two projections have the same radius.
lxii
The Puzzles
Alternate Connection
100 points lie on a circle. Alice and Bob take turns connecting pairs
of points by a line, until every point has at least one connection. The
last one to play wins; which player has a winning strategy?
Tiling a Polygon
A “rhombus” is a quadrilateral with four equal sides; we consider two
rhombi to be different if you can’t translate (move without rotation)
one to coincide with the other. Given a regular polygon with 100 sides,
you can take any two non-parallel sides, make( )two copies of each and
translate them to form a rhombus. You get 50 2 different rhombi that
way. You can use translated copies of these to tile your 100-gon; show
that if you do, you will use each different rhombus exactly once!
lxiii
Mathematical Puzzles
Splitting a Polygon
A chord of a polygon is a straight line segment that touches the poly-
gon’s perimeter at the segment’s endpoints and nowhere else.
Show that every polygon, convex or not, has a chord such that
each of the two regions into which it divides the polygon has area at
least 1/3 the area of the polygon.
Alternative Dice
Can you design two different dice so that their sums behave just like
a pair of ordinary dice? That is, there must be two ways to roll a 3,
6 ways to roll a 7, one way to roll a 12, and so forth. Each die must
have 6 sides, and each side must be labeled with a positive integer.
Even Split
Prove that from every set of 2n integers, you can choose a subset of
size n whose sum is divisible by n.
Coconut Classic
Five men and a monkey, marooned on an island, collect a pile of
coconuts to be divided equally the next morning. During the night,
however, one of the men decides he’d rather take his share now. He
tosses one coconut to the monkey and removes exactly 1/5 of the
lxiv
The Puzzles
remaining coconuts for himself. A second man does the same thing,
then a third, fourth, and fifth.
The following morning the men wake up together, toss one more
coconut to the monkey, and divide the rest equally. What’s the least
original number of coconuts needed to make this whole scenario pos-
sible?
Infected Checkerboard
An infection spreads among the squares of an n × n checkerboard
in the following manner: If a square has two or more infected neigh-
bors, then it becomes infected itself. (Neighbors are orthogonal only,
so each square has at most four neighbors.)
For example, suppose that we begin with all n squares on the main
diagonal infected. Then the infection will spread to neighboring diag-
onals and eventually to the whole board.
Prove that you cannot infect the whole board if you begin with
fewer than n infected squares.
Alternating Powers
Since the series 1 − 1 + 1 − 1 + 1 − · · · does not converge, the function
f (x) = x−x2 +x4 −x8 +x16 −x32 +· · · makes no sense when x = 1.
However, f (x) does converge for all positive real numbers x < 1. If
we wanted to give f (1) a value, it might make sense to let it be the
limit of f (x) as x approaches 1 from below. Does that limit exist? If
so, what is it?
Service Options
You are challenged to a short tennis match, with the winner to be
the first player to win four games. You get to serve first. But there are
options for determining the sequence in which the two of you serve:
1. Standard: Serve alternates (you, her, you, her, you, her, you).
lxv
Mathematical Puzzles
Which option should you choose? You may assume it is to your ad-
vantage to serve. You may also assume that the outcome of any game
is independent of when the game is played and of the outcome of any
previous game.
Conway's Immobilizer
Three cards, an ace, a deuce, and a trey, lie face-up on a desk in some
or all of three marked positions (“left,” “middle,” and “right”). If they
are all in the same position, you see only the top card of the stack; if
they are in two positions, you see only two cards and do not know
which of them is concealing the third card.
Your objective is to get the cards stacked on the left with ace on
top, then deuce, then trey on bottom. You do this by moving one card
at a time, always from the top of one stack to the top of another (pos-
sibly empty) stack.
The problem is, you have no short-term memory and must, there-
fore, devise an algorithm in which each move is based entirely on
what you see, and not on what you last saw or did, or on how many
moves have transpired. An observer will tell you when you’ve won.
Can you devise an algorithm that will succeed in a bounded number
of steps, regardless of the initial configuration?
Matching Coins
Sonny and Cher play the following game. In each round, a fair coin
is tossed. Before the coin is tossed, Sonny and Cher simultaneously
declare their guess for the result of the coin toss. They win the round if
both guessed correctly. The goal is to maximize the fraction of rounds
won, when the game is played for many rounds.
So far, the answer is obviously 50%: Sonny and Cher agree on
a sequence of guesses (for example, they decide to always declare
“heads”), and they can’t do any better than that. However, before
lxvi
The Puzzles
the game begins, the players are informed that just prior to the first
toss, Cher will be given the results of all the coin tosses in advance!
She has a chance now to discuss strategy with Sonny, but once she
gets the coinflip information, there will be no further opportunity to
conspire. Show how Sonny and Cher can guarantee to get at least six
wins in 10 flips.
(If that’s too easy for you, show how they can guarantee at least
six wins in only nine flips!)
Summing Fractions
Gail asks Henry to think of a number n between 10 and 100, but not
to tell her what it is. She now tells Henry to find all (unordered) pairs
of numbers j, k that are relatively prime and less than n, but add up
to more than n. He now adds all the fractions 1/jk.
Whew! Finally, Gail tells Henry what his sum is. How does she
do it?
Box in a Box
Suppose the cost of shipping a rectangular box is given by the sum of
its length, width, and height. Might it be possible to save money by
fitting your box into a cheaper box?
Option Hats
One hundred prisoners are told that at midnight, in the dark, each
will be fitted with a red or black hat according to a fair coinflip. The
lxvii
Mathematical Puzzles
prisoners will be arranged in a circle and the lights turned on, enabling
each prisoner to see every other prisoner’s hat color. Once the lights
are on, the prisoners will have no opportunity to signal to one another
or to communicate in any way.
Each prisoner will then be taken aside and given the option of
trying to guess whether his own hat is red or black, but he may choose to
pass. The prisoners will all be freed if (1) at least one prisoner chooses
to guess his hat color, and (2) every prisoner who chooses to guess
guesses correctly.
As usual, the prisoners have a chance to devise a strategy before
the game begins. Can they achieve a winning probability greater than
50%?
Impressionable Thinkers
The citizens of Floptown meet each week to talk about town poli-
tics, and in particular whether or not to support the building of a
new shopping mall downtown. During the meetings each citizen talks
to his friends—of whom there are always an odd number, for some
reason—and the next day, changes (if necessary) his opinion regard-
ing the mall so as to conform to the opinion of the majority of his
friends.
Prove that eventually, the opinions held every other week will be
the same.
One-bulb Room
Each of n prisoners will be sent alone into a certain room, infinitely
often, but in some arbitrary order determined by their jailer. The pris-
oners have a chance to confer in advance, but once the visits begin,
their only means of communication will be via a light in the room
which they can turn on or off. Help them design a protocol which
will ensure that some prisoner will eventually be able to deduce that
everyone has visited the room.
lxviii
The Puzzles
Infected Cubes
An infection spreads among the n3 unit cubes of an n × n × n
cube, in the following manner: If a unit cube has 3 or more infected
neighbors, then it becomes infected itself. (Neighbors are orthogonal
only, so each little cube has at most 6 neighbors.)
Prove that you can infect the whole big cube starting with just n2
sick unit cubes.
Worst Route
A postman has deliveries to make on a long street, to addresses 2,
3, 5, 7, 11, 13, 17, and 19. The distance between any two houses is
proportional to the difference of their addresses.
To minimize the distance traveled, the postman would of course
make his deliveries in increasing (or decreasing) order of address. But
our postman is overweight and would like to maximize the distance
lxix
Mathematical Puzzles
Halfway Points
Let S be a finite set of points in the unit interval [0,1], and suppose
that every point x ∈ S lies either halfway between two other points in
S (not necessarily the nearest ones) or halfway between another point
in S and an endpoint.
Show that all the points in S are rational.
Dishwashing Game
You and your spouse flip a coin to see who washes the dishes each
evening. “Heads” she washes, “tails” you wash.
lxx
The Puzzles
Tonight she tells you she is imposing a different scheme. You flip
the coin 13 times, then she flips it 12 times. If you get more heads than
she does, she washes; if you get the same number of heads or fewer,
you wash.
Should you be happy?
Random Judge
After a wild night of shore leave, you are about to be tried by your US
Navy superiors for unseemly behavior. You have a choice between ac-
cepting a “summary” court-martial with just one judge, or a “special”
court-martial with three judges who decide by majority vote.
Each possible judge has the same (independent) probability—
65.43%—of deciding in your favor, except that one officer who would
be judging your special court-martial (but not the summary) is noto-
rious for flipping a coin to make his decisions.
Which type of court-martial is more likely to keep you out of the
brig?
Angles in Space
Prove that among any set of more than 2n points in Rn , there are three
that determine an obtuse angle.
Wins in a Row
You want to join a certain chess club, but admission requires that you
play three games against Ioana, the current club champion, and win
two in a row.
Since it is an advantage to play the white pieces (which move first),
you alternate playing white and black.
A coin is flipped, and the result is that you will be white in the first
and third games, black in the second.
Should you be happy?
Chessboard Guess
Troilus is engaged to marry Cressida but threatened with deportation,
and Immigration is questioning the legitimacy of the proposed mar-
riage. To test their connection, Troilus will be brought into a room
lxxi
Mathematical Puzzles
Split Games
You are a rabid baseball fan and, miraculously, your team has won
the pennant—thus, it gets to play in the World Series. Unfortunately,
the opposition is a superior team whose probability of winning any
given game against your team is 60%.
Sure enough, your team loses the first game in the best-of-seven
series and you are so unhappy that you drink yourself into a stupor.
When you regain consciousness, you discover that two more games
have been played.
You run out into the street and grab the first passer-by. “What
happened in games 2 and 3 of the World Series?”
“They were split,” he says. “One game each.”
Should you be happy?
Frames on a Chessboard
You have an ordinary 8 × 8 chessboard with red and black squares. A
genie gives you two “magic frames,” one 2 × 2 and one 3 × 3. When
you place one of these frames neatly on the chessboard, the 4 or 9
squares they enclose instantly flip their colors.
Can you reach all 264 possible color configurations?
Angry Baseball
As in Split Games, your team is the underdog and wins any given game
in the best-of-seven World Series with probability 40%. But, hold on:
This time, whenever your team is behind in the series, the players get
angry and play better, raising your team’s probability of winning that
game to 60%.
Before it all begins, what is your team’s probability of winning the
World Series?
lxxii
The Puzzles
Bugs on a Polyhedron
Associated with each face of a solid convex polyhedron is a bug which
crawls along the perimeter of the face, at varying speed, but only in the
clockwise direction. Prove that no schedule will permit all the bugs to
circumnavigate their faces and return to their initial positions without
incurring a collision.
Serious Candidates
Assume that, as is often the case, no one has any idea who the next
nominee for President of the United States will be, of the party not
currently in power. In particular, at the moment no person has prob-
ability as high as 20% of being chosen.
As the politics and primaries proceed, probabilities change con-
tinuously and some candidates will exceed the 20% threshold while
others will never do so. Eventually one candidate’s probability will
rise to 100% while everyone else’s drops to 0. Let us say that after the
Two-Point Conversion
You, coach of the Hoboken Hominids football team, were 14 points
behind your rivals (the Gloucester Great Apes) until, with just a
lxxiii
Mathematical Puzzles
Swedish Lottery
In a proposed mechanism for the Swedish National Lottery, each par-
ticipant chooses a positive integer. The person who submits the low-
est number not chosen by anyone else is the winner. (If no number is
chosen by exactly one person, there is no winner.)
If just three people participate, but each employs an optimal, equi-
librium, randomized strategy, what is the largest number that has pos-
itive probability of being submitted?
Random Chord
What is the probability that a random chord of a circle is longer than
a side of an equilateral triangle inscribed in the circle?
Cube Magic
Can you pass a cube through a hole in a smaller cube?
Random Bias
Suppose you choose a real number p between 0 and 1 uniformly at
random, then bend a coin so that its probability of coming up heads
when you flip it is precisely p. Finally you flip your bent coin 100
times. What is the probability that after all this, you end up flipping
exactly 50 heads?
Gladiators, Version I
Paula and Victor each manage a team of gladiators. Paula’s gladiators
have strengths p1 , p2 , . . . , pm and Victor’s, v1 , v2 , . . . , vn . Gladi-
ators fight one-on-one to the death, and when a gladiator of strength
x meets a gladiator of strength y, the former wins with probability
x/(x+y), and the latter with probability y/(x+y). Moreover, if the
gladiator of strength x wins, he gains in confidence and inherits his
lxxiv
The Puzzles
Gladiators, Version II
Again Paula and Victor must face off in the Colosseum, but this time,
confidence is not a factor, and when a gladiator wins, he keeps the
same strength he had before.
As before, prior to each match, Paula chooses her entry first. What
is Victor’s best strategy? Whom should he play if Paula opens with her
best man?
Rolling a Six
How may rolls of a die does it take, on average, to get a 6—given that
you didn’t roll any odd numbers en route?
Traveling Salesmen
Suppose that between every pair of major cities in Russia, there’s a
fixed one-way air fare for going from either city to the other. Trav-
eling salesman Alexei Frugal begins in St. Petersburg and tours the
cities, always choosing the cheapest flight to a city not yet visited (he
does not need to return to St. Petersburg). Salesman Boris Lavish also
needs to visit every city, but he starts in Kaliningrad, and his policy
is to choose the most expensive flight to an unvisited city at each step.
It looks obvious that Lavish’s tour costs at least as much as Fru-
gal’s, but can you prove it?
lxxv
Mathematical Puzzles
Lame Rook
A lame rook moves like an ordinary rook in chess—straight up, down,
left, or right—but only one square at a time. Suppose that the lame
rook begins at some square and tours the 8 × 8 chessboard, visiting
each square once and returning to the starting square on the 64th
move. Show that the number of horizontal moves of the tour, and
the number of vertical moves of the tour, are not equal!
Coin Testing
The Unfair Advantage Magic Company has supplied you, a ma-
gician, with a special penny and a special nickel. One of these is
supposed to flip “Heads” with probability 1/3, the other 1/4, but
UAMCO has not bothered to tell you which is which.
Having limited patience, you plan to try to identify the biases by
flipping the nickel and penny one by one until one of them comes up
Heads, at which point that one will be declared to be the 1/3-Heads
coin.
In what order should you flip the coins to maximize the probabil-
ity that you get the correct answer, and at the same time to be fair, that
is, to give the penny and the nickel the same chance to be designated
the 1/3-Heads coin?
lxxvi
The Puzzles
the curve, from the three coordinate directions, may not contain any
loops.
Majority Hats
One hundred prisoners are told that at midnight, in the dark, each
will be fitted with a red or black hat according to a fair coin-flip. The
prisoners will be arranged in a circle and the lights turned on, enabling
each prisoner to see every other prisoner’s hat color. Once the lights
are on, the prisoners will have no opportunity to signal to one another
or to communicate in any way.
Each prisoner is then taken aside and must try to guess his own
hat color. The prisoners will all be freed if a majority (here, at least
51) get it right.
As before, the prisoners have a chance to devise a strategy before
the game begins. Can they achieve a winning probability greater than
50%? Would you believe 90%? How about 95%?
Bugs on a Line
Each positive integer on the number line is equipped with a green,
yellow, or red light. A bug is dropped on “1” and obeys the following
rules at all times: If it sees a green light, it turns the light yellow and
moves one step to the right; if it sees a yellow light, it turns the light
red and moves one step to the right; if it sees a red light, it turns the
light green and moves one step to the left.
Eventually, the bug will fall off the line to the left, or run out to
infinity on the right. A second bug is then dropped on “1,” again fol-
lowing the traffic lights starting from the state the last bug left them
in; then, a third bug makes the trip.
Prove that if the second bug falls off to the left, the third will march
off to infinity on the right.
lxxvii
Mathematical Puzzles
Circles in Space
Can you partition all of 3-dimensional space into circles?
Love in Kleptopia
Jan and Maria have fallen in love (via the internet) and Jan wishes to
mail her a ring. Unfortunately, they live in the country of Kleptopia
lxxviii
The Puzzles
where anything sent through the mail will be stolen unless it is sent
in a padlocked box. Jan and Maria each have plenty of padlocks, but
none to which the other has a key. How can Jan get the ring safely
into Maria’s hands?
Touring an Island
Aloysius is lost while driving his Porsche on an island in which ev-
ery intersection is a meeting of three (two-way) streets. He decides to
adopt the following algorithm: Starting in an arbitrary direction from
his current intersection, he turns right at the next intersection, then
left at the next, then right, then left, and so forth.
Prove that Aloysius must return eventually to the intersection at
which he began this procedure.
Fibonacci Multiples
Show that every positive integer has a multiple that’s a Fibonacci
number.
lxxix
Mathematical Puzzles
Emptying a Bucket
You are presented with three large buckets, each containing an inte-
gral number of ounces of some non-evaporating fluid. At any time,
you may double the contents of one bucket by pouring into it from a
fuller one; in other words, you may pour from a bucket containing x
ounces into one containing y ≤ x ounces until the latter contains 2y
ounces (and the former, x−y).
lxxx
The Puzzles
Prove that no matter what the initial contents, you can, eventually,
empty one of the buckets.
Funny Dice
You have a date with your friend Katrina to play a game with three
dice, as follows. She chooses a die, then you choose one of the other
two dice. She rolls her die while you roll yours, and whoever rolls the
higher number wins. If you roll the same number, Katrina wins.
Wait, it’s not as bad as you think; you get to design the dice! Each
will be a regular cube, but you can put any number of pips from 1 to
6 on any face, and the three dice don’t have to be the same.
Can you make these dice in such a way that you have the advan-
tage in your game?
lxxxi
Mathematical Puzzles
Sharing a Pizza
Alice and Bob are preparing to share a circular pizza, divided by radial
cuts into some arbitrary number of slices of various sizes. They will
be using the “polite pizza protocol”: Alice picks any slice to start;
thereafter, starting with Bob, they alternate taking slices but always
from one side or the other of the gap. Thus after the first slice, there
are just two choices at each turn until the last slice is taken (by Bob if
the number of slices is even, otherwise by Alice).
Is it possible for the pizza to have been cut in such a way that Bob
has the advantage—in other words, so that with best play, Bob gets
more than half the pizza?
Moth's Tour
A moth alights on the “12” of a clock face, and begins randomly walk-
ing around the dial. Each time it hits a number, it proceeds to the next
clockwise number, or the next counterclockwise number, with equal
probability. It continues until it has been at every number.
What is the probability that the moth finishes at the number “6”?
Names in Boxes
The names of 100 prisoners are placed in 100 wooden boxes, one
name to a box, and the boxes are lined up on a table in a room. One
by one, the prisoners are led into the room; each may look in at most
50 boxes, but must then leave the room exactly as he found it and is
permitted no further communication with the others.
The prisoners have a chance to plot their strategy in advance, and
they are going to need it, because unless every single prisoner finds his
own name all will subsequently be executed.
Find a strategy that gives the prisoners a decent chance of survival.
Garnering Fruit
Each of 100 baskets contains some number (could be zero) of apples,
some number of bananas, and some number of cherries. Show that
you can collect 51 of those baskets that together contain at least half
the apples, at least half the bananas, and at least half the cherries!
lxxxii
The Puzzles
Coin Game
You and a friend each pick a different heads-tails sequence of length
4 and a fair coin is flipped until one sequence or the other appears;
the owner of that sequence wins the game.
For example, if you pick HHHH and she picks TTTT, you win if
a run of four heads occurs before a run of four tails.
Do you want to pick first or second? If you pick first, what should
you pick? If your friend picks first, how should you respond?
Invisible Corners
Can it be that you are standing outside a polyhedron and can’t see
any of its vertices?
Sleeping Beauty
Sleeping Beauty agrees to the following experiment. On Sunday she
is put to sleep and a fair coin is flipped. If it comes up Heads, she is
awakened on Monday morning; if Tails, she is awakened on Monday
morning and again on Tuesday morning. In all cases, she is not told
the day of the week, is put back to sleep shortly after, and will have
no memory of any Monday or Tuesday awakenings.
lxxxiii
Mathematical Puzzles
Boardroom Reduction
The Board of Trustees of the National Museum of Mathematics has
grown too large—50 members, now—and its members have agreed
to the following reduction protocol. The board will vote on whether
to (further) reduce its size. A majority of ayes results in the immediate
ejection of the newest board member; then another vote is taken, and
so on. If at any point half or more of the surviving members vote nay,
the session is terminated and the board remains as it currently is.
Suppose that each member’s highest priority is to remain on the
board, but given that, agrees that the smaller the board, the better.
To what size will this protocol reduce the board?
Buffon's Needle
A needle one inch in length is tossed onto a large mat marked with
parallel lines one inch apart. What is the probability that the needle
lands across a line?
lxxxiv
The Puzzles
Life-Saving Transposition
There are just two prisoners this time, Alice and Bob. Alice will be
shown a deck of 52 cards spread out in some order, face-up on a table.
She will be asked to transpose two cards of her choice. Alice is then
dismissed, with no further chance to communicate to Bob. Next, the
cards are turned down and Bob is brought into room. The warden
names a card and to stave off execution for both prisoners, Bob must
find the card after turning over, sequentially, at most 26 of the cards.
As usual the prisoners have an opportunity to conspire before-
hand. This time, they can guarantee success. How?
Zero-Sum Vectors
On a piece of paper, you have (for some reason) made an array whose
rows consist of all 2n of the n-dimensional vectors with coordinates
in {+1, −1}n —that is, all possible strings of +1’s and −1’s of length
n.
Notice that there are lots of nonempty subsets of your rows which
sum to the zero vector, for example any vector and its complement;
or the whole array, for that matter.
lxxxv
Mathematical Puzzles
However, your 2-year-old nephew has got hold of the paper and
has changed some of the entries in the array to zeroes.
Prove that no matter what your nephew did, you can find a
nonempty subset of the rows in the new array that sums to zero.
Two Sheriffs
Two sheriffs in neighboring towns are on the track of a killer, in a case
involving eight suspects. By virtue of independent, reliable detective
work, each has narrowed his list to only two. Now they are engaged
in a telephone call; their object is to compare information, and if their
pairs overlap in just one suspect, to identify the killer.
The difficulty is that their telephone line has been tapped by the
local lynch mob, who know the original list of suspects but not which
pairs the sheriffs have arrived at. If they are able to identify the killer
with certainty as a result of the phone call, he will be lynched before
he can be arrested.
Can the sheriffs, who have never met, conduct their conversation
in such a way that they both end up knowing who the killer is (when
possible), yet the lynch mob is still left in the dark?
lxxxvi
The Puzzles
Self-Referential Number
The first digit of a certain 8-digit integer N is the number of zeroes in
the (ordinary, decimal) representation of N . The second digit is the
number of ones; the third, the number of twos; the fourth, the number
of threes; the fifth, the number of fours; the sixth, the number of fives;
the seventh, the number of sixes; and, finally, the eighth is the total
number of distinct digits that appear in N . What is N ?
Bulgarian Solitaire
Fifty-five chips are organized into some number of stacks, of arbitrary
heights, on a table. At each tick of a clock, one chip is removed from
each stack and those collected chips are used to create a new stack.
What eventually happens?
lxxxvii
The Hints
Below are hints and/or comments for each puzzle, together with the
number of the chapter where you can find a solution. (But to get the
most out of these puzzles, don’t go there until you’ve tried everything!)
lxxxix
Mathematical Puzzles
xc
The Hints
xci
Mathematical Puzzles
xcii
The Hints
xciii
Mathematical Puzzles
Filling a Bucket: How far can you get trying to keep all the buck-
ets level? (Chapter 19)
Filling the Cup: Note that the fractional parts of the amount of
rice you have got so far also constitutes a sequence of independent
uniform random variables. (Chapter 14)
Find the Robot: How many ways are there to start and point the
robot? (Chapter 23)
Finding a Jack: The jacks divide the deck into five parts. (Chapter
8)
Finding the Counterfeit: Each weighing can have three possible
outcomes. (Chapter 13)
Finding the Missing Number: How much information must be
kept? (Chapter 19)
Finding the Rectangles: What do you encounter as you walk
across the tiled 400-gon? (Chapter 22)
First Odd Number: List the alphabetically early words that may
arise in a number. (Chapter 11)
First-grade Division: Imagine that each project requires the same
total effort. (Chapter 18)
Flipping the Pentagon: A reasonable thing to try as a potential
might be some measure of how close the numbers are to one another.
(Chapter 18)
Flying Saucers: It’s important that the person beamed back down
might not be the first one beamed up by the next saucer. (Chapter 7)
Fourth Corner: Each grid point can have one of four possible par-
ities. (Chapter 2)
Frames on a Chessboard: Look for a set of cells the parity of
whose number of red cells doesn’t change. (Chapter 18)
Funny Dice: How can you give one die an advantage over another,
even though they both have the same average roll? (Chapter 19)
Game of Desperation: What position can you put your opponent
in that will force her to let you win on your next move? (Chapter 21)
Gaming the Quilt: If you’ve already bought k tickets, when is one
more worth buying? (Chapter 5)
Garnering Fruit: Try it for just apples and bananas; adding cher-
ries brings a ham sandwich(!) into the picture. (Chapter 3)
Gasoline Crisis: Start by imagining a trip that starts with plenty
of extra gas aboard. (Chapter 7)
Generating the Rationals: Note that you easily get all fractions
whose denominators are powers of 2. (Chapter 19)
xciv
The Hints
xcv
Mathematical Puzzles
the plane grid, and making a graph whose vertices are grid points that
lie on corners of rectangles. (Chapter 24)
Invisible Corners: You can start by putting yourself in a room
made from six non-touching planks. (Chapter 22)
King’s Salary: Try to reduce the number of salaried citizens.
(Chapter 11)
Lame Rook: What happens if you try this on an n × n board for
various (even) n? (Chapter 15)
Laser Gun: Cover the plane with reflected copies of the room.
(Chapter 24)
Lattice Points and Line Segments: When does the line segment
between two lattice points contain another lattice point? (Chapter 12)
Leading All the Way: Try putting the ballots in random circular
order, instead of random linear order. (Chapter 10)
Lemming on a Chessboard: If the lemming stays on the board, it
must eventually cycle. (Chapter 9)
Life Is a Bowl of Cherries: Consider the general two-bowl game
first. (Chapter 17)
Life Isn’t a Bowl of Cherries?: Start with the nim strategy itself,
rather than its reverse. (Chapter 17)
Life-saving Transposition: If you can do Names in Boxes, you can
do this one. (Chapter 19)
Light Bulbs in a Circle: Don’t forget to keep track of which bulb
you’re looking at, as well as the state of all bulbs. (Chapter 21)
Line Up by Height: Keep track of the lengths of the descending
and ascending subsequences each player is at the end of, when lined
up alphabetically. (Chapter 12)
Lines Through a Grid: Nineteen parallel diagonals will do it. Can
you do better? (Chapter 12)
Locker Doors: What numbers have an odd number of divisors
(including 1 and themselves)? (Chapter 6)
Losing at Dice: You’ll need to consider two patterns to compute
the number of ways to “roll a 4” by this strange method. (Chapter 1)
Lost Boarding Pass: Try it with three passengers. What is the
probability that third passenger ends up in the second passenger’s
seat? (Chapter 7)
Love in Kleptopia: Can Jan somehow get one of his locks on the
box? (Chapter 19)
Magnetic Dollars: Try it with, say, six coins instead of a million.
(Chapter 24)
xcvi
The Hints
xcvii
Mathematical Puzzles
Odd Light Flips: Note that the order in which switches are flipped
is irrelevant. (Chapter 15)
Odd Run of Heads: Use a variable to stand for the answer. (Chap-
ter 5)
One-bulb Room: Consider first the situation in which the room
is known to be dark at the start. (Chapter 19)
Option Hats: Since each guess has probability only 1/2 of being
correct, to improve the odds the prisoners need to arrange things so
that either very few guess and are right, or many guess and are wrong.
(Chapter 17)
Other Side of the Coin: Consider labeling the sides of the coins.
(Chapter 10)
Packing Slashes: In showing your solution is optimal, it may pay
to consider the 12 outer vertices of the inside 3 × 3 grid. (Chapter 11)
Painting the Cubes: Paint space and carve out the big cube!
(Chapter 16)
Painting the Fence: How does the question of whether an inter-
val between painters gets painted depend on its length, relative to the
lengths of its neighbor intervals? (Chapter 14)
Painting the Polyhedron: Assume you can inscribe a sphere, and
triangulate the sphere using the tangent points as vertices. (Chapter
16)
Pairs at Maximum Distance: Note that line segments connecting
two max-distance pairs must cross. (Chapter 9)
Pancake Stacks: Making the stacks close in size limits one’s op-
ponent. (Chapter 21)
Path Through the Cells: Recolor greedily with high-numbered
colors, and start your path with a cell that still has color 1. (Chapter
15)
Peek Advantage: Could the second peek change your mind?
(Chapter 13)
Pegs in a Square: Look for a useful way to two-color the holes.
(Chapter 18)
Pegs on the Corners: Notice that if the pegs begin at grid points,
they stay on grid points. (Chapter 21)
Pegs on the Half-Plane: Weigh the holes so that the entire lower
half-plane has finite weight. (Chapter 18)
Phone Call: Tackle this one hour at a time. (Chapter 19)
Picking the Athletic Committee: What happens if you just pick
a committee at random and try to fix it? (Chapter 18)
xcviii
The Hints
Pie in the Sky: The moon is about one degree in diameter. (Chap-
ter 20)
Ping-Pong Progression: How many points does Bob win, on av-
erage, while Alice wins 21? (Chapter 14)
Players and Winners: Think about communication in both direc-
tions. (Chapter 13)
Points on a Circle: Pick random diameters first, then endpoints.
(Chapter 10)
Poker Quickie: Assume no wild cards, one opponent. (Chapter
11)
Polygon Midpoints: What happens if you pick some arbitrary
point on the plane and assume it is a vertex? (Chapter 22)
Polygon on the Grid: What is the relationship of h or v to the
polygon’s area? (Chapter 19)
Polyhedron Faces: Think about the face with the most sides.
(Chapter 12)
Poorly Placed Dominoes: You might need two tries. (Chapter 19)
Portrait: Who is “my father’s son”? (Chapter 21)
Powers of Roots: Try the 10th power, and see if you can guess
what’s going on. (Chapter 7)
Powers of Two: Start from the middle of the phrase. (Chapter 1)
Precarious Picture: Somehow you must arrange the string so that
it ultimately passes over each nail, when the other is ignored. (Chapter
22)
Prime Test: If you don’t find any small prime factors, what else
can you try? (Chapter 6)
Prisoner and Dog: When is the woman close enough to the fence
to make a straight run for it, if the dog is at the opposite point? (Chap-
ter 19)
Prisoners and Gloves: For this you might want to consider parity
of permutations. (Chapter 2)
Profit and Loss: Observe first that it can’t be as long as 40 months.
(Chapter 15)
Protecting the Statue: Observe that the protected area cannot be
convex. (Chapter 22)
Raising Art Value: Compare the picture’s value to the averages
for the galleries. (Chapter 8)
Random Bias: Can you somehow “do the flips” before the coin is
chosen? (Chapter 10)
Random Chord: Does it matter how the random chord is chosen?
(Chapter 10)
xcix
Mathematical Puzzles
c
The Hints
Same Sum Subsets: What if you found two overlapping sets with
the same sum? (Chapter 12)
Second Ace: Compute the conditional probabilities. (Chapter 10)
Self-referential Number: If you try a number and it doesn’t work,
what’s the simplest way to try to fix it? (Chapter 19)
Sequencing the Digits: There’s more than one way to go about
choosing such a sequence. (Chapter 1)
Serious Candidates: Imagine betting on each candidate as he or
she becomes serious. (Chapter 14)
Service Options: It may be convenient to assume that lots of
games are played, regardless of outcomes. (Chapter 10)
Seven Cities of Gold: Equilateral triangles are your best friends
for this puzzle. (Chapter 11)
Sharing a Pizza: The even case is easy; try the odd case with pieces
of size 0(!) and 1. (Chapter 19)
Shoelaces at the Airport: Think about time spent walking. (Chap-
ter 1)
Shoes, Socks, and Gloves: What are the worst choices you can
make? (Chapter 12)
Signs in an Array: Is there anything good that must happen when
you flip a line that had negative sum? (Chapter 18)
Sinking 15: You may assume the players can sink whatever balls
they want, so this is a deterministic game. Does it seem familiar?
(Chapter 24)
Skipping a Number: Missy’s free-throw percentage jumps up
when she hits (and down when she misses), so it should be easy to
set up a situation where it jumps over 80%, right? (Chapter 3)
Slabs in 3-Space: Infinity is tricky—try covering a big finite piece
instead. (Chapter 16)
Sleeping Beauty: Imagine repeating the whole experiment 100
times. (Chapter 10)
Slicing the Cube: How would you actually do it? Can you do bet-
ter? (Chapter 24)
Snake Game: Tile the board with dominoes! (Chapter 4)
Soldiers in a Field: Think about the two closest soldiers. (Chapter
9)
Spaghetti Loops: What’s the probability that your ith tying oper-
ation will make a loop? (Chapter 14)
Sphere and Quadrilateral: Weigh the vertices so as to balance the
edges at the tangent points. (Chapter 20)
ci
Mathematical Puzzles
cii
The Hints
ciii
Mathematical Puzzles
civ
The Hints
Zeroes and Ones: What happens when you subtract from a num-
ber another number with the same value modulo n? (Chapter 12)
cv
1. Out for the Count
There’s nothing more basic in mathematics than counting—but at the
same time, counting mathematical objects can be dauntingly difficult.
We’ll start with some simple puzzles and gradually introduce some
of the special tools that we sometimes need for counting.
Half Grown
At what age is the average child half the height that he or she will be
as an adult?
Solution: Most people guess too high, maybe thinking that if full
height is reached around age 16, then half-height should be around 8.
There are two problems with that reasoning: (1) the rate of growth
for a human being is not constant, and (2) babies have a substantial
head start of 20 inches or so (when you prop them up).
The right answer: two years old! (For a girl, it’s actually about 2 14
years, for a boy 2 12 .)
Powers of Two
How many people are “two pairs of twins twice”?
Solution: There are four words in the phrase suggesting the number
“2” and most people rightly divine that these 2’s should be multiplied,
not added. So the answer is 16, right?
1
Mathematical Puzzles
Not so fast—a twin is only one person, thus a pair of twins, only
two. So the correct answer is 8.
Watermelons
Yesterday a thousand pounds of watermelons lay in the watermelon
patch. They were 99% water, but overnight they lost moisture to evap-
oration and now they are only 98% water. How much do they weigh
now?
Bags of Marbles
You have 15 bags. How many marbles do you need so that you can
have a different number of marbles in each bag?
Solution: Counting 0 as a number, you might reasonably deduce
that you should put no marbles in the first bag, 1 in the second, 2 in
the third, etc., and finally 14 in the last. How many marbles is that?
The quick way to answer that is to observe that the average num-
ber of marbles in one of your 15 bags is 7. Thus the total number of
marbles is 15 × 7 = 105.
But there’s a trick: You can put bags inside bags! If you put the
empty first bag inside the second along with one marble, then the
second inside the third along with another marble, etc., you end with
the last bag containing all the marbles. So you only need 14 marbles
in all.
2
Out for the Count
Efficient Pizza-cutting
What’s the maximum number of pieces you can get by cutting a
(round) pizza with 10 straight cuts?
Solution: There are a number of ways to tackle this one, but per-
haps the easiest is to note that the nth cut can at best cross each of
the n−1 previous cuts, and between each pair of crossings, split a
previous piece in two. Since you also get a new piece before the first
crossing and after the last one, the cut ends up adding n new pieces.
It follows that with n cuts you can create at most 1 + 2 + · · · + n =
n(n+1)/2 new pieces, but remember you started with one piece (the
whole pizza), so the answer is 1 + n(n+1)/2 pieces. For 10 slices, that
works out to 56 pieces.
Wait, we haven’t actually shown that you can achieve that many
pieces—that would require having every two cuts cross, with never
any more than two cuts crossing at the same place. But if we just
mark 2n random points along the edge of the pizza, number them
clockwise (say) and cut from the first to the n+1st, then the second to
the n+2nd, etc., we’ll get what we want with probability 1.
3
Mathematical Puzzles
You don’t like random cuts? I’ll leave it to you to come up with
a deterministic way to make your 10 (or n) cuts subject to the above
constraints.
Attention Paraskevidekatriaphobes
Is the 13th of the month more likely to be a Friday than any other day
of the week, or does it just seem that way?
4
Out for the Count
5
Mathematical Puzzles
heats of five horses do you need to determine the fastest three of your
25?
Solution: Hmm. It’s clear that all the horses need to be run, since
an untested horse could easily be one of the fastest three. You could
do that in five heats but that would not clinch the deal, so you’ll need
at least six heats for sure.
Well, suppose you do partition the horses into five heats; you’d
then need to test the winners against one another. What will you know
then?
Suppose (without loss of generality) that the winner of your sixth
heat came from Heat 1, the runner-up from Heat 2, and the placer
from Heat 3. Of course the fastest horse overall is the winner of Heat
6, but the second-fastest could either be the runner-up of Heat 6 or
the runner-up of Heat 1. The third-fastest horse could be the placer in
Heat 6, the runner-up or placer in Heat 1, or the runner-up in Heat 2.
So the only horses “in the running” (sorry about that) for second
and third place are the runner-up and placer from Heat 1, the winner
and runner-up from Heat 2, and the winner from Heat 3. That’s five
horses; run then in Heat 7, and you’re done. It’s not hard to see you
can’t beat this elegant solution.
Solution: You should tie your shoelace on the walkway. Either way,
you spend the same amount of time walking on solid ground, and the
same amount of time tying your shoelace. But if you tie your shoelaces
on solid ground, you spend more time walking on the walkway.
6
Out for the Count
Three-way Election
Alison, Bonnie, and Clyde run for class president and finish in a three-
way tie. To break it, they solicit their fellow students’ second choices,
but again there is a three-way tie. The election committee is stymied
until Alison steps forward and points out that, since the number of
voters is odd, they can make two-way decisions. She therefore pro-
poses that the students choose between Bonnie and Clyde, and then
the winner would face Alison in a runoff.
Bonnie complains that this is unfair because it gives Alison a better
chance to win than either of the other two candidates. Is Bonnie right?
7
Mathematical Puzzles
8
Out for the Count
Once you see the problem this way, you are likely to discover that
the best way to cover all the points in the cube is to concentrate all
your test points in just two of the eight 4 × 4 × 4 octants. You will
then arrive at a solution equivalent to the one described below.
Try all combinations with numbers from {1, 2, 3, 4} whose sum is
a multiple of 4; there are 16 of those, since if you pick the numbers
on the first two (or any two) of the dials, the number on the third is
determined. Now try all the combinations you get by adding (4,4,4),
that is, by adding 4 to each of the three numbers; there are 16 more of
those, and we claim that together the 32 choices cover all possibilities.
It is easy to see that this works. The correct combination must
have either two (or more) values in the set {1, 2, 3, 4}, or two or more
values in the set {5, 6, 7, 8}. If the former is the case, there is a unique
value for the third dial (the one whose number may not be among
{1, 2, 3, 4}) such that the three were among the first 16 tested combi-
nations. The other case is similar.
To see that we can’t cover with 31 or fewer test-combinations, sup-
pose that S is a cover and |S| = 31. Let Si = {(x, y, z) ∈ S : z = i}
be the ith level of S.
Let A be the set {1, 2, 3}, B = {4, 5, 6, 7, 8}, and C =
{2, 3, 4, 5, 6, 7, 8}. At least one level of S must contain 3 or fewer
points; we might as well assume S1 is this level and |S1 | = 3. (If
|S1 | ≤ 2, there’s an easy contradiction.) The points of S1 must lie in
a 3 × 3 × 1 subcube; we may assume that they lie in A × A × {1}.
The 25 points in B × B × {1} must be covered by points not in
S1 . No two of them can be covered by the same point in S, thus,
S \ S1 (that is, the elements of S that are not in S1 ) has a subset T
9
Mathematical Puzzles
Losing at Dice
Visiting Las Vegas, you are offered the following game. Six dice are
to be rolled, and the number of different numbers that appear will be
counted. That could be any number from one to six, of course, but
they are not equally likely.
If you get the number “four” this way you win $1, otherwise you
lose $1. You decide you like this game, and plan to play it repeately
until the $100 you came with is gone.
At one minute per game, how long, on the average, will it take
before you are wiped out?
10
Out for the Count
North by Northwest
If you’ve never seen the famous Alfred Hitchcock movie North by
Northwest (1959), you should. But what direction is that, exactly? As-
sume North is 0◦ , East 90◦ , etc.
Solution: Sounds like it should be halfway between north (0◦ ) and
northwest (315◦ ), thus 337.5◦ , but that’s actually “north–northwest,”
not “north by northwest.” The preposition “by” moves the needle just
11.25◦ in the direction of its object; thus “north by northwest” puts
you at (360 − 11.25)◦ = 348.75◦ . Northwest by north, on the other
hand, is (315 + 11.25)◦ = 326.25◦ . To make things even more con-
fusing, “north by northwest” is commonly designated more simply as
“north by west.” So the movie title was not actually a phrase in use;
in fact the movie’s original title was “In a Northwesterly Direction.”
11
Mathematical Puzzles
Doesn’t roll off the tongue quite as well, though, does it?
The next puzzle is, really, just a bit of arithmetic.
Early Commuter
A commuter arrives at her home station an hour early and walks to-
ward home until she meets her husband driving to pick her up at the
normal time. She ends up home 20 minutes earlier than usual. How
long did she walk?
Solution: This kind of timing problem can drive you nuts, until you
think about it the “right way.” Here, you notice that the commuter’s
husband apparently saved 10 minutes each way, relative to normal,
so must have picked up his wife 10 minutes earlier than usual. So she
walked for 50 minutes.
To solve the next puzzle, we return to those binomial coefficients.
Alternate Connection
One hundred points lie on a circle. Alice and Bob take turns con-
necting pairs of points by a line, until every point has at least one
connection. The last one to play wins; which player has a winning
strategy?
Solution: The player who connects the 98th point is doomed, since
there will be either one or two unconnected points left( after
) her move,
which her opponent can then deal with. There are 97 2 moves that
can be made before the 98th needs to be connected, and since this
number is even, the second player can always win.
Solution: By mentally twisting the tree trunk with the vines still on
it, we see that the answer is the same as it would be if the bindweed
went straight up while the honeysuckle went around 5 + 3 = 8 times.
12
Out for the Count
Therefore there are 9 meetings in total, and the answer, with the top
and bottom not counted, is 7.
13
Mathematical Puzzles
The question we address is: How many ways are there to set up
a phone tree for an organization with n members? This question
was answered by German mathematician Carl Wilhelm Borchardt
in 1860, the same year Johann Philipp Reis built (arguably) the first
telephone prototype.
Borchardt’s contribution has been mostly forgotten and the name
of an English mathematician, Arthur Cayley, is associated with the
formula to come below.
Before we state and prove “Cayley’s formula,” roughly how many
phone trees might you guess would be possible if for a 10-member
organization? Hundreds? Thousands?
The answer is a hundred million. Exactly!
Theorem. The number of trees on a set of n labeled points is nn−2 .
14
Out for the Count
Then we erase that leftmost number and repeat, now looking for the
smallest number missing from the new, shorter sequence that has not
already been used as a leaf. This continues until the sequence is gone,
and then we connect the two vertices that were never used as leaves
to complete the tree.
We will not formally prove here that the two algorithms described
above are inverses of each other, but hopefully the example is con-
vincing. ♡
15
Mathematical Puzzles
16
2. Achieving Parity
To a mathematician, “parity” often means just odd versus even. Typi-
cally, the concept of parity is not mentioned in a puzzle; but when you
start to play with the puzzle, the concepts of odd and even emerge.
And when they do, you are often half the way to solving it.
Here’s a simple example.
Bacterial Reproduction
When two pixo-bacteria mate, a new bacterium results; if the parents
are of different sexes the child is female, otherwise it is male. When
food is scarce, matings are random and the parents die when the child
is born.
It follows that if food remains scarce a colony of pixo-bacteria will
eventually reduce to a single bacterium. If the colony originally had
10 males and 15 females, what is the probability that the ultimate
pixo-bacterium will be female?
Fourth Corner
Pegs occupy three corners of a square. At any time a peg can jump
over another peg, landing an equal distance on the other side. Jumped
pegs are not removed. Can you get a peg onto the fourth corner of the
square?
17
Mathematical Puzzles
Unanimous Hats
100 prisoners are offered the chance to be freed if they can win the
following game. In the dark, each will be fitted with a red or black hat
according to a fair coinflip. When the lights are turned on, each will
see the others’ hat colors but not his own; no communication between
prisoners will be permitted.
Each prisoner will be asked to write down his guess at his own hat
color, and the prisoners will be freed if they all get it right.
The prisoners have a chance to conspire beforehand. Can you
come up with a strategy for them that will maximize their probability
of winning?
18
Achieving Parity
Half-Right Hats
One hundred prisoners are offered the chance to be freed if they can
win the following game. In the dark, each will be fitted with a red or
black hat according to a fair coinflip. When the lights are turned on,
each will see the others’ hat colors but not his own; no communication
between prisoners will be permitted.
Each prisoner will be asked to write down his guess at his own hat
color, and the prisoners will be freed if at least half get it right.
The prisoners have a chance to conspire beforehand. Can you
come up with a strategy for them that will maximize their probability
of winning?
Solution: Yes, they just arrange for 50 prisoners to guess their color
by assuming the total number of red hats is even, while the other 50
assume the number of red hats is odd. Then one group or the other is
bound to be right, assuming no poor fellow screws up!
Solution: It’s clear that no more than n−1 prisoners can be sure of
surviving, because the first one to guess—namely, the last in line—
has no clue. But he can pass a clue to the prisoner in front of him,
19
Mathematical Puzzles
by letting him know whether the number of red hats among prisoners
1 througn n−1 is even or odd. How does he communicate? By his
guess, of course. The prisoners can agree, for example, that the last
prisoner in line guesses “red” if he sees an odd number of red hats,
“black” otherwise.
So that saves the life of prisoner n−1; what about the rest? They’re
saved too! Everyone has heard the last prisoner, and knows that after
him, all guesses will be correct. For example, if the ith prisoner to
guess hears that there are an even number of reds among prisoners
1 through n−1, and after the first guess he hears 5 “red” guesses, he
concludes that the number of red hats from himself forward is odd. If
he actually sees an even number of red hats in front of him, he knows
that his own hat must be red and guesses accordingly.
The next one is a bit trickier. Luckily, the prisoners are getting
pretty good with these games.
20
Achieving Parity
For example, suppose the prisoners are Able, Baker, Charlie, and
Dog, numbered 1 to 4 in that order. Say their numbers, respectively,
are 2.4, 1.3, 6.89, and π. Then the permutation is (2,1,4,3) where
the “2” at the front represents the fact that the first prisoner got the
second-lowest number, etc.
This permutation happens to have even parity, since interchanging
the 2 and the 1, then the 4 and the 3, restores it to the identity (1,2,3,4).
Of course, Charlie cannot see the 6.89 on his own forehead so he
doesn’t know the parity of the permutation. But suppose he assumes
that his own number is the lowest of all; then he can compute the
parity. He’ll be right if his number is the lowest, or the third lowest, or
the fifth lowest, and so forth; wrong if his number happens to be the
ith lowest, i being an even number.
Let’s have Charlie put the white glove on his left hand (and black
on right) if his assumption leads him to an even permutation, and
the reverse if he gets an odd permutation. (In the example, Charlie’s
assumption leads him to the permutation (3,2,1,4) which is odd, so
he puts the black glove on his left hand.)
That works! If the permutation actually is even, then the pris-
oner with lowest forehead number would have computed “even” and
would have a white glove on his left hand. The next-lowest-forehead-
numbered prisoner would have computed “odd” and his black-gloved
left hand would end up holding the first guy’s black-gloved right hand,
and similarly down the line. If the actual permutation is odd, the glove
colors will be the complement of these, and will still work.
Even-sum Billiards
You pick 10 times, with replacement (necessarily!), from an urn con-
taining nine billiard balls numbered 1 through 9. What is the proba-
bility that the sum of the numbers of the balls you picked is even?
21
Mathematical Puzzles
Chameleons
A colony of chameleons currently contains 20 red, 18 blue, and 16
green individuals. When two chameleons of different colors meet,
each of them changes his or her color to the third color. Is it possible
that, after a while, all the chameleons have the same color?
22
Achieving Parity
Missing Digit
The number 229 has 9 digits, all different; which digit is missing?
Solution: What to do? You can type “2^29” into your computer or
calculator and look at the number for yourself, but is there a way to
do it in your head without getting a headache?
Hmm . . . maybe you remember a technique from grade school
called “casting out nines,” where you keep adding up digits and al-
ways end up with a number’s value modulo 9 (that is, its remain-
der after dividing by 9). It uses the fact that 10 ≡ 1 mod 9, thus
10n ≡ 1n ≡ 1 mod 9 for every n. If we denote by x∗ the sum of the
digits of the number x, then we get (xy)∗ ≡ x∗ y ∗ mod 9 for every x
and y.
It follows in particular that (2n )∗ ≡ 2n mod 9. The powers of 2
mod 9 begin 2, 4, 8, 7, 5, 1, and then repeat; since 29 ≡ 5 mod 6, 2n
mod 9 ≡ the fifth number in this series, which happens to be 5.
Now the sum of all the digits is 10 × 4.5 = 45 ≡ 0 mod 9, so the
missing digit must be 4. Indeed, 229 = 536,870,912.
23
Mathematical Puzzles
24
Achieving Parity
Solution: This puzzle (along with two others in the book) was in-
spired by the work of artist Sol LeWitt, who loved to construct paint-
ings (and sculptures) from pieces that consisted of every possible way
to do some combinatorial task.
In the case of the present puzzle, examination of the tiles shows
that each side of a tile has two entry/exit points. The four points be-
longing to two adjacent sides are paired up in one of two ways: with
the two points closest to the common corner paired, and the other two
paired (each by a quarter of a circle); or by pairing each point close to
the corner to the one farther from the corner on the other side (using
two crossing quarter-ellipses).
Thus, for each corner there’s a decision to be made: to cross, or not
to cross. These four binary decisions result exactly in the 16 different
tiles you see.
Since when we wrap around the doughnut, none of the curved
lines terminate, the curves are forced to form loops. The question is
whether we can arrange the tiles to form just one loop.
As with many puzzles, our initial strategy is just to try various
arrangements and count the loops. You will find that no matter how
you do it, there always seem to be an even number of loops. If that
holds in general, then, of course, we can never make a single loop.
But why should the number of loops always be even?
One natural way to try to prove it might be to show that if we
switch two adjacent tiles, the number of loops always changes by an
even number. Alas, there are a lot of curved lines that enter a pair
of adjacent tiles (12 in all) and it’s awfully hard to deal with all the
different things that can happen when two adjacent tiles are switched.
We need to consider some much smaller change. How about
crossing or uncrossing one pair of curves on a tile? Of course, if we do
that, it would effectively destroy one tile and duplicate another. We
would then be in a different universe where we have as many as we
like of each tile, and can choose any 16 tiles to arrange into a square.
A little experimentation shows that if we take any configuration
involving the 16 original tiles—for example, the one above—and cross
or uncross curved lines on one side of one tile, the number of loops
always goes up or down by one. If that’s universally true, we arrive at
a conjecture: If the total number of crossings in the picture is even,
the number of loops will be even; if it is odd, the number of loops will
be odd. More experimentation seems to confirm this; can we prove
it?
25
Mathematical Puzzles
The figure below shows the three things that can happen when you
make or undo a crossing. The first two create or destroy one loop, thus
they add or subtract one from the loop total. The third is impossible;
if a loop is oriented (say, clockwise), and the tiles are colored like a
checkerboard, then a loop alternately enters gray tiles vertically and
white tiles horizontally, or vice-versa. The loops shown violate this
condition.
Now, if you start with the first figure, which has 16 crossings and
four loops, you can create or delete crossings to get any desired con-
figuration. But every time you create or delete a crossing, the number
of crossings and the number of loops remain the same parity—both
odd, or both even. Eventually when you get to any arrangement of
the 16 original tiles, you are back to an even number of loops. ♡
26
Achieving Parity
Our theorem was an open problem for some time, until parity was
unleashed on it. It concerns partitions of an abstract combinatorial
construction.
Fix a positive number n. A box is a Cartesian product of n finite
sets; if the sets are A1 , . . . , An , then the box consists of all sequences
(a1 , . . . , an ) such that ai ∈ Ai for each i.
A box B = B1 × · · · × Bn is a proper sub-box of A = A1 × · · · × An
if Bi is a proper nonempty subset of Ai for each i.
If each factor Ai has at least two elements, so that each factor
Ai can be partitioned into two non-empty sets, then by taking every
product of one set from each Ai we could partition the box A into 2n
proper sub-boxes. However,
Theorem. A box can never be partitioned into fewer than 2n proper sub-
boxes.
Proof. Call a sub-box odd if it has an odd number of elements, and
let O be the set of all odd sub-boxes of the big box A, and if B is a
sub-box of A, let OB consist of the elements of O that intersect B in
an odd set.
If B = B1 × · · · × Bn then in order for a set C to intersect B in an
odd number of elements, it must intersect every factor Bi in an odd
number of elements (because |C ∩ B| = |C ∩ B1 | × |C ∩ B2 | × · · · ×
|C ∩ Bn |).
But the probability that a random odd subset Ci of Ai intersects
Bi in an odd number of elements is exactly 12 . Why? Because we can
flip a coin to determine whether each a ∈ Ai is in Ci or not, ending
with some element a′ that’s not in Ai (remember, Bi is supposed to
be a proper subset of Ai ). This last element a′ is put into Ci or not so
as to assure Ci is odd. The elements of Bi that we flipped for consti-
tute a random subset of BI , and since exactly half the subsets of any
nonempty finite set are odd, the probability that Bi ∩ Ci is odd is 12
as claimed.
Each C ∈ O is partitioned by the B’s, and since C is odd, at least
one of the parts of the partition must be odd. If there are m parts of
the partition, it follows that the probability that C ∈ OB is at least
1/m. But we just showed that probability is 1/2n , so m ≥ 2n ! ♡
27
3. Intermediate Math
The Intermediate Value Theorem (IVT) states that if a real number
changes continuously as it moves from a to b, then it must pass
through every value between a and b. This simple and intuitive fact—
arguably, more of a property of the real numbers than a theorem—is
a powerful tool in mathematics, and shows up often in puzzle solu-
tions.
A useful variation of IVT addresses the case when one real number
is moving continuously from a to b while another goes from b to a;
they must cross. For example:
29
Mathematical Puzzles
Monk on a Mountain
A monk begins an ascent of Mt. Fuji on Monday morning, reaching
the summit by nightfall. He spends the night at the summit and starts
down the mountain on the same path the following morning, reaching
the bottom by dusk on Tuesday.
30
Intermediate Math
Prove that at some precise time of day, the monk was at exactly
the same spot on the path on Tuesday as he was on Monday.
Solution: If we plot the monk’s position as a function of time of day,
we get two curves connecting opposing corners, and the conclusion
follows from IVT. But here’s another way to think of it, underscoring
the intuitiveness of IVT: Superimpose Monday and Tuesday, so now
the Monk climbs at the same time that his doppelgänger descends. They
must meet!
31
Mathematical Puzzles
red on the redder side changes continuously, and after 180◦ of rotation
it has switched from redder to pinker. The IVT tells us that there is a
point when there was the same amount of red on both sides of the
line.
The remaining subtlety: What if that position involves cutting
through a gem? Well, it can’t cut a ruby on one end while it cuts a
diamond at the other end, because then the number of rubies on one
side of the line would not be an integer—and half of 10 is an integer.
So either both ends of the line cut through a ruby or both through
a diamond, and if we move the line a bit until it no longer cuts through
a gem, the number of rubies on one side will not change.
Another way to look at it: You can apply the IVT to integers, if
you replace the requirement of continuity by the requirement that the
integer value changes only by one. If the rotating line always points to
the boundary between two gems (at both ends), and moves one gem
at a time, the number of rubies on one side can never change by more
than one. We can thus conclude that as the line rotates 180◦ , it must
at some point have half the rubies on each side.
In some puzzles the need for IVT is not at first obvious.
Three Sticks
You have three sticks that can’t make a triangle; that is, one is longer
than the sum of the lengths of the other two. You shorten the long
one by an amount equal to the sum of the lengths of the other two,
so you again have three sticks. If they also fail to make a triangle, you
again shorten the longest stick by an amount equal to the sum of the
lengths of the other two.
32
Intermediate Math
Solution: If you could set p twice, two flips would be enough: Set
p = 13 and on Heads give the widget to Alice, else reset to 21 and use
the result to decide between Bob and Charlie. Since you can only set
p once, it might make sense to try to design a scheme first, then pick
p to make the scheme work.
For example, you could flip your coin three times and if the flips
are not all the same, you could use the “different” flip to decide to
whom to award the widget (e.g., “HTT” means Alice gets it). But if
you get all heads or all tails, you’ll have to do it again, and maybe yet
again—so, not in any bounded number of flips.
33
Mathematical Puzzles
But now suppose we flip the coin four times. There are four ways
to get one head, six to get two, four to get three: Even numbers all, so
anytime you get non-uniform results you can use the flips to decide
between Alice and Bob. If the coin is fair, the remaining probability—
that is, the probability q = p4 + (1 − p)4 of “HHHH or TTTT”—is
only 18 , too small for Charlie.
As you reduce p, however, q changes continuously and approaches
1. Thus, by IVT, there is some p for which the probability of “HHHH
or TTTT” is exactly the 13 you need. ♡
Bugs on a Pyramid
Four bugs live on the four vertices of a triangular pyramid (tetrahe-
dron). Each bug decides to go for a little walk on the surface of the
tetrahedron. When they are done, two of them are back home, but
the other two find that they have switched vertices.
Prove that there was an instant when all four bugs lay on the same
plane.
34
Intermediate Math
Skipping a Number
At the start of the 2019 season WNBA star Missy Overshoot’s lifetime
free-throw percentage was below 80%, but by the end of the season it
was above 80%. Must there have been a moment in the season when
Missy’s free-throw percentage was exactly 80%?
Solution: Let X(t) be the fraction of Missy’s free-throws that have
gone in, up to time t. This value jumps up or down each time Missy at-
tempts a free throw, and is always a rational number. The IVT clearly
does not apply, so your immediate reaction is probably “no”—there’s
no reason why X(t) should have to be exactly 4/5 at some point.
But it seems annoyingly difficult to actually construct a “history”
for Missy that misses 80% (try it). We could certainly get her past
70%; perhaps she’s 2 for 3 at the start of the season, then sinks her
next free throw, jumping from 66 23 % directly to 75%. But 80% seems
impossible to skip. What’s going on here?
As is often the case, it pays to try simpler numbers. Can we get
Missy past 50% without hitting it? Ah—the answer is no, because if
H(t) is Missy’s number of hits up to time t and M (t) her number of
misses, then the difference H(t) − M (t) starts off negative and ends
positive. Since this difference is an integer which changes by only 1
when a free throw is attempted, it must (by applying integer-IVT) hit
0; at that moment, H(t) = M (t) and therefore Missy’s success rate is
exactly 50%.
Returning to 80%, we observe that at the moment when X(t) =
.8, if there is one, we have H(t) = 4M (t). Now, let t0 be the first time
at which Missy’s percentage hits or exceeds 80%. That moment was,
obviously, marked by a successful free throw; in other words, at time
t0 , H(t) went up by one while M (t) stayed fixed. But H(t) can’t have
skipped from below 4M (T ) to above 4M (t); again by integer-IVT, it
must hit 4M (t). So 80% can’t be skipped!
Observe: (1) Our argument required that Missy went from below
80% to above it. In fact, she can easily skip 80% going down. (2) The ar-
gument uses the fact that at 80%, the number of hits will be an integer
multiple of the number of misses. Thus, it works for any percentage
that represents a fraction of the form (k−1)/k, and you can readily
verify that any other fraction between 0 and 1 is skippable going up.
Going down, it is the fractions of the form 1/k that can’t be skipped.
Some processes are piecewise continuous, that is, continuous ex-
cept at a discrete set of points. To apply IVT in such a case, you might
have to “limit the damage” at jumping points.
35
Mathematical Puzzles
Splitting a Polygon
A chord of a polygon is a straight line segment that touches the poly-
gon’s perimeter at the segment’s endpoints and nowhere else.
Show that every polygon, convex or not, has a chord such that
each of the two regions into which it divides the polygon has area at
least 13 the area of the polygon.
Solution: Call the polygon P and scale it so that it has area 1. If
P is convex we can always find a chord that cuts P into two pieces
of area 12 , as you, dear reader, now an expert with IVT, can readily
prove. In fact, you can choose arbitrarily the chord’s angle to the hor-
izontal. Just move a line at that angle across P ; since P is convex the
intersection of its interior with the line consists of a single chord. Be-
hind that chord is a piece of P whose area changes continuously from
0 to 1.
Try that when P is nonconvex, and things get messy: The line’s
intersection with P ’s interior may consist of several chords. Indeed,
some polygons simply can’t be cut into two equal-area parts by a
chord—see the figure below for an example.
36
Intermediate Math
The last (and toughest) puzzle in this chapter doesn’t look at all
like a case for IVT, and even less like IVT’s three-dimensional ana-
logue. But let’s see how it plays out.
Garnering Fruit
Each of 100 baskets contains some number (could be zero) of apples,
some number of bananas, and some number of cherries. Show that
you can collect 51 of those baskets that together contain at least half
the apples, at least half the bananas, and at least half the cherries!
Solution: If we had just apples, then we could clearly get half the
fruit in only 50 baskets by just taking the 50 baskets with the most
apples. Or we could divide the baskets into two groups of 50 any
way we want, and just take the part with more apples. Or—more
geometrically—we could line up the baskets, divide the line (possibly
through the middle of a basket, maybe cutting apples in the basket)
in such a way that exactly half the apples are on either side of the
cut, and note that there at most 49 whole baskets on one side of the
cut or the other. Take those 49 plus all of the cut basket to get your
37
Mathematical Puzzles
winning 50 baskets. (If no basket is cut, just take a side with at most
50 baskets.)
With two fruits, we can’t guarantee half of each with 50 baskets
out of 100; for example, one basket with just one apple in it, and the
remaining 99 with one lonely banana in each, would require 51. But
we can get 50 out of 99 in several ways.
For example, we could arrange the baskets by decreasing num-
ber of apples, then take basket 1, and from each pair (2,3), (4,5), ...,
(98,99) the basket with more bananas. This certainly gets at least half
the bananas since it gets at least half from baskets 2 through 99, plus
all in basket 1. And it gets at least half the apples since at worst it gets
all the apples from baskets 1, 3, 5, 7, etc. and basket k has as many
apples as basket k+1.
(Note that this algorithm uses only order information about the
numbers of apples or bananas in baskets, not the actual amount.)
Another way to do it is to space the baskets equally around a circle,
in any order. Now consider the 99 different “arc sets” you get by tak-
ing 50 baskets in a contiguous arc from the circle. We claim that most
(i.e., at least 50) of the arc sets contain at least half the apples. Why?
if they didn’t, then more than half of the complements of the arc sets
would contain more than half of the apples. But the complements are
arc sets of size 49, and each of those can be thought of as a subset of
a different arc set of size 50 (say, the one you get by adding the next
basket clockwise). Thus, if most of the 49-ers contained more than
half the apples, the same must be true of the 50’s, a contradiction.
But if at least 50 of the size-50 arc sets contain at least half the
apples, and (by a similar argument) at least 50 of them contain at
least half the bananas, then at least one arc set contains at least half
of both fruits.
It’s worth noting that this proof shows that even if the baskets are
arbitrarily numbered, there is a list of just 99 of the 5 × 1028 subsets
of size 50, one of which is guaranteed to have the desired property.
It’s even more instructive to wonder if the circular arrangement of the
baskets on the plane allows a straight-line cut, possibly right through
the middle of two baskets and through some apples and bananas, that
cuts the fruits exactly in two. If so, there are at most 48 baskets on one
side or the other of the cut to which we can add the cut baskets to get
50 with at least half of each fruit. And this is the kind of thing we need
to solve the problem when there are three (or more) types of fruit.
38
Intermediate Math
Of the many theorems that employ IVT in their proofs, the most
famous is the Mean Value Theorem of calculus, which says essentially
that if you drive 60 miles in an hour then there must have been a
moment when your speed was exactly 60 miles per hour. But we’re
avoiding calculus in this book and we don’t need it here: A simple
theorem about polynomials (simple compared to some of the above
puzzles, for sure!) will do.
For us a “polynomial in the variable x” is an expression p(x) of
the form a0 + a1 x + a2 x2 + · · · + ad xd where d is a non-negative
integer, the coefficients ai are real numbers, and ad is not zero. The
“degree” of p(x) is d, the exponent of the highest power of x having
nonzero coefficient.
Theorem. If a polynomial p(x) has odd degree, then it has a real root, that
is, there is a real number r such that p(r) = 0.
39
Mathematical Puzzles
Similarly,
This tells us a little more than the theorem, namely, that p(x) has
a root in the union of the intervals [−a, a] and [−1, 1], where a =
(|a0 | + |a1 | + · · · + |ad−1 |)/|ad |.
40
4. Graphography
Among the simplest of mathematical abstractions is the one which
models objects with points (called “nodes” or “vertices”) and indi-
cates some relationship between a pair of nodes by the presence of a
line (called an “edge”) from one to the other. Such a structure is called
a graph, not be confused with the graph of a function like y = x2 − 4.
A graph is said to be connected if you can get from any node to any
other by following a path of edges. It’s not hard to see that you need
at least n−1 edges to connect n nodes; three ways to do that with five
nodes are shown in Fig below:
41
Mathematical Puzzles
42
Graphography
Spiders on a Cube
Three spiders are trying to catch an ant. All are constrained to the
edges of a cube. Each spider can move one third as fast as the ant can.
Can the spiders catch the ant?
Solution: If our protagonists were on a tree, then one spider—even
a super-slow old codger—could catch the ant by himself, just by mov-
ing steadily toward the ant. With no cycles to dash around, the ant is
doomed.
We take advantage of this idea by using two of our three spiders to
“patrol” one edge each, thereby reducing the edge-graph of the cube
to a tree. To patrol an edge P Q, a spider chases the ant off the edge if
necessary, then patrols the edge making sure he is at all times at most
1
3 the distance from P (respectively, Q) that the ant is. This is possible
since the distance from P to Q along the edges of the cube, if you are
not allowed to use the edge P Q, is three times the length of the edge.
If we choose for our two controlled edges two opposite edges (some
other choices are equally good), we find that with these edges—
including their endpoints—removed, the rest of the edge-network (in
black in the figure below) contains no cycles (so it’s just a collection
of trees). It follows that the third spider can simply chase the ant to
the end of a patrolled edge, where the ant will meet her sad fate.
In a graph, the number of edges ending at a particular node is
called the degree of the node. Since we’re not allowing edges from a
node to itself, or multiple edges between the same pair of nodes, the
degree of a node can never be more than the number of nodes in the
graph, minus one.
Handshakes at a Party
Nicholas and Alexandra went to a reception with ten other couples;
each person there shook hands with everyone he or she didn’t know.
43
Mathematical Puzzles
44
Graphography
Snake Game
Joan begins by marking any square of an n × n chessboard; Judy then
marks an orthogonally adjacent square. Thereafter, Joan and Judy
continue alternating, each marking a square adjacent to the last one
marked, creating a snake on the board. The first player unable to play
loses.
For which values of n does Joan have a winning strategy, and
when she does, what square does she begin at?
45
Mathematical Puzzles
46
Graphography
make the grid rigid. Notice, however, that they cannot be “just any-
where.”
The next figure shows an efficiently braced 3 × 3 grid and its cor-
responding graph. For practice, you might want to compute the total
number of ways to rigidify the 3 × 3 grid with the minimum number
(five) of braces. A theorem of graph theory (to the effect that every
connected graph has a connected subgraph, called a “spanning tree,”
with the minimum number of edges) tells us that if more than 2n−1
squares are braced and the grid is rigid, then there are ways to remove
all but 2n−1 of the braces and preserve rigidity.
47
Mathematical Puzzles
48
Graphography
Next you return to the west end, untie all pairs, and instead tie w2
to w3 , w4 to w5 , etc. until all but w1 and w50 are paired.
Finally you test pairs at the east end until, as before, you have
identified all the paired wire-ends. To continue the example, the new
pairs might include e12 and e15 , e29 and e2 , and e4 and e31 , with e40
and e8 as bachelors.
This simple procedure suffices to identify all the wires.
Observe that the one east-wire-end which was paired the first time
but not the second (in our example, this is e8 ) must belong to w1 . The
east-wire-end with which e8 was paired the first time (here, e31 ) must
therefore belong to w2 . But then, w3 must belong to the east-wire-
end to which e31 was paired the second time, namely e4 . Proceeding
in this fashion, you find that w4 belongs to e29 (e4 ’s mate on the first
round), w5 belongs to e2 (e29 ’s mate on the second round), and so
forth. Eventually the sequence will end with w50 belonging to e40 .
If the number of wires (say, n) had been odd, you’d have left only
wn out of the pairings the first time, and w1 the second time; the rest
works pretty much the same way.
49
Mathematical Puzzles
The figure shows four possible landscapes, with one monk’s path
shown as a solid line, the other as dashed. Below each landscape is the
corresponding graph. Note that, as in the last case, there may be de-
tached portions of the graph which the monks cannot access (without
breaking the common altitude rule).
50
Graphography
Worst Route
A postman has deliveries to make on a long street, to addresses 2,
3, 5, 7, 11, 13, 17, and 19. The distance between any two houses is
proportional to the difference of their addresses.
To minimize the distance traveled, the postman would of course
make his deliveries in increasing (or decreasing) order of address. But
our postman is overweight and would like to maximize the distance
traveled making these deliveries, so as to get the most exercise he can.
But he can’t just wander around town; to do his job properly he is
obligated to walk directly from each delivery to the next one.
In what order should he make his deliveries?
Solution: The “greedy algorithm” for maximizing the postman’s
distance would have him start at #2, go all the way to #19, then back
to #3, then to #17 and so forth, ending at #11. That would result in
total distance 17 + 16 + 14 + 12 + 8 + 6 + 4 = 77 units. Is this the best
he can do?
Here’s a useful way to look at the problem. Call the addresses A,
B, etc. up to H, in numerical order, and represent the trek from house
X to house Y by XY . No matter what the postman does, his trip can
be represented as a list of treks if the form AB, BC, CD, DE, EF ,
F G, and GH.
How many times can the postman perform the trek AB? At most
twice, once on his way to A and once back. A similar argument works
for GH. How about BC? That one he might be able to do four times:
to A and back (but not from B), and to B and back (not from A).
Continuing this reasoning, we see that the postman cannot possibly
do better than 2AB + 4BC + 6CD + 8DE + 6EF + 4F G + 2GH,
which adds up to 86 units in our puzzle.
Wait—the postman can’t actually do the EF trek eight times be-
cause he only makes seven trips between consecutive deliveries. So in
fact he can do no better than 2AB + 4BC + 6CD + 7DE + 6EF +
4F G + 2GH, which is 82 units in our puzzle. Can he achieve that
number?
Yes, he can, but only if he begins at D or E and ends at the other
one, after zigzagging between low-numbered houses (A, B, C, D) and
high (E, F, G, H). Example: D, H, C, G, B, F, A, E. There are 8×4×
3 × 3 × 2 × 2 × 1 × 1 = 1,152 ways to do this, and each one gives the
maximum possible length, 82 units.
The given addresses don’t matter a bit, nor even the number of
houses (provided that remains even). The reasoning above is quite
51
Mathematical Puzzles
general, the conclusion being that the postman should always (a) be-
gin at one of the middle two houses and end at the other, and (b)
zigzag between the lower-half addresses and the upper-half addresses.
For our theorem, let’s take another look at the Snake Game puzzle.
We can play that game on any graph G: The rules are that the players
alternate marking vertices, and after Player 1 (Joan) marks her first
vertex, every subsequent vertex must be unmarked and adjacent to
the vertex just marked by the opponent. The first player unable to
move loses.
The proof above that the second player wins on an 8 × 8 chess-
board actually shows that Player 2 wins on any graph with a perfect
matching, that is, a set of disjoint edges that cover all the vertices (as
the dominoes do on the chessboard).
In fact, when G has a perfect matching, Player 2 wins even when
Player 1 is allowed to flout the main rule of the game, marking any
(unmarked) vertex instead of one adjacent to Player 1’s last move!
The strategy is the same: Whenever Player 1 marks a vertex v, Player
2 simply marks the vertex on the other end of the matching edge that
covers v.
So you might think that having a perfect matching is a far stronger
condition than is needed to assure a win for Player 2 in the original
game. But no.
Theorem. With best play, Player 2 wins on G if and only if G has a perfect
matching.
Proof. We’ve already proved the “if ” part of the theorem, so let us
suppose that G does not have a perfect matching, with the intent of
providing a winning strategy for Player 1.
The key is to pick some maximum-size matching M , that is, some
collection of disjoint edges which is as large as possible. Since there
is no perfect matching, there will be some vertex u1 of G that’s not
in M , and we’ll let Player 1 start there. After that, Player 1 intends to
follow the “matching strategy” from above, playing the other end of
whatever matching edge Player 2 marks a vertex of. If Player 1 can
always do that, she of course will win, but how do we know she can
always do that? What if Player 2 marks a vertex that’s not in an edge
of M ?
Well, Player 2 can’t immediately do that, because her first play (say,
v1 ) must be adjacent to v0 . If v1 were not in the matching, the edge
(u1 , v1 ) could have been added to M to make a bigger matching—and
M was supposed to be as big as possible.
52
Graphography
And she can’t do it later, either. Suppose Player 1 has been able
to execute her matching strategy through her kth move, and now
must reply to Player 2’s kth move. The moves so far have been
u1 , v1 , u2 , v2 , . . . , uk , vk ; by assumption, all these vertices are distinct,
all the pairs (ui , vi ) are edges of G, and all the pairs (vi , ui+1 ) are not
only edges of G but also members of the matching M .
But now we claim that Player 2’s latest move, vk , belongs to an
edge of M . Why? Because if it didn’t, we could make M bigger
by replacing the k−1 edges (v1 , u2 ), (v2 , u3 ), . . . , (vk−1 , uk ) by the
k edges (u1 , v1 ), (u2 , v2 ), . . . , (uk , vk )—again contradicting the max-
imality of M .
So Player 1 is never stuck for a move, and the theorem is proved!
♡
53
5. Algebra Too
The single most useful technique for solving puzzles that ask for a
quantity is simply to assign a letter (x and n are popular choices) to
the quantity, write down what the puzzle tells you, and then solve
using algebra.
Our first example is simple, but people get it wrong all the time.
Solution: Did you say $1? Oops! Let x be the price of the bat, so the
price of the ball is x − $1. Then we have the equation x + (x − $1) =
$1.10, 2x = $2.10, x = $1.05.
Note that we could have assigned another variable (y, perhaps) to
the price of the ball, then solved two equations in two unknowns. If
you can avoid that by expressing new unknowns in terms of old ones,
you can save yourself a lot of trouble.
Two Runners
Two runners start together on a circular track, running at different
constant speeds. If they head in opposite directions they meet after a
minute; if they head in the same direction, they meet after an hour.
What is the ratio of their speeds?
55
Mathematical Puzzles
A classic:
Solution: First, we need to get a tail, since starting with odd run
of heads won’t help us. If that takes time x on average, then, since
flipping H doesn’t help, we have
1
x=1+ ·x
2
giving x = 2. Now we need an odd run of heads; say that takes time y
on average. If we flip another T (probability 12 ) or HH (probability 14 ),
we’ve made no further progress; if we flip HT (probability 14 ) we’re
done. Thus,
1 1 1
y= · (1 + y) + · (2 + y) + · 2 ,
2 4 4
giving y = 6. So in all it takes an average of x + y = 2 + 6 = 8 flips
to get that run.
Randomness enters into the next puzzle as well. This is a toughie
but the general technique is the same.
56
Algebra Too
57
Mathematical Puzzles
Area−perimeter Match
Find all integer-sided rectangles with equal area and perimeter.
Solution: There are two.
Let x and y be the sides, with x ≥ y. we need xy = 2x + 2y,
equivalently xy − 2x − 2y = 0, but the left-hand side of the latter
reminds us of the product (x−2)(y−2). Rewriting, (x−2)(y−2) = 4,
so either x−2 = y−2 = 2 or x−2 = 4 and y−2 = 1. This gives
x = y = 4, or x = 6 and y = 3.
The remaining puzzles involve algebra in other ways than solving
equations.
Three Negatives
A set of 1000 integers has the property that every member of the set
exceeds the sum of the rest. Show that the set includes at least three
negative numbers.
Solution: Let a and b be the only two negative numbers in the set,
and let the sum of all the numbers in the set be S. We are told that
a > S − a, and b > S − b; adding the two inequalities gives a + b >
2S − a − b, thus a + b > S which is impossible unless there are other
negative numbers in the set.
58
Algebra Too
Prove that the total length of George’s red lines is at least the length
of a side of the big square.
Solution: Why should this be true? Maybe each rectangle is long
and thin and its only red side is a short one. One thing we do know,
though, is that the total area of the rectangles is s2 , where s is the side
of the big square. If the rectangles are ri × b∑i , where each ri represents
a red side, then (using the convention that i xi means the sum of xi
for all salient i): ∑
ri bi = s2 .
i
Solution: It only takes two queries, and the first is needed only to
get a bound on the size of the polynomial’s coefficients. The Oracle’s
answer to x = 1 (say, n) tells you that no coefficient can exceed n.
Then you can send in x = n+1, and when you expand the Oracle’s
answer base n+1, you have the polynomial!
For example, suppose (rather conveniently) that p(1) < 10, so you
know every coefficient is an integer between 0 and 9. You then send
in the number 10 and if the oracle says p(10) = 3,867,709,884, you
know that the polynomial is
59
Mathematical Puzzles
Strength of Schedule
The 10 teams comprising the “Big 12” college football conference are
all scheduled to play one another in the upcoming season, after which
one will be declared conference champion. There are no ties, and each
60
Algebra Too
Two Round-robins
The Games Club’s 20 members played a round-robin checkers toura-
ment on Monday and a round-robin chess tournament on Tuesday.
In each tournament, a player scored 1 point for each other player he
or she beat, and half a point for each tie.
Suppose every player’s scores in the two tournaments differed by
at least 10. Show that in fact, the differences were all exactly 10.
61
Mathematical Puzzles
Solution: Let’s divide the club members into the good checkers
players (who scored higher in the checkers tournament) and the good
chess players. One of these groups must have at least 10 members;
suppose there are k ≥ 10 good chess players, and that they scored
a total of t ≥ 10k points higher in the chess tournament than in the
checkers tournament.
This difference must have come entirely at the expense of the
good checkers players, because the number of points scored by the
good chess players among ( ) themselves had to be the same in both
tournaments—namely, k2 , A.K.A. k(k−1)/2. Since there are k(20−
k) intergroup matches in each tournament, the most they can con-
tribute to t is k(20 − k). So we have 10k ≤ k(20 − k), k ≤ 10.
But k was supposed to be at least 10, so we conclude that k = 10
and that all of the above inequalities must be equalities.
In particular, since t = 10k every chess player scored exactly 10
points higher in the chess tournament than in the checkers tourna-
ment. Moreover, since t = k(20 − k), every intergroup match in the
chess tournament must have been won by the good chess player, and
in the checkers tournament, by the good checkers player.
Alternative Dice
Can you design two different dice so that their sums behave just like
a pair of ordinary dice? That is, there must be two ways to roll a 3,
6 ways to roll a 7, one way to roll a 12, and so forth. Each die must
have six sides, and each side must be labeled with a positive integer.
Solution: The unique answer is that the labelings of the two dice
are {1, 3, 4, 5, 6, 8} and {1, 2, 2, 3, 3, 4}.
62
Algebra Too
Perhaps you came up with this answer by trial and error, which is
a perfectly fine way of solving the problem. However, there is another
way in this case, involving a simple example of a powerful mathemat-
ical tool called generating functions.
The idea is to represent a die by a polynomial in the variable x, in
which the coefficient of the term xk represents the number of appear-
ances of the number k on the die. Thus, for example, an ordinary die
would be represented by the polynomial f (x) = x + x2 + x3 + x4 +
x5 + x 6 .
The key observation is that the result of rolling two (or more) dice
is represented by the product of their polynomials. For instance, if we
roll two ordinary dice, the coefficient of x10 in the product (namely,
f (x)2 ) is exactly the number of ways of picking two terms from f (x)
whose product is x10 . These ways are x4 · x6 , x5 · x5 , and x6 · x4 ; and
these represent the three ways to roll a sum of 10.
It follows that if g(x) and h(x) are the polynomials representing
our alternative dice, then g(x) · h(x) = f (x)2 . Now, polynomials,
like numbers, have unique prime factorizations; the polynomial f (x)
factors as x(x + 1)(x2 + x + 1)(x2 − x + 1). To get g(x) and h(x) to
multiply out to f (x)2 , we need to take each of these four factors and
assign either one copy to each of g(x) and h(x), or two copies to one
and none to the other. But there are some constraints: In particular,
we can’t have a non-zero constant term in g(x) or h(x) (which would
represent some sides labeled “0”) or any negative coefficient, and the
coefficients must sum to 6 since we have six sides to label.
The only way to do this (other than g(x) = h(x) = f (x)) is to
have
g(x) = x(x + 1)(x2 + x + 1)(x2 + x − 1)2 = x + x3 + x4 + x5 + x6 + x8
and
h(x) = x(x + 1)(x2 + x + 1) = x + 2x2 + 2x3 + x4 ,
or vice-versa.
This may seem a bit like trial and error after all, but with this tech-
nique you can solve problems that are much more complex than this
one. To begin with, you can invent alternatives for a pair of 8-sided
dice labeled 1 through 8 (there are three new ways to do it), or for
rolling three ordinary dice (many ways).
It will not be a surprise to readers that thousands, literally, of the-
orems have been proved using algebra. Here’s one that uses just the
elementary sort of algebra we have seen above.
63
Mathematical Puzzles
Have you ever wondered: What is the probability that your fam-
ily surname will die out? Francis Galton posed this question in 1873
and an answer posted by the Reverend Henry William Watson led
to a joint paper. Galton was interested in the longevity of aristo-
cratic names, but he could (in more modern times) have been thinking
equivalently of the preservation of a Y-chromosome.
In Galton and Watson’s model of propagation, each individual
independently has a random number of offspring, given by a fixed
probability distribution: i offspring with probability pi . (In the case of
tracking patrilineal surnames, we would count only male offspring.)
We wish to know: Starting with (say) one individual, what is the
“extinction” probability x that the family name dies out? Of course
this depends on the probability distribution; as you might expect, if
the average number of offspring
∞
∑
µ= ipi
i=0
is less than 1, then the name will always die out, but if it’s greater
than 1, the name might live on forever. In the latter case, how do you
determine x?
as claimed. ♡
64
Algebra Too
65
6. Safety in Numbers
Numbers are everywhere, and endlessly fascinating. You probably
know that every positive integer can be expressed uniquely as the
product of primes (a prime number being one that cannot be divided
evenly by anything except itself and 1). Let’s use that and some other
elementary observations to solve some puzzles, shall we?
Broken ATM
George owns only $500, all in a bank account. He needs cash badly
but his only option is a broken ATM that can process only with-
drawals of exactly $300, and deposits of exactly $198. How much cash
can George get out of his account?
Solution: These puzzles can all be tackled the same way. The idea
is to try to cover the numbers from 1 to 30 by bunches of numbers with
the property that from each bunch, you can only take one number for
inclusion in your subset. Then, if you can construct a subset that con-
sists of one choice from each bunch, you have yourself a maximum-
sized subset.
67
Mathematical Puzzles
In the first case, fix any number k which is square-free (in other
words, its prime factorization contains at most one copy of each
prime). Now look at the set Sk you get by multiplying k by all possible
perfect squares.
If you take two numbers, say kx2 and ky 2 , from Sk , then their
product is k 2 x2 y 2 = (kxy)2 so they can’t both be in our subset. On
the other hand, two numbers from different Sk ’s cannot have a square
product since one of the two k’s will have a prime factor not found in
the other, and that factor will appear an odd number of times in the
product.
Now, every number is in just one of these sets Sk —given n, you can
recover the k for which n ∈ Sk by multiplying together one copy of
each prime that appears with an odd exponent in the factorization of
n. Between 1 and 30, the choices for k (i.e., the square-free numbers)
are 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 2×3, 2×5, 2×7, 2×9, 2×11,
2×13, 3×5, 3×7, and finally 2×3×5: 20 in all. You can choose each k
itself as the representative from Sk , so a subset of size 20 is achievable
and best possible.
To avoid one number dividing another evenly, note that if you fix
an odd number j, then in the bunch Bj = {j, 2j, 4j, 8j, . . . }—that is,
j times the powers of 2—you can only take one. If you take for your
subset the top half of the numbers from 1 to 30, namely 16 through
30, you have got one from each Bj , and of course no member of this
subset divides another evenly since their ratios are all less than 2. So
the 15 numbers you get this way is best possible.
Finally, to get a maximum-sized subset all of whose members are
relatively prime, you naturally want to look at bunches consisting of
all multiples of a fixed prime p. You can take p itself as the repre-
sentative of its bunch, so you can do no better than to take as your
subset all the primes below 30, plus the number 1 itself, for a total of
11 members. ♡
68
Safety in Numbers
in advance and knew what they were. But she still had to pick the
ranks of those cards carefully (and memorize their suits), so that from
the sum she could always recover the ranks.
In conclusion, if you want to do the trick yourself, you need to find
five distinct numbers between 1 and 13 (inclusive), with the property
that every subset has a different sum. Can you do it?
Solution: If only you had a card worth 16, you’d be in fine shape:
The powers of two, in particular 1, 2, 4, 8, and 16, have the desired
property. In fact when you write a number in binary, the positions of
the ones tell you exactly which powers go into the sum. For example,
suppose that your victim reports a sum of 13; in binary that’s 1101,
thus 8 + 4 + 1, so his cards must consist of an eight, a four, and an
ace.
There are 25 = 32 ways to choose a subset of the five cards (if
you include the null set, which has sum 0). Can we get them all to be
different, without having a number bigger than 13?
The first thing to realize is that big numbers are better: It’s easier
to tell whether a big-numbered card was chosen or not. So let’s try
making our set using the greedy algorithm: Start with the king and
throw in the biggest cards possible without causing the same sum to
come up twice.
If you do that you’ll end up with K, Q, J, 9, 6; and that works! (It
turns out there’s only one other way to do it, the same cards but with
the 9 replaced by a 3).
What about suits? I recommend 6 of spades, 9 of diamonds, jack
of clubs, queen of hearts and king of spades. But pick anything that
looks random and that you can remember. Then practice (including
that fake riffle shuffle), and you’ll be the life of the party. Read Colm
Mulcahy’s book (see Notes & Sources) for more great mathematical
card tricks!
69
Mathematical Puzzles
Divisibility Game
Alice chooses a whole number bigger than 100 and writes it down
secretly. Bob now guesses a number greater than 1, say k; if k di-
vides Alice’s number, Bob wins. Otherwise k is subtracted from Al-
ice’s number and Bob tries again, but may not use a number he used
before. This continues until either Bob succeeds by finding a num-
ber that divides Alice’s, in which case Bob wins, or Alice’s number
becomes 0 or negative, in which case Alice wins.
Does Bob have a winning strategy for this game?
Solution: The key is that there are enough small numbers around
so that by judicious use of them, Bob can find a divisor of Alice’s num-
ber. For example, Bob wins using 2, 3, 4, 6, 16, 12 (or 6, 4, 3, 2, 5, 12 or
others). To see this, we consider the possibilities for Alice’s number
modulo 12; in other words, the remainder when Alice’s number (let’s
call it A) is divided by 12.
Using the suggested sequence 2, 3, 4, 6, 16, 12, Alice is immedi-
ately lost if her number is even, that is, if A ≡ 0, 2, 4, 6, 8, or 10 mod-
ulo 12. If A ≡ 5 or 11 mod 12, it will be 3 or 9 mod 12 after 2 is
subtracted, allowing Bob to win on his second turn. If A ≡ 1 or 9,
Alice will succumb at turn 3; if A ≡ 3, at turn 4. The only value mod
12 that Alice can start with that has survived so far is 1, which after
2, 3, 4, and 6 have been subtracted, is now 4 modulo 12. Subtracting
16 knocks that down to 0 modulo 12, and now Bob’s 12 spells doom
for Alice. Of course, we must check that Bob’s guesses add up to at
most 100, and they do (2 + 3 + 4 + 6 + 16 + 12 = 43).
Prime Test
Does 49 + 610 + 320 happen to be a prime number?
Solution: Since the number is (29 )2 + 2 · 29 · 310 + (310 )2 = (29 +
310 )2 , it is a perfect square (so, it’s not prime). If you guessed correctly
that the number was composite but tried to prove it by finding a small
prime factor, you were in for a tough time, because 29 + 310 itself is
prime—so our number has no prime factor less than 59,561.
Yes, it is easy to forget that finding a divisor is not the only way to
show a number is composite. Showing that it is a square (or a cube,
etc.) is another; other, more sophisticated ways exist as well.
70
Safety in Numbers
Numbers on Foreheads
Each of 10 prisoners will have a digit between 0 and 9 painted on his
forehead (they could be all 2’s, for example). At the appointed time
each will be exposed to all the others, then taken aside and asked to
guess his own digit.
In order to avoid mass execution, at least one prisoner must guess
correctly. The prisoners have an opportunity to conspire beforehand;
find a scheme by means of which they can ensure success.
Solution: First, we claim that if the sides of a tile are not commen-
surable (i.e., if their ratio is irrational) then a much stronger state-
71
Mathematical Puzzles
ment holds: Any tiling of any rectangle either has all tiles horizontal
or all vertical. To see this, assume otherwise and draw a horizontal
line across the square at the top, and imagine moving it downwards.
Suppose that just below the top border of the square, our line cuts
a tiles vertically and b horizontally. Then, except when it coincides
with some tile boundary, our line must always cut a tiles vertically
and b horizontally; for otherwise, if the tiles are x × y, we would have
ax + by = cx + dy for (a, b) ̸= (c, d), giving x/y = (b − d)/(a − c), a
rational ratio.
If a or b is zero all the tiles are oriented the same way and we are
done. If the parts of our line that cross tiles vertically never change,
then the height of the big rectangle is both a multiple of x and of y, an
impossibility. Thus somewhere our line reaches a point where some
vertical crossings switch to horizontal while simultaneously some
horizontal crossings switch to vertical, but that again is impossible
because the distance from the top of the big rectangle to the place
where this happens would then be a multiple of both x and y.
If the ratio of the sides of a tile is rational, we may as well assume
the sides have integer lengths a and b, and that the tiled square C is
c × c. If there is no horizontal tiling, a and b do not both divide c. We
may as well suppose that a does not divide c, and write c = ma + r,
where 0 < r < a.
We want to show that in this case there is no tiling at all. For
example, there can’t be any tiling of a 10×10 square by 4×1 rectangles.
We cover C with a grid of c2 unit squares S(i, j), numbered as in
a matrix by pairs i, j, 1 ≤ i ≤ c, 1 ≤ j ≤ c. We now color all the
squares S(i, j) for which i − j ≡ 0 mod a.
This colors all c unit squares on the main diagonal, plus all the
squares on other diagonals a multiple of a diagonals away from the
main diagonal; and it colors every ath square along each row or col-
umn. As a consequence, suppose R is any rectangle carved out of the
grid. If either R’s height or R’s width is a multiple of a (or both) then
R is “balanced,” in the sense that the colored squares in R comprise
exactly the fraction 1/a of all the unit squares in R.
Thus the c × ma rectangle U containing S(1, 1) is balanced, as are
also the ma × c rectangle V containing S(1, 1) and their intersection,
the ma × ma square W again containing S(1, 1). Let L be the little
r ×r square containing S(c, c), that is, diagonally opposite the S(1, 1)
corner.
The figure shows the a = 4, c = 10 case, with the rectangles U
and V (and thus also the square W ) outlined in heavy black.
72
Safety in Numbers
Locker Doors
Lockers numbered 1 to 100 stand in a row in the main hallway of
Euclid Junior High School. The first student arrives and opens all the
lockers. The second student then goes through and re-closes lockers
numbered 2, 4, 6, etc.; the third student changes the state of every
locker whose number is a multiple of 3, then the next every multiple
of 4, etc., until the last student opens or closes only locker number
100.
After the 100 students have passed through, which lockers are
open?
Solution: The state of locker n is changed when the kth student
passes through, for every divisor k of n. Here, we make use of the fact
that divisors usually come in pairs {j, k} where j · k = n (including
the pair {1,n}); so the net effect of students j and k on this locker is
nil. The exception is when n is a perfect square,
√ in which case there
is no other divisor to cancel the effect of the nth student; therefore,
the lockers which are open at the end are exactly the perfect squares,
1, 4, 9, 16, 25, 36, 49, 64, 81, and 100. ♡
73
Mathematical Puzzles
For the next puzzle you might like to know a certain handy rhyme,
attributed to the mathematician Nathan Fine but inspired by a lovely
proof by the great, late Paul Erdős:
Factorial Coincidence
Suppose that a, b, c, and d are positive integers, all different, all greater
than one. Can it be that a!b = c!d ?
Solution: Assume that such numbers exist, say with a < c, thus
b > d. Then c > 2, and by Bertrand’s Postulate, there is a prime p with
c/2 < p < c. This p appears exactly d times in the prime factorization
of c!d but either b times or not at all in the prime factorization of a!b .
The contradiction shows that the desired quartet (a, b, c, d) does not
exist.
Even Split
Prove that from every set of 2n integers, you can choose a subset of
size n whose sum is divisible by n.
Solution: Call a set “flat” if it sums to 0 modulo n. Let us note first
that the statement we want to prove implies the following seemingly
weaker statement: If S is a flat set of 2n numbers, then S can be split
into two flat sets of size n. However, that in turn implies that any set
of only 2n − 1 numbers contains a flat subset of size n because we
can add a 2nth number to make the original set flat, then apply the
previous statement to split this into two flat subsets of size n. One of
these (the one without the new number) will do the trick.
So all three of these statements are equivalent. Suppose we can
prove the second for n = a and for n = b. Then if a set S of size
2n = 2ab sums to 0 mod ab, it is, in particular, flat with respect to a,
and we can peel off subsets S1 , . . . , S2b of size a which are also flat
with respect to a. Each of these subsets Si has a sum we can write in
the form abi . The numbers bi now constitute a set of size 2b which
sums to 0 mod b, so we can split them into two sets of size b which
74
Safety in Numbers
are flat with respect to b. The unions of the sets Si in each part are a
bipartition of the original S into sets of size ab which are ab-flat, just
what we wanted.
It follows that if we can prove the statement for n = p prime, then
we have it for all n. Let S be a set of size 2p, with the idea of creating
a p-flat subset of size p.
How can we create such a subset? One natural possibility is to
pair up the elements of S and choose one element from each pair. Of
course, if we do that, it will behoove us to ensure that the elements in
each pair are different mod p, so our choice will not be of Hobson’s
variety. Can we do that?
Yes, order the elements of S modulo p (say, 0 through p−1) and
consider the pairs (xi , xi+p ) for i = 1, 2, . . . , p. If xi were equivalent
to xi+p mod p for some i, then xi , xi+1 , . . . , xi+p would all be equiv-
alent mod p and we could take p of them to make our desired subset.
Now that we have our pairs, we proceed by “dynamic program-
ming.” Let Ak be the set of all sums (mod p) obtainable by adding one
number from each of the first k pairs. Then |A1 | = 2 and we claim
|Ak+1 | ≥ |Ak |, and moreover, |Ak+1 | > |Ak | as long as |Ak | ̸= p. This
is because Ak+1 = (Ak +xk+1 )∪(Ak +xk+1+p ); thus if |Ak+1 | = |Ak |,
these two sets are identical, implying Ak = Ak + (xk+1+p − xk+1 ).
This is impossible since p is prime and xk+1+p − xk+1 ̸≡ 0 mod p,
unless |Ak | = 0 or p.
Since there are p pairs, we must eventually have |Ak | = p for some
k ≤ p, hence |Ap | = p and, in particular, 0 ∈ Ap . The statement of
the puzzle follows. ♡
75
Mathematical Puzzles
In fact, we could pair up all the terms and write N in the following
form: 100 · 99!2 · 98 · 97!2 · 96 · 95!2 · · · · · 4 · 3!2 · 2 · 1!2 , which is a
perfect square times the number M = 100 · 98 · 96 · · · · · 4 · 2. But
we can rewrite M as 250 · 50 · 49 · 48 · · · · · 2 · 1 = (225 )2 · 50!.
So N is the product of a lot of perfect squares and the number 50!.
It follows that if we remove the 50! term from N , we’re down to a
perfect square. ♡
√
It’s time for our theorem. You probably know that 2 is irrational,
that is, it cannot be written as a fraction a/b for any integers a or b.
You might even √ know a proof, something like this:
Suppose 2 is a fraction, and write that fraction in lowest terms
as a/b. Then 2 = a2 /b2 , and therefore a2 = 2b2 , thus a2 is even and
so must be a; write a = 2k. Then b2 = 2k 2 so b is also even, but this
contradicts the assumption that a/b is in lowest terms.
√
Theorem. For any positive integer n, n is either an integer or irrational.
76
7. The Law of Small
Numbers
It sounds silly, but many otherwise-very-smart people, given a puz-
zle with numbers in it, treat those numbers as if underlined in a sa-
cred text. This is math—you’re allowed to change the numbers and
see what happens! If the numbers in a puzzle are dauntingly large,
replace them with small ones. How small? As small as possible, with-
out making the puzzle trivial; if that doesn’t give you enough insight,
make them gradually bigger.
Domino Task
An 8 × 8 chessboard is tiled arbitrarily with 32 2 × 1 dominoes. A
new square is added to the right-hand side of the board, making the
top row length 9.
At any time you may move a domino from its current position
to a new one, provided that after the domino is lifted, there are two
adjacent empty squares to receive it.
Can you retile the augmented board so that all the dominoes are
horizontal?
77
Mathematical Puzzles
Now it’s easy to shift the snake tiles one at a time, beginning with
the rightmost one on the bottom row, to create a horizontal tiling.
How to find this curious two-part algorithm? Try the problem first
on a 4 × 4 board!
Spinning Switches
Four identical, unlabeled switches are wired in series to a light bulb.
The switches are simple buttons whose state cannot be directly ob-
served, but can be changed by pushing; they are mounted on the
corners of a rotatable square. At any point, you may push, simul-
taneously, any subset of the buttons, but then an adversary spins the
square. Is there an algorithm that will enable you to turn on the bulb
in at most a fixed number of spins?
78
The Law of Small Numbers
two neighboring switches, say N and E, then going back through your
three-move two-button solution. Then you’re fine if both pairs were
mismatched. If not, push just one button; that’ll either make both op-
posite pairs match, or both mismatch. Run through the two-button
solution a third time. If bulb is still off, push N and E again and now
you know both opposite pairs match, and a fourth application of the
two-button solution will get that bulb turned on.
In conclusion, pushing buttons NESW, NS, NESW, NE, NESW,
NS, NESW, N, NESW, NS, NESW, NE, NESW, NS, NESW, will at
some point turn the light on—15 operations. No sequence of fewer
than 15 operations can be guaranteed to work because there are 24 =
16 possible states for the four switches, and they all must be tested;
you get to test one state (the starting state) for free.
Seeing the solution for four buttons, you can generalize to the case
where the number of buttons is any power of two; if there are 2k but-
k
tons, the solution will take, and require, 22 −1 steps. (When there
are n buttons, they are located at the corners of a spinnable regular
n-gon.)
The puzzle is insoluble when the number of buttons, n, is not a
power of 2. Let’s just prove that for three buttons, no fixed number of
operations can guarantee to get that bulb on. (For general n, write n
as m · 2k for some odd number m > 1; it is m which plays the role of
3 in what follows.)
You may as well assume the switches are spun before you even
make your first move. Suppose that before they are spun, the switches
are not all in the same state. Then it is easy to check that no matter what
move you planned, if you were unlucky with the spin, then after the spin
and your move, the switches will still not all be in the same state.
It follows that you can never be sure that you have ever had all
the switches in the same state, so no fixed sequence of moves can
guarantee to light the bulb. It’s curious that you can solve the problem
for 32 buttons (albeit in about 136 years, at one second per operation),
but not for just three buttons.
Candles on a Cake
It’s Joanna’s 18th birthday and her cake is cylindrical with 18 candles
on its 18′′ circumference. The length of any arc (in inches) between
two candles is greater than the number of candles on the arc, exclud-
ing the candles at the ends.
79
Mathematical Puzzles
Prove that Joanna’s cake can be cut into 18 equal wedges with a
candle on each piece.
Solution: The conditions give some assurance that the candles are
fairly evenly spaced; one way to say that is that as we move around
the circumference from some fixed origin 0, the number of candles
we encounter is not far from the distance we have traveled. Accord-
ingly, let ai be the arc-distance from 0 to the ith candle, numbered
counterclockwise, and let di = ai − i.
We claim that for any i and j, di and dj differ by less than 1.
We may assume i < j; suppose, for instance, that dj − di ≤ −1.
Then j − i − 1 ≥ aj − ai , but j − i − 1 is the number of candles
between i and j, contradicting the condition. Similarly, if dj − di ≥ 1,
then di − dj ≤ −1 and the same argument applies to the other arc,
counterclockwise from j to i.
So the “discrepancies” di all lie in some interval of length less than
1. Let dk be the smallest of these, and let ε be some number between 0
and dk , so that all the di ’s lie strictly between ε and 1 + ε. Now cutting
the cake at ε, ε + 1, etc. gives the desired result.
How are you supposed to find this proof ? By trying two candles,
then three, instead of eighteen.
80
The Law of Small Numbers
Flying Saucers
A fleet of saucers from planet Xylofon has been sent to bring back
the inhabitants of a certain randomly-selected house, for exhibition in
the Xylofon Xoo. The house happens to contain five men and eight
women, to be beamed up randomly one at a time.
81
Mathematical Puzzles
the man will be last to be beamed up. Putting the cases together, we get
probably 12 that the last person beamed up is a woman. Is it possible
that 12 is the answer no matter how many men and women are present,
as long as there’s at least one of each?
Looking more closely at the above analysis, it seems that the sex of
the last person beamed up is determined by the next-to-last saucer—the
one that reduces the house to one sex. To see why this is so, it is useful
to imagine that the Xylofonian acquisition process operates the fol-
lowing way: Each time a flying saucer arrives, the current inhabitants
of the house arrange themselves in a uniformly random permutation,
from which they are beamed up left to right.
For example, if the inhabitants at one saucer’s arrival consist of
males m1 and m3 and females f2 , f3 , and f5 , and they arrange them-
selves “f3 , f5 , m2 , f2 , m3 ,” then the saucer will beam up f3 , f5 , and
m2 , then will beam m3 back down again and take off with just the
females f3 and f5 . The remaining folks, m3 , m2 , and f2 will now
re-permute themselves in anticipation of the next saucer’s arrival.
We see that a saucer will be the next to last just when the per-
mutation it encounters consists of all men followed by all women,
or all women followed by all men. But no matter how many of each
sex are in the house at this point, these two events are equally likely!
Why? Because if we simply reverse the order of a such a permutation,
we go from all-men-then-all-women to all-women-then-all-men, and
vice-versa.
There’s just one more observation to make: If both men and
women are present initially, then one saucer will never do, thus there
always will be a next-to-last saucer. When that comes—even though
82
The Law of Small Numbers
Gasoline Crisis
You need to make a long circular automobile trip during a gasoline
crisis. Inquiries have ascertained that the gas stations along the route
contain just enough fuel to make it all the way around. If you have an
empty tank but can start at a station of your choice, can you complete
a clockwise round trip?
Solution: Let us observe first that if we double the radius (say, from
1′′ to 2′′ ) of each of the original coins, the result will be to cover the
whole table. Why? Well, if a point P isn’t covered, it must be 2′′ or
more from any coin center, thus a (small) coin placed with its center
at P would have fit into the original configuration. (See the first two
figures below for an example of an original configuration, and what
happens when the coins are expanded.)
Now, if we could replace each big coin by four small ones that
cover the same area, we’d be done—but we can’t.
But rectangles do have the property that they can be partitioned
into four copies of themselves. So, let us shrink the whole picture (of
big coins covering the table) by a factor of two in each dimension, and
use four copies (as in the next figure) of the new picture to cover the
original table!
83
Mathematical Puzzles
84
The Law of Small Numbers
Each coin then has radius 1 and thus area π. If the floor has area
A then,√ignoring boundary √ effects, the total area of the coins will be
πA/(3 3/2) = 2πA/(3 3).
Now, how thinly can we cover the floor without being able to add
a non-overlapping coin? Let us use the same tiling, but this time we
cover only every third tile (see next figure); and we cover it not with a
circumscribed circle, but a coin placed over the center of the hexagon
which is just a teensy bit bigger than the inscribed circle. This just barely
prevents us from adding any more coins; how much is the coin area
now?
Well, the coin radius is a tiny bit bigger than the altitude of √ one
of the six equilateral triangles making up√ a hexagon—namely, 3/2.
Hence the coin area just exceeds π × ( 3/2)2 = 3π/4.
It follows that the total
√coin area on the √ floor is as close as we like
to (1/3) × (3π/4) × A/(3 3/2) = πA/(6 3), one-fourth of what we
had before!
The result of all this is that we have proved not only the statement
of the puzzle, but two not-so-easy extremal properties of disks in the
85
Mathematical Puzzles
plane. The first says that there is no better way to cover the plane by
unit disks than by circumscribing the tiles in a hexagonal tiling, as
we did above; the second says that there is no more efficient way to
prevent the addition of a non-overlapping unit disk than by centering
on every third hexagonal tile a disk slightly bigger than the inscribed
disk, again as we did above.
If you think these properties are obvious to begin with, consider
the (seemingly) even more obvious fact that the densest way to pack
unit disks in the plane is to use an inscribed disk in each hexagon.
This was not rigorously proved until the great Hungarian geometer
László Fejes Tóth (1915–2005) did it in 1972!
Coins in a Row
On a table is a row of 50 coins, of various denominations. Alix picks a
coin from one of the ends and puts it in her pocket; then Bert chooses
a coin from one of the (remaining) ends, and the alternation continues
until Bert pockets the last coin.
Prove that Alix can play so as to guarantee at least as much money
as Bert.
Solution: This puzzle resists the most obvious approaches. It’s easy
to check that Alix could do quite badly by always choosing the most
valuable coin, or the coin that exposes the less valuable coin to Bert,
or any combination of these. Basically, if she only looks a move or
two ahead, she’s in trouble.
In fact, for Alix to play optimally, she needs to analyze all the pos-
sible situations that may later arise. This can be done by a technique
called “dynamic programming.”
86
The Law of Small Numbers
But we were not asked to provide an optimal strategy for Alix, just
a strategy that guarantees her at least half the money. Experimenting
with 4 or 6 coins instead of 50 might lead you to the following key
observation.
Suppose the coins alternate quarter, penny, quarter, penny, and so
forth, ending (since 50 is even) in a penny. Then Alix can get all the
quarters! In fact, no matter what the coins are, if we number the coins
from 1 to 50 left to right, Alix can take all the odd-numbered ones—or
all the even-numbered ones.
But wait a minute—one of those two groups of coins must contain
at least half the money! ♡
Powers of Roots
√ √
What is the first digit after the decimal point in the number ( 2+ 3)
to the billionth power?
√ √
Solution: If you try entering ( 2 + 3)1,000,000,000 in your com-
puter, you’re likely to find that you get only the dozen or so most
significant figures; that is, you don’t get an accurate enough answer
to see what happens after the decimal point.
But you can try smaller powers √ and√see what happens. For exam-
ple, the decimal expansion of ( 2 + 3)10 begins 95049.9999895. √ √
A bit of experimentation shows that each even power of ( 2 + 3)
seems to be just √ a hair
√ below some integer. Why? And by how much?
√ Let’s
2
√ try2 ( 2 + 3) , which is about √ 9.9. If√we play with 10 −
( 2 + 3) √ we √ discover
√ that√it’s equal to ( 3 − 2)2 . Aha!
Yes, ( 3+ 2)2n +( 3− 2)2n is always an integer, because when
you expand it, the odd binomial√ coefficients
√ 2n cancel and the even ones
are integers. But of course ( √ 3− √ 2) is very small, about 10−n , so
the first roughly n digits of ( 3 + 2)2n after the decimal point are
all 9’s.
Coconut Classic
Five men and a monkey, marooned on an island, collect a pile of
coconuts to be divided equally the next morning. During the night,
however, one of the men decides he’d rather take his share now. He
tosses one coconut to the monkey and removes exactly 15 of the re-
maining coconuts for himself. A second man does the same thing,
then a third, fourth, and fifth.
87
Mathematical Puzzles
The following morning the men wake up together, toss one more
coconut to the monkey, and divide the rest equally. What’s the least
original number of coconuts needed to make this whole scenario pos-
sible?
Solution: You can solve this by considering two men instead of five,
then three, then guessing. But the following argument is irresistible,
once found.
There’s an elegant “solution” to the puzzle if you allow negative
numbers of coconuts(!). The original pile has −4 coconuts; when the
first man tosses the monkey a coconut, the pile is down to −5 but
when he “takes” 15 of this he is actually adding a coconut, restoring
the pile to −4 coconuts. Continuing this way, come morning there
are still −4 coconuts; the monkey takes one and the men split up the
remaining −5.
It’s not obvious that this observation does us any good, but let’s
consider what happens if there is no monkey; each man just takes 15
of the pile he encounters, and in the morning there’s a multiple of 5
coconuts left that the men can split. Since each man has reduced the
pile by the fraction 45 , the original number of coconuts must have been
a multiple of 56 (which shrinks to 45 · 5 by morning).
All we need to do now is add our two pseudo-solutions, by starting
with 56 − 4 = 15,621 coconuts. Then the pile reduces successively to
4·55 −4 coconuts, 42 ·54 −4, 43 ·53 −4, 44 ·52 −4, and 45 ·5−4. When
the monkey gets his morning coconut, we have 45 · 5 − 5 coconuts,
a multiple of 5, for the men to split. This is best possible because we
needed 55 ·k −4 coconuts to start with, just to have an integer number
come morning, and to get 45 · k − 5 to be a multiple of 5 we needed
k to be a multiple of 5.
Theorem. For any even positive integer n there is a set of pairings (“perfect
matchings”) of the numbers {1, 2, . . . , n} such that every pair {i, j} appears
in exactly one pairing.
88
The Law of Small Numbers
Since n−1 is odd, all the radii from n to other students are at dif-
ferent angles; it follows that no two students are paired
( ) twice, and
since the eventual number of pairs is (n−1) × n/2 = n2 , every pair
is accounted for. ♡
89
8. Weighs and Means
You know how to compute the average of a set of numbers
x̄ := (x1 + x2 + · · · + xn )/n
x̄ := (w1 x1 + w2 x2 + · · · + wn xn )/(w1 + · · · + wn ).
Often the weights already sum to 1, so you can skip the dividing. That
happens, for example, when the wi ’s constitute a probability distribu-
tion, in which case x̄ becomes the expected value of the xi ’s. (Much
more about expectation is coming in a later chapter.)
The following puzzle is fairly typical of those in which the above
theorem can come in handy.
91
Mathematical Puzzles
92
Weighs and Means
93
Mathematical Puzzles
94
Weighs and Means
Solution: It’s a bit curious that we are asked for a dollar amount
when no quantity of money is specified in the puzzle, but let’s plunge
in anyway. Say there were p pictures in Gallery A before the sale, thus
400 − p in Gallery B. Suppose the average value of A’s pictures was a,
and B’s b; then the behavior of the averages says exactly that the value
s of “Still Life with Kumquats” satisfies a > s > b.
We know that a is a fraction that can be written as m/p where m is
a whole number (of dollars); similarly b can be written as n/(400 − p)
where n is a whole number. By how little can a exceed an integer?
Easy: By 1/p, which happens when m is one more than a multiple
of p. Similarly, b’s shortfall from an integer value can be as little as
1/(400 − p). Thus the least possible difference between a and b is
1/p + 1/(400 − p) which is minimized when the two denominators
are equal, giving a − b = 1/200 + 1/200 = 1/100. The upshot is that
the insult is not very damaging; we can conclude from it only that
the average value of Gallery A’s holdings exceeds the average value of
Gallery B’s holdings by at least one cent.
Averaging comes up a lot in probability theory—whole chapters
on probability and on expectation lie ahead. But we can do the follow-
ing two averaging puzzles without needing any special machinery.
95
Mathematical Puzzles
Waits of length 1 can’t help us, because we have no “head start” (OK,
pun intended) when we begin flipping.
The real answer is much greater. Between runs, half the time you
get the wait of 1 and the rest of the time 1+x, where x is the desired
quantity. Hence it is not x but the average of 1 and 1+x that is equal
to 32, which gives us x = 62.
What are best patterns (of fixed length, say 5) to choose if you
want to hit your pattern ASAP? HHHHT is one of them, because
seeing an HHHHT gives you no head start toward seeing another.
Therefore, starting fresh with your coinflips costs you nothing, and
you expect to hit your target in just 32 steps on average.
Finding a Jack
In some poker games the right of first dealer is determined by dealing
cards face-up (from a well-shuffled deck) until some player gets a jack.
On average, how many cards are dealt during this procedure?
Solution: 10.6. If you tried to compute for each k the probability
that the first jack would be the kth card, with the intent of computing
the expected value of k directly, you might have found it tough going.
But there’s an easy way.
Each non-jack is equally likely to be in any of the five regions
between successive jacks (to see this, insert a joker, permute circularly
at random, then cut at the joker and remove it; or, get a shuffled deck
by starting with the jacks, and inserting cards at random, so the next
card is equally likely to be in any of the five slots.) Thus the expected
number of cards before the first jack is 48/5 = 9.6; add 1 for the jack
itself.
Can we talk about the average of infinitely many things? Some-
times.
96
Weighs and Means
1 ∑
Z
f (n) .
Z n=1
Increasing Routes
On the Isle of Sporgesi, each segment of road (between one intersec-
tion and the next) has its own name. Let d be the average number of
road segments meeting at an intersection. Show that you can take a
drive on the Isle of Sporgesi that covers at least d road segments, and
hits those segments in strict alphabetical order!
97
Mathematical Puzzles
98
Weighs and Means
99
9.The Power of Negative
Thinking
Contradiction is a ridiculously simple, yet somehow incredibly pow-
erful, tool. You want to prove statement A is true? Assume it isn’t, and
employ reductio ad absurdum: Derive an impossible conclusion. Voila!
The great mathematician Godfrey H. Hardy put it nicely: “Reduc-
tio ad absurdum, which Euclid loved so much, is one of a mathemati-
cian’s finest weapons. It is a far finer gambit than any chess play: A
chess player may offer the sacrifice of a pawn or even a piece, but a
mathematician offers the game.”
In fact, our first application of contradiction is to figure out who
wins a certain game even though we didn’t know how to play it well—
and still don’t.
Chomp
Alice and Bob take turns biting off pieces of an m × n rectangular
chocolate bar marked into unit squares. Each bite consists of selecting
a square and biting off that square plus every remaining square above
and/or to its right. Each player wishes to avoid getting stuck with the
poisonous lower-left square.
Show that, assuming the bar contains more than one square, Alice
(the first to play) has a winning strategy.
101
Mathematical Puzzles
Solution: It’s easy to see that Alice can win if the bar is a square,
as she can bite off all but the left-hand and bottom edges, then when
Bob bites off a piece of one leg she bites of the same amount of the
other. But how does she win in general? The surprising answer is: No
one knows!
But we do know that either the first player (Alice) or the second
(Bob) must have a winning strategy; suppose it is Bob. Then, in partic-
ular, Bob must have a winning answer to Alice’s opening move when
she merely nibbles off the upper right-hand square.
However, whatever Bob’s reply is could have been made by Al-
ice as her own opening move, after which she could follow Bob’s al-
legedly winning strategy and chalk up the game. This of course con-
tradicts the assumption that Bob can always win. Hence, it must be
Alice that has a winning strategy.
This kind of proof is known as a strategy-stealing argument and does
not, unfortunately, tell you how Alice actually wins the game. A sim-
ilar argument shows that the first player must have a winning strategy
in the game of Hex (look it up if you haven’t heard of it), yet we don’t
even know a winning first move.
If you know how to play dots and boxes, you can try this one with
the same idea in mind.
102
The Power of Negative Thinking
next greatest. The circled numbers are all at least r/2, so they must
all be in different columns. Suppose the highest number with a square
around it, say x, is in column j along with column j’s circled number
y. Let z be the square-encased number in y’s row; then y + z = r but
y + x = c, impossible because c < r but x ≥ z.
Bugging a Disk
Elspeth, a new FBI recruit, has been asked to bug a circular room
using seven ceiling microphones. If the room is 40 feet in diameter
and the bugs are placed so as to minimize the maximum distance
from any point in the room to the nearest bug, where should the bugs
be located?
103
Mathematical Puzzles
using its full diameter, covering the room’s circumference with cir-
cles of radius less than 10 would require at least seven circles. But that
would leave the center of the room uncovered, and that is our contra-
diction.
Often using contradiction is tantamount to using mathematical
induction: You assume the statement you wish is false, and consider
a minimal counterexample.
Lemming on a Chessboard
On each square in an n × n chessboard is an arrow pointing to one of
its eight neighbors (or off the board, if it’s an edge square). However,
arrows in neighboring squares (diagonal neighbors included) may not
differ in direction by more than 45 degrees.
A lemming begins in a center square, following the arrows from
square to square. Is he doomed to fall off the board?
104
The Power of Negative Thinking
Curve on a Sphere
Prove that if a closed curve on the unit sphere has length less than 2π,
then it is contained in some hemisphere.
Solution: Pick any point P on the curve, travel half way around the
curve to the point Q, and let N (standing for North Pole) be the point
half-way between P and Q. (Since the distance d(P, Q) from P to Q
is less than π, N is uniquely defined). Thinking of N as the North
Pole provides us with an equator, and if the curve lies entirely on N ’s
side, that is, in the northern hemisphere, we are done. Otherwise, the
curve crosses the equator, and let E be one of the points at which it
does so. Then, we observe that d(E, P ) + d(E, Q) = π, since if you
poke P through the equatorial plane to P ′ on the other side, P ′ is
antipodal to Q; hence, d(E, P ′ ) + d(E, Q) = π.
However, for any point X on the curve, d(P, X) + d(X, Q) must
be less than π, and this provides the desired contradiction. ♡
Soldiers in a Field
An odd number of soldiers are stationed in a large field. No two sol-
diers are exactly the same distance apart as any other two soldiers.
Their commanding officer radios instructions to each soldier to keep
an eye on his nearest neighbor.
Is it possible that every soldier is being watched?
105
Mathematical Puzzles
Alternating Powers
Since the series 1 − 1 + 1 − 1 + 1 − · · · does not converge, the function
f (x) = x−x2 +x4 −x8 +x16 −x32 +· · · makes no sense when x = 1.
However, f (x) does converge for all positive real numbers x < 1. If
we wanted to give f (1) a value, it might make sense to let it be the
limit of f (x) as x approaches 1 from below. Does that limit exist? If
so, what is it?
106
The Power of Negative Thinking
x = 1 that f did. But this one is equal to 1/(x+1), as you can check
by adding xg(x) to g(x), thus it docilely approaches 12 as x → 1.
Halfway Points
Let S be a finite set of points in the unit interval [0,1], and suppose
that every point x ∈ S lies either halfway between two other points in
S (not necessarily the nearest ones) or halfway between another point
in S and an endpoint.
Show that all the points in S are rational.
Our theorem is quite a famous one, and the proof given below
was often cited by Paul Erdős as an example of a “book proof.”
107
Mathematical Puzzles
Theorem. Let X be a finite set of points on the plane, not all on one line.
Then there is a line passing through exactly two points of X.
108
10. In All Probability
Dealing with probabilities is intuitive for some folks, less so for
others. But there are just a few basic ideas, which, if mastered, convey
a lot of power.
A thing that may or may not happen is called an event, and its
probability measures the likelihood that it will happen; if the “trial”
that could make the event happen is repeatable (like rolling a die),
then the event’s probability is the fraction of time that it occurs in
many trials.
If the trial has n possible outcomes that are equally likely (per-
haps because of symmetry) then the probability of the event A is the
number of outcomes that result in A occurring, divided by n. For ex-
ample, if we roll a die and A is the event that an even number appears
on top, then the probability P(A) that A occurs is 3/6 = 1/2, since
three of the outcomes are even numbers. The fact that the outcomes
are equally likely relies on the assumption that the die behaves like a
true, homogeneous, symmetrical, cube.
If we roll a pair of dice, there are 36 equally likely outcomes; note
that (2,3) is different from (3,2) because even if you can’t distinguish
between the two dice, Tyche (the goddess of chance) can. Thus, for
example, there are five ways to roll a sum of 6—(1,5), (2,4), (3,3),
(4,2), and (5,1)—so P(two dice roll a sum of 6) = 5/36.
If two events A and B are independent, that is, the occurrence of
one does not affect the probability of the other, then the probability
P(A ∧ B) that they both occur is equal to the product P(A)P(B) of
the probabilities of the two events. Without the assumption of inde-
pendence, we can only say P(A ∧ B) = P(A)P(B|A) where P(B|A),
read “the probability of B given A,” has intuitive meaning but is often
defined simply as the quantity that makes the equation true.
The probability P(A ∨ B) that at least one of A and B occurs is
always equal to P(A) + P(B) − P(A ∧ B), as you can see from a Venn
diagram. This reduces to P(A ∨ B) = P(A) + P(B) only in the case
where A and B are mutually exclusive—that is, they can’t both occur.
Let’s try a few amusing applications of these ideas.
109
Mathematical Puzzles
Winning at Wimbledon
As a result of temporary magical powers (which might need to be
able to change your gender), you have made it to the women’s singles
tennis finals at Wimbledon and are playing Serena Williams for all the
marbles. However, your powers cannot last the whole match. What
score do you want it to be when they disappear, to maximize your
chances of notching an upset win?
Solution: Naturally, you want to have won the first set of the best-
of-three-sets match, and be far ahead in the second. Your first thought
might be that you’d like to be up five games to love and serving at 40-
love (or, if your serve resembles mine, up 5-0 in games and receiving at
love-40). Either gives you three bites at the apple, that is, if your proba-
bility of winning a point is some small quantity ε then your probability
of winning is about 3ε.
(Technically, if the results of the next three points are independent,
and you discount the possibility of winning the match despite losing
them all, your success probability is 1 − (1 − ε)3 = 3ε − 3ε2 + ε3 .)
But you can do better. Let the game score be 6-6, and suppose you
are ahead 6-0 in the seven-point tiebreaker. Then you have six chances
to win, almost doubling your probability when ε is small.
As I write this, you can do even better in the Australian Open,
where the final-set tiebreaker is played to 10 points. The lesson, either
way, is this: If you need a miracle, try to arrange for as many shots at
that miracle as possible.
Birthday Match
You are on a cruise where you don’t know anyone else. The ship an-
nounces a contest, the upshot of which is that if you can find someone
who has the same birthday as yours, you (both) win a beef Wellington
dinner.
How many people do you have to compare birthdays with in order
to have a better than 50% chance of success?
Solution: Let’s assume that (a) neither you (important!) nor any-
one else on board (less important) was born on February 29, (b) other
dates are equally likely to be a given shipmate’s birthday, and (c) there
are no sets of twins (or triplets etc.) on board that will cause you
to waste queries. Then the probability that a given shipmate fails to
110
In All Probability
match your birthday is 364/365, thus if you ask n people, the proba-
bility that you have no luck is (364/365)n . You want this number to
dip below 50%, which it does when n reaches 253; in fact (364/365)253
= 0.49952284596... .
Is 253 higher than you guessed? You’d only need 183 queries to get
your success probability over 12 , if the people you asked were guaran-
teed to have different birthdays. The trouble is, you will probably hear
a lot of duplicated answers that don’t help you. (Well, it could help
you a bit if you demand a bite of their beef Wellington in return for
telling each about the other).
If you thought the answer to the puzzle was 23, you confused the
question with the more famous problem of how many people you
need in a room to have a better than 50% probability that some pair
of people share a birthday. In fact, you can get the answer( “23”
) from
our answer; the number of pairs of people in that room is 23 2 = 253.
(The pairs are not precisely independent, but they’re close enough to
make this work.)
By the way, how do you determine that 253 is the least n for which
(364/365)n < 12 without a lot of trial and error? My favorite way is
to use the approximation (1 − 1/m)m ∼ e−m for large m. If you
take this as an equality and solve (1 − 1/365)n = 1/2 you get n =
loge (2) · 365 ∼ 252.9987.
When the event A is decided before the event B, the conditional
probability of B given A is often easy to deduce but P(A|B) is less
intuitive. The laws of probability don’t care about the order of events,
though.
111
Mathematical Puzzles
Solution: The temptation is to say that the drawn coin is either the
two-headed coin or the fair coin, so the probability that its other side is
heads is 12 . But is it? Imagine that the coin is flipped many times, and
comes up heads every time. It could still be either coin, but you can’t
help thinking it’s more likely to be the two-headed coin. That kind of
reasoning is basically how we learn from statistical observations.
In fact, the inference that the drawn coin is probably two-headed
exists already after one flip. We want to compute P(A|B) where A is
the event that the two-headed coin was drawn, and B the event that
heads was flipped. For any two events A and B, we calculate
P(A ∧ B) P(A)P(B|A)
P(A|B) = =
P(B) P((A ∧ B) ∨ (A ∧ B))
P(A)P(B|A)
=
P(A ∧ B) + P(A ∧ B)
P(A)P(B|A)
=
P(A)P(B |A) + P(A)P(B |A)
where A is the event that A does not occur. This equation is known as
Bayes’ Rule, and if we plug in the values from our experiment, we get
1
·1 2
P(A|B) = 3
= .
1
3 · 1 + 23 · 1
4
3
112
In All Probability
113
Mathematical Puzzles
Whose Bullet?
Two marksmen, one of whom (“A”) hits a certain small target 75%
of the time and the other (“B”) only 25%, aim simultaneously at that
target. One bullet hits. What’s the probability that it came from A?
Solution: You might think that since A is three times as good a shot
as B, he is three times as likely to have been the one whose bullet hit;
in other words, the probability that he deserves the credit is 75%.
But there are two things happening here: hitting and missing.
Since the probability that A hits and B misses is 3/4 × 3/4 = 9/16
while the probability that B hits but A misses is only 1/4×1/4 = 1/16,
the probability that the successful bullet was A’s is actually a full 90%.
Conditional probabilities can sometimes defy your intuition. An-
other example:
Second Ace
What is the probability that a poker hand (five cards dealt at random
from a 52-card deck) contains at least two aces, given that it has at
least one? What is the probability that it contains two aces, given that
it has the Ace of Spades? If your answers are different, then: What’s
so special about the Ace of Spades?
( ) ( ) (48)
Solution: There are( 52 poker hands of which 52
) (48) (4) (48)
5 5 − 5 have
at least one ace, and 5 − 5 − 1 · 4 have at least two aces;
52
114
In All Probability
dividing the last of these expressions by the second gives our first an-
swer, 0.12218492854.
( ) (51)
(48)
There are 51 4 hands containing the Ace of Spades and 4 −
4 containing another ace as well, giving our second answer,
0.22136854741, quite a lot larger than the first answer.
Of course, there’s nothing special about the Ace of Spades; speci-
fying the ace held changes the conditional probabilities.
Here’s a simpler example that you don’t need a calculator for. Sup-
pose a third of the families in town have two children, a third have one,
and the remaining third none. Then the probability that a family has
a second child, given that it has at least one, is 12 . But the probability
that a family has a second child given that it has a girl is 35 , because
only half the families with one child have a girl, but 34 of those with
two children have a girl.
115
Mathematical Puzzles
interval, the probability that it falls between 0.3 and 0.4 is 1/10 (re-
gardless of whether we count 0.3 and 0.4 as part of the interval).
Points on a Circle
What is the probability that three uniformly random points on a circle
will be contained in some semicircle?
Solution: It’s not hard to see that no matter where we put the first
two points, assuming they don’t coincide, it is more likely that the
third point will be in some semicircle with the first two, than not.
Thus, in fact, the answer to the puzzle should be more than 12 . But
how do we compute it, without the bother of trying to condition on
the distance between the first two points?
The answer is (as is often the case in probability problems) to
choose the points in a different way—but, of course, one that still
results in uniformly random points. Here, let us choose three random
diameters of our circle. Each hits the circle at two (antipodal) points,
and we use three coinflips do decide which three points to use.
This may seem like an unnecessarily complicated way to choose
our points—why in six steps, when we can do it in three steps? To see
the answer, draw any three diameters and the six points where they
hit the circle. Observe that of those six, if three consecutive points are
chosen, they will certainly lie in a semicircle; otherwise, they won’t!
Well, there are 23 = 8 ways to pick the points, using our coin-
flips, and 6 of those result in consecutive points being chosen. So
the probability of their being contained in some semicircle is 6/8 =
3/4. ♡
(If you found that puzzle too easy, try to determine the probability
that four uniformly random points on a sphere are all contained in
some hemisphere!)
116
In All Probability
Clearly, Victor can at least break even in this game, for example,
by flipping a coin to decide whether to guess “larger” or “smaller”—
or by always guessing “larger,” but choosing the hand at random. The
question is: Not knowing anything about Paula’s psychology, is there
any way he can do better than break even?
Solution: Amazingly, there is a strategy which guarantees Victor a
better than 50% chance to win.
Before playing, Victor selects a probability distribution on the in-
tegers that assigns positive probability to each integer. (For example,
he plans to flip a coin until a “head” appears. If he sees an even num-
ber 2k of tails, he will select the integer k; if he sees 2k−1 tails, he will
select the integer −k.)
If Victor is smart, he will conceal this distribution from Paula, but
as you will see, Victor gets his guarantee even if Paula finds out. It
is perhaps worth noting that although Victor might like the idea of
assigning the same probability to every integer, this is not possible—
there is no such probability distribution on the integers!
After Paula picks her numbers, Victor selects an integer from his
probability distribution and adds 12 to it; that becomes his “threshold”
t. For example, using the distribution above, if he flips five tails before
his first head, his random integer will be −3 and his threshold t will
be −2 12 .
When Paula offers her two hands, Victor flips a fair coin to decide
which hand to choose, then looks at the number in that hand. If it
exceeds t, he guesses that it is the larger of Paula’s numbers; if it is
smaller than t, he guesses that it is the smaller of Paula’s numbers.
So, why does this work? Well, suppose that t turns out to be larger
than either of Paula’s numbers; then Victor will guess “smaller” re-
gardless of which number he gets, and thus will be right with prob-
ability exactly 12 . If t undercuts both of Paula’s numbers, Victor will
inevitably guess “larger” and will again be right with probability 12 .
But, with positive probability, Victor’s threshold t will fall between
Paula’s two numbers; and then Victor wins regardless of which hand
he picks. This possibility, then, gives Victor the edge which enables
him to beat 50%. ♡
Neither this nor any other strategy enables Victor to guarantee, for
some fixed ε > 0, a probability of winning greater than 50% + ε. A
smart Paula can choose randomly two consecutive multidigit integers,
and thereby reduce Victor’s edge to an insignificant smidgen.
117
Mathematical Puzzles
Biased Betting
Alice and Bob each have $100 and a biased coin that comes up heads
with probability 51%. At a signal, each begins flipping his or her coin
once a minute and bets $1 (at even odds) on each outcome, against a
bank with unlimited funds. Alice bets on heads, Bob on tails. Suppose
both eventually go broke. Who is more likely to have gone broke first?
Suppose now that Alice and Bob are flipping the same coin, so that
when the first one goes broke the second one’s stack will be at $200.
Same question: Given that they both go broke, who is more likely to
have gone broke first?
118
In All Probability
Solution: In the first problem, Alice and Bob are equally likely to
have gone broke first. In fact, conditioned on Alice’s having gone
broke, they have exactly the same probability of having gone broke
at any particular time t.
To see this, pick any win–loss sequence s that ends by going broke;
suppose s has n wins, thus n + 100 losses. It will have probability
pn q n+100 for Alice, but pn+100 q n for Bob, where here p = 51% and
q = 49%. The ratio of these probabilities is the constant (q/p)100 ,
thus P(Alice goes broke) = (q/p)100 (which happens to be about
0.0183058708; call it 2%). Once we divide Alice’s probability of en-
countering s by this number, her probability is the same as Bob’s.
For the second problem, where Alice and Bob were flipping the
same coin, your intuition might tell you that Alice probably went
broke first. The reasoning is that if Bob went broke first, Alice would
have to have gone broke after building up to $200, an unlikely occur-
rence. But is this true? Can’t we argue as above, comparing win–lose
sequences that result in both going broke?
No. The proof above doesn’t work because here, Alice’s going
broke also affects Bob’s longevity. In fact, the same ratio (q/p)100 ap-
plies when comparing a both-broke win–loss sequence and the con-
clusion is that the probability that Bob goes broke first is (q/p)100
times the probability that Alice goes broke first. Intuition was correct;
Alice is more than 50 times more likely to have gone broke first!
It’s worth noting that, putting Bob aside, we can deduce from the
first calculation how long it takes, on average, for Alice to go broke
given that she goes broke. The reason is that under this condition, we
have shown Alice’s expected time to ruin is the same as Bob’s. But
Bob always goes broke and since he loses 2 cents per toss on average,
his expected time to ruin is 100/0.02 = 5000 tosses. At 60 tosses per
hour that comes to 83 13 hours, or about 3 12 days.
Home-Field Advantage
Every year, the Elkton Earlies and the Linthicum Lates face off in a
series of baseball games, the winner being the first to win four games.
The teams are evenly matched but each has a small edge (say, a 51%
chance of winning) when playing at home.
Every year, the first three games are played in Elkton, the rest in
Linthicum.
Which team has the advantage?
119
Mathematical Puzzles
120
In All Probability
Service Options
You are challenged to a short tennis match, with the winner to be
the first player to win four games. You get to serve first. But there are
options for determining the sequence in which the two of you serve:
1. Standard: Serve alternates (you, her, you, her, you, her, you).
2. Volleyball Style: The winner of the previous game serves the
next one.
3. Reverse Volleyball Style: The winner of the previous game re-
ceives in the next one.
Which option should you choose? You may assume it is to your ad-
vantage to serve. You may also assume that the outcome of any game
is independent of when the game is played and of the outcome of any
previous game.
Solution: Again using the idea (from the previous puzzle’s solu-
tion) that it doesn’t hurt to assume extra games are played, assume
that you play lots of games—maybe more than are needed to deter-
mine the match winner. Let A be the event that of the first four served
by you and the first three served by your opponent, at least four are
won by you. Then, it is easily checked that no matter which service
option you choose, you will win if A occurs and lose otherwise. Thus,
your choice makes no difference. Notice that the independence as-
sumptions mean that the probability of the event A, since it always
involves four particular service games and three particular returning
games, does not depend on when the games are played, or in what
order.
If the game outcomes were not independent, the service option
could make a difference. For example, if your opponent is easily
discouraged when losing, you might benefit by using the volleyball
scheme, in which you keep serving if you win.
The lesson learned above from Home-Field Advantage will again
come in handy in the next puzzle.
121
Mathematical Puzzles
Dishwashing Game
You and your spouse flip a coin to see who washes the dishes each
evening. “Heads” she washes, “tails” you wash.
Tonight she tells you she is imposing a different scheme. You flip
the coin 13 times, then she flips it 12 times. If you get more heads than
she does, she washes; if you get the same number of heads or fewer,
you wash.
Should you be happy?
Solution: If “should you be happy?” means anything at all, it
should mean “are you better off than you were before?”
122
In All Probability
Here, the easy route is to imagine that first you and your spouse
flip just 12 times each. If you get different numbers of heads, the one
with fewer will be washing dishes regardless of the outcome of the
next flip; so those scenarios cancel. The rest of the time, when you tie,
the final flip will determine the washer. So it’s still a 50-50 proposition,
and you should be indifferent to the change in procedure (unless you
dislike flipping coins).
Now suppose that some serious experimentation with the coin in
question shows that it is actually slightly biased, and comes up heads
51% of the time. Should you still be indifferent to the new decision
procedure? It might seem that you would welcome it now: Heads are
good for you, so, the more flipping, the better.
But re-examination of the above argument shows the opposite.
When you and your spouse flip 12 times each, it’s still equally likely
that you flip more heads than she does, or the reverse. Only if the two
of you flip the same number of heads do you get your 51% advan-
tage from the final flip. Thus, overall, your probability of ducking the
dishwashing falls to somewhere between 50% and 51%.
The analysis suggests a third procedure: You and your spouse al-
ternate flipping the coin until you reach a point where you have both
flipped the same number of times but one of you (the winner) has
flipped more heads. The advantage of this scheme? It’s fair even if the
coin is biased!
Many puzzles that involve comparing two probabilities can be ap-
proached by a technique called coupling, in which two events associ-
ated with different conditions are somehow built into a single exper-
iment for which both events make sense.
Then, if you want to determine which of the two events A and B
is more probable, you can ignore outcomes where they both occur or
neither occurs, and just compare the probability of A happening with-
out B with the probability of B happening without A. This amounts
to comparing the areas of the two crescents in the Venn diagram be-
low.
123
Mathematical Puzzles
Random Judge
After a wild night of shore leave, you are about to be tried by
your U.S. Navy superiors for unseemly behavior. You have a choice
between accepting a “summary” court-martial with just one judge,
or a “special” court-martial with three judges who decide by major-
ity vote.
Each possible judge has the same (independent) probability—
65.43%—of deciding in your favor, except that one officer who would
be judging your special court-martial (but not the summary) is noto-
rious for flipping a coin to make his decisions.
Which type of court-martial is more likely to keep you out of the
brig?
Solution: It’s not that hard to “do the math” on this one and sim-
ply compute your chance of getting off in the special court-martial,
then compare it to your 65.43% chance of surviving the summary
court-martial. (You might save yourself some arithmetic if you replace
65.43% by a variable, say p, and put the number back in later if nec-
essary.)
But let’s try coupling. You may as well suppose officer A would
be on both panels and would vote the same way on each; officer C
is the random one. If you go with the special court-martial you will
regret it precisely when A votes innocent and B and C vote guilty, but
thank your stars if A votes guilty while B and C vote innocent.
Without any calculations you know that these events have the
same probability, just by exchanging the roles of A and B and revers-
ing C’s coinflip. So your two choices are equally good.
Suppose there’s also an option of a “general” court-martial with
five judges, two of whom are coin-flippers. You can apply the coupling
method again, but this time it tells you to choose the five judges if p
(as here) is greater than 12 .
In fact, the Law of Large Numbers tells you that even if 90% of
the judges were coin-flippers, the remaining 10% voting in your favor
with some fixed probability p > 1/2, you could boost your chances
to 99% with enough judges.
124
In All Probability
Wins in a Row
You want to join a certain chess club, but admission requires that you
play three games against Ioana, the current club champion, and win
two in a row.
Since it is an advantage to play the white pieces (which move first),
you alternate playing white and black.
A coin is flipped, and the result is that you will be white in the first
and third games, black in the second.
Should you be happy?
Solution: You can answer this question by assigning a variable w
to the probability of winning a game as White, and another variable
b < w to the probability of winning as Black; then doing some algebra.
Using coupling, you can get the answer without algebra—even if
the problem is modified so that you have to win two in a row out of
seventeen games, or m in a row out of n. (If n is even, it doesn’t matter
who plays white first; if n is odd, you want to be black first when m
is odd, white first when m is even.)
The coupling argument in the original 2-out-of-3 puzzle goes like
this. Imagine that you are going to play four games against Ioana,
playing white, then black, then white, then black. You still need to
win two in a row, but you must decide in advance whether to discount
the first game, or the last.
Obviously turning the first game into a “practice game” is equiv-
alent to playing BWB in the original problem, and failing to count
the last game is equivalent to playing WBW, so the new problem is
equivalent to the old one.
But now the events are in the same experiment. For it to make
a difference which game you discounted, the results must be either
WWLX or XLWW. In words: If you win the first two games, and
lose (or draw) the third, you will wish that you had discounted the
last game; if you lose the second but win the last two, you will wish
that you had discounted the first game.
But it is easy to see that XLWW is more likely than WWLX. The
two wins in each case are one with white and one with black, so those
cases balance; but the loss in XLWW is with black, more likely than
the loss in WWLX with white. So you want to discount the first game,
that is, start as black in the original problem.
A slightly more challenging version of this argument is needed if
you change the number of games played, and/or the number of wins
needed in a row.
125
Mathematical Puzzles
Split Games
You are a rabid baseball fan and, miraculously, your team has won
the pennant—thus, it gets to play in the World Series. Unfortunately,
the opposition is a superior team whose probability of winning any
given game against your team is 60%.
Sure enough, your team loses the first game in the best-of-seven
series and you are so unhappy that you drink yourself into a stupor.
When you regain consciousness, you discover that two more games
have been played.
You run out into the street and grab the first passer-by. “What
happened in games 2 and 3 of the World Series?”
“They were split,” he says. “One game each.”
Should you be happy?
126
In All Probability
After the second and third games are split, your team needs at least
three of the remaining four. The probability of winning is now:
( ) ( )
4 4
· 0.4 · 0.6 +
3
· 0.44
3 4
127
Mathematical Puzzles
Angry Baseball
As in Split Games, your team is the underdog and wins any given game
in the best-of-seven World Series with probability 40%. But, hold on:
This time, whenever your team is behind in the series, the players get
angry and play better, raising your team’s probability of winning that
game to 60%.
Before it all begins, what is your team’s probability of winning the
World Series?
Solution: It would be a pain in the neck to work out all the possi-
ble outcomes and their probabilities, but coupling again comes to our
rescue. Let k be the number of the first game played after the last time
the teams were tied. Since the teams were tied 0-0 at the start, k could
be 1, but it could also be 3, 5, or 7. (It turns out, you don’t care!)
Suppose team X wins game k. Let us represent the winners of the
rest of the games by a sequence of X’s and Y’s. Since there are no
more ties, X must have won the series, each win by X having had
probability 40% and each win by Y, 60%.
If it was Team Y that won game k, the same reasoning applies and
the same probability attaches to the subsequent win-sequence except
with X’s and Y’s exchanged. In effect, we couple win-sequences after
X wins game k with the complementary win-sequences after Y wins
game k.
We conclude that the probability of winning the series for Team X
is exactly the probability that Team X wins game k. That probability
is 40% when Team X is your team. Since that does not depend on the
value of k, your team’s probability of winning the series is 40% from
the start.
Note that unlike Split Games, this puzzle works with any game-
winning probability p (changing to 1−p when the team is behind).
The answer is then p.
Let’s move on to (American) football. Are you ready to use prob-
ability theory to be an effective coach?
Two-point Conversion
You, coach of the Hoboken Hominids football team, were 14 points
behind your rivals (the Gloucester Great Apes) until, with just a
minute to go in the game, you scored a touchdown. You have a choice
128
In All Probability
of kicking an extra point (95% success rate) or going for two (45% suc-
cess rate). Which should you do?
Solution: You must assume the Hominids will be able to score a
second touchdown; and it’s reasonable to postulate that if the game
goes to overtime, either team is equally likely to win it.
Whatever you do, if it doesn’t work you’ll need to go for two points
after the second TD, winning with probability 0.45 · 12 = 0.225.
If you do succeed with the first conversion, you’ll want to go for
just one the next time, winning with probability 12 · 0.95 = 0.475 if
you had kicked last time but a full 0.95 if you had gotten two extra
points last time.
So, altogether (assuming that you did get that second touchdown)
your probability of winning with the “kick after first TD” option is
while your probability of winning if you went for two after the first
TD is
0.45 · 0.95 + 0.55 · 0.225 = 0.55125,
so going for two is much better.
It might be easier to see why this is so if you instead imagine that
the kick is a sure thing while the two-point conversion has probability
of success 12 . Then if you kick, you are headed for overtime for sure
(given, of course, the second touchdown) where you win with prob-
ability 12 . If you go for two and succeed you win for sure, so already
you get probability 12 of winning the game; but if you miss it ain’t
over. Altogether the two-point conversion strategy wins 5/8 of the
time.
So why do coaches frequently try to kick the extra point in these
situations? Do they think missing the conversion will demoralize their
team and make the second touchdown unlikely?
My own theory is that coaches tend to make conservative deci-
sions, making it harder for their managers to point at a coach’s de-
cision that cost the game. In this situation, for example, if the team
misses both two-point conversions, blame is likely to fall on the coach;
but if they kick both extra points and lose in overtime, most of the
blame will fall on whichever player screwed up in overtime.
129
Mathematical Puzzles
Random Chord
What is the probability that a random chord of a circle is longer than
a side of an equilateral triangle inscribed in the circle?
Solution: Call a chord “long” if it is longer than the side of our
inscribed triangle.
Suppose we choose our random chord by fixing some direction—
horizontal is as good as any. Then we can draw a vertical diameter
in our circle, pick a point on it uniformly at random, and draw the
horizontal chord through that point.
In the left-hand third of the figure below, the inscribed triangle
has been drawn with its base down, so that the diameter we just drew
is perpendicular to the base. We claim the triangle’s base is exactly
halfway between the circle’s center and the bottom point of the diam-
eter; one way to see this is to draw another inscribed triangle, this one
upside-down, so that the two triangles make a “star of David.” The
hexagon in the middle of the star can be broken into six equilateral
triangles and once we do that, it is evident that the part of our diam-
eter that yields a long chord is the same length as the rest. Thus the
probability that the random chord is long is 12 .
But . . . we could instead fix one end of the chord, say at the trian-
gle’s apex, and choose its angle uniformly at random, as in the middle
third of the figure. Since the angle made by the triangle is 60◦ and our
random angle is between 0◦ and 180◦ , we deduce that the probability
the chord is long is 13 .
Wait, here’s yet another way to solve the problem. Except for di-
ameters (which have probability zero), every chord has a different
midpoint and every point inside the circle, except for the center, is
the midpoint of a unique chord. So let’s pick a point inside the cir-
cle uniformly at random, and use the chord with that midpoint. It’s
easy to see that the chord will be long exactly if our point is closer to
the center of the circle than the midpoint of a side of the triangle (see
130
In All Probability
Random Bias
Suppose you choose a real number p between 0 and 1 uniformly at
random, then bend a coin so that its probability of coming up heads
when you flip it is precisely p. Finally you flip your bent coin 100
times. What is the probability that after all this, you end up flipping
exactly 50 heads?
Solution: This puzzle again calls for a form of coupling; the idea in
this case is to couple the coinflips even though they involve different
coins, depending on the choice of p. To do this we choose, in advance,
a uniformly random threshold pi ∈ [0, 1] for the ith coinflip, indepen-
dently for each i. Then, after p is chosen, the ith coinflip is deemed
to be heads just when pi < p.
Now we need only observe that getting 50 heads is tantamount to
p being the middle number, that is, the 51st largest, of the 101 values
p1 , p2 , . . . , p100 , p. Since these numbers are all uniform and indepen-
dent, their order is uniformly random and the probability that p ends
up in the middle position is exactly 1/101.
Coin Testing
The Unfair Advantage Magic Company has supplied you, a magi-
cian, with a special penny and a special nickel. One of these is sup-
posed to flip “Heads” with probability 13 , the other 41 , but UAMCO
has not bothered to tell you which is which.
131
Mathematical Puzzles
132
In All Probability
Coin Game
You and a friend each pick a different heads–tails sequence of length
4 and a fair coin is flipped until one sequence or the other appears;
the owner of that sequence wins the game.
For example, if you pick HHHH and she picks TTTT, you win if
a run of four heads occurs before a run of four tails.
Do you want to pick first or second? If you pick first, what should
you pick? If your friend picks first, how should you respond?
Solution: At first it seems as if this must be a fair game; after all, any
particular sequence of four flips has the same probability of appearing
1
(namely, 16 ) as any other. Indeed, if the coin is flipped four times and
then the game begins anew, nothing of interest arises. But because
the winning sequence could start with any flip, including the second,
third or fourth, significant imbalances appear.
For example, if you pick HHHH (a miserable choice) as your se-
quence and your friend counters with THHH, you will lose unless the
1
game begins with four heads in a row (only a 16 probability). Why?
Because otherwise the first occurrence of HHHH will be preceded by
a tail, thus your friend will get there first with her THHH.
How can you determine how to play optimally? For that you need
a formula for the probability that string B beats string A. There is, in
fact, a very nice one, discovered by the late, indominable John Horton
Conway. Here’s how it works.
We use the expression “A·B” to denote the degree to which A and
B can overlap when A begins first (or they begin simultaneously). We
measure this with a four-digit binary number x4 x3 x2 x1 where xi is 1
if the first i letters of B match the last i of A, otherwise 0. For example,
HHTH·HTHT = 0101(binary) = 5 since H[HTH]T gives an overlap
of 3 while HHT[H]THT gives an overlap of 1. The left-most digit, x4 ,
can only be 1 if A = B; thus A·B is equal to or greater than 8 if and
only if A = B.
Now if your friend has chosen A as her sequence, how should you
choose B? You want B to have low waiting time, thus B·B should be
as low as possible. You want B·A to be high, so that you maximize
your probability of sneaking in ahead of your friend; and you want
A·B to be low to minimize the probability that she sneaks in ahead of
you. The formula says that the odds that B beats A are (A·A − A·B):
(B·B − B·A).
For example, suppose your friend picks A = THHT as her se-
quence (then A·A = 9). Your best choice is (always) to tack an H
133
Mathematical Puzzles
or T to the front of her choice and drop the last letter; this ensures
that B·A is at least 4. If you pick B = HTHH you get B·B = 9, B·A
= 4, and A·B = 2, so Conway’s formula says the odds in your favor
are (9 − 2):(9−4) = 7:5. If instead you pick B = TTHH you get B·B
= 8, B·A = 4, and A·B = 1, and the formula says the odds in your
favor are (9 − 1):(8 − 4) = 2:1. So in this case B = TTHH is the better
choice.
Was A = THHT a poor choice by your friend? Actually, it was
among the best. Anything your friend chose would leave her at a 2:1
disadvantage or worse, with best play by you.
Conway’s formula continues to work beautifully for strings of
length k, for any integer k ≥ 2, and also to non-binary randomiz-
ers such as dice. In the case of dice, the overlap vectors still consist of
zeroes and ones, but are now interpreted base 6.
Sleeping Beauty
Sleeping Beauty agrees to the following experiment. On Sunday she
is put to sleep and a fair coin is flipped. If it comes up Heads, she is
awakened on Monday morning; if Tails, she is awakened on Monday
morning and again on Tuesday morning. In all cases, she is not told
the day of the week, is put back to sleep shortly after, and will have
no memory of any Monday or Tuesday awakenings.
When Sleeping Beauty is awakened on Monday or Tuesday,
what—to her—is the probability that the coin came up Heads?
134
In All Probability
135
Mathematical Puzzles
∑
k
sk = xk .
i=1
Let’s first check that this statement tells us what we want to know.
The string x codes the ballot-counting process; each 1 represents a
vote for Alice, each −1 a vote for Bob. The sum sk tells us by how
much Alice leads after the kth vote has been counted; for example,
if s9 = −3 we conclude that Alice was actually behind by three votes
after the ninth vote was counted.
If we apply the theorem to the puzzle above, we get the answer
(105 − 95)/(105 + 95) = 1/20 = 5%. So how can we prove the
theorem?
There’s a famous and clever proof that uses reflection of random
walk, but doesn’t really explain why the probability turns out to be
the vote difference divided by the total vote. Instead, consider the fol-
lowing argument.
One way to choose the random order in which the ballots are
counted is first to place the ballots randomly in a circle, then to choose
a random ballot in the circle and start counting (say, clockwise)
from there. Since there are a+b ballots, there are a+b places to start,
and the claim is that no matter what the circular order is, exactly a−b
of those starting points are “good” in that they result in Alice leading
all the way.
To see this we observe that any occurrence of 1,−1 (i.e., a vote for
Alice followed immediately by a vote for Bob in clockwise order) can
be deleted without changing the number of good starting positions.
Why? First, you can’t start with that 1 or −1, since if you start with
the 1 the candidates are tied after the second vote, and if you start
with the −1, Alice actually falls behind. Secondly, the 1,−1 pair has
no influence upon the the eligibility of any other starting point, since
all it does is raise the sum (Alice’s lead) by one and then lower it again.
So we can keep deleting 1,−1’s until all that’s left is a−b 1’s, each
of which is obviously a good starting point. We conclude that all along
there were a−b good starting points, and we are done! ♡
136
11. Working for the
System
There’s no getting around it—many puzzles respond only to trying
out ideas until you find one that works. Even so, there are good ways
and bad ways to go about this process. Some people have a tendency
to circle back and try the same answer many times.
How can you avoid doing that? By classifying your attempts.
Make some choice and stick with it, until it either yields a solution
or runs out of steam; if the latter, you can then rule out one possibil-
ity, and progress has been made.
There are other benefits to this besides avoiding redundancy: For
example, you might actually see what’s going on and jump to the so-
lution!
No Twins Today
It was the first day of class and Mrs. O’Connor had two identical-
looking pupils, Donald and Ronald Featheringstonehaugh (pro-
nounced “Fanshaw”), sitting together in the first row.
“You two are twins, I take it?” she asked.
“No,” they replied in unison.
But a check of their records showed that they had the same parents
and were born on the same day. How could this be?
Solution: We have begun with a puzzle that might not seem to re-
spond to systematic search; you either get it or you don’t. But these
days many people train themselves to “think out of the box” and for-
get to first try thinking in the box. Accept that the boys are genetically
identical and born to the same parents at the same time, and ask how
this can happen if they are not twins. Then, at least, it might occur to
you that there was an additional simultaneous sibling (or more!).
The most likely possibility is that Donald and Ronald are triplets;
the third (Arnold, perhaps?) is in another class.
137
Mathematical Puzzles
Natives in a Circle
An anthropologist is surrounded by a circle of natives, each of whom
either always tells the truth or always lies. She asks each native
whether the native to his right is a truth-teller or a liar, and from their
answers, she is able to deduce the fraction of liars in the circle.
What fraction is it?
Solution: Observe that if all truth-tellers are changed to liars and
vice-versa, none of answers would change. Therefore, if the fraction
x can be determined, it must have the property that x = 1−x, thus
x = 1/2.
It remains to check that there is a set of answers from which the an-
thropologist can deduce that half the natives are truth-tellers. That re-
quires, of course, that there be an even number of natives in the circle.
One possibility is that every native says his right-hand neighbor is a
liar, in which case natives must alternate between liar and truth-teller.
Poker Quickie
What is the best full house?
(You may assume that you have five cards, and you have just one
opponent who has five random other cards. There are no wild cards.
As a result of the Goddess of Chance owing you a favor, you are en-
titled to a full house, and you get to choose whatever full house you
want.)
Solution: All full houses with three aces are equally good, be-
cause there can only be one such hand in a deal from a single deck.
But there are other hands that can beat them: any four-of-a-kind, of
which there are always 11 varieties possible, and more relevantly any
straight flush. Since AAA99, AAA88, AAA77, and AAA66 kill the
most straight flushes (16—each ace kills only two, but each spot card
kills five) they are the best full houses. Note that AAA55 doesn’t quite
make the list, because one of the 5’s must be in the same suit as an
ace and the A2345 straight flush in that suit is thus doubly covered.
If you greedily insist on AAAKK, there are 40 − 9 = 31 possible
straight flushes that can beat you—even more if you haven’t got the
four suits covered—instead of just 40 − 16 = 24.
Although the argument above only works for head-to-head poker
(two players), the result has in fact been verified by computer for any
number of players.
138
Working for the System
Fewest Slopes
If you pick n random points in, say, a disk, the pairs of points among
them will with probability 1 determine n(n−1)/2 distinct slopes. Sup-
pose you get to pick the n points deliberately, subject to no three being
collinear. What’s the smallest number of distinct slopes they can de-
termine?
Solution: Three points, since they are not permitted to lie on one
line, determine a triangle with three slopes. A little experimentation
will convince you that with four, you can’t have any fewer than the
four slopes you get from a square.
In fact the vertices of a regular n-sided polygon determine just n
different slopes. If n is odd, the polygon’s sides already have n different
slopes, but every diagonal is parallel to some side. If n is even, the sides
exhibit only n/2 different slopes but now the diagonals that connect
two vertices an even number of edges apart are not parallel to any
side, but they form n/2 parallel classes; so again we get n different
diagonals.
Can you do any better than the vertices of a regular n-gon? No.
Let X be any configuration of n points in the plane, no three on a line,
and let P be the southernmost point of X. Then you already have n−1
lines through P , each determining a different angle between −90◦ and
+90◦ (relative to north = 0◦ ). The line through the two points that give
the smallest and largest such angles gives you your nth slope.
139
Mathematical Puzzles
140
Working for the System
Solution: Simultaneously light both ends of one fuse and one end
of the other; when the first fuse burns out (after half a minute),
light the other end of the second. When it finishes, 45 seconds have
passed. ♡
If you allow midfuse ignition and arbitrary dexterity, you can do
quite a lot with fuses. For example, you can get 10 seconds from a sin-
gle 60-second fuse by lighting at both ends and at two internal points,
141
Mathematical Puzzles
then lighting a new internal point every time a segment finishes; thus,
at all times, three segments are burning at both ends and the fuse ma-
terial is being consumed at six times the intended rate.
Bit of a mad scramble at the end, though. You’ll need infinitely
many matches to get perfect precision.
King's Salary
Democracy has come to the little kingdom of Zirconia, in which the
king and each of the other 65 citizens has a salary of one zircon. The
king can not vote, but he has power to suggest changes—in particu-
lar, redistribution of salaries. Each person’s salary must be a whole
number of zircons, and the salaries must sum to 66. Each suggestion
is voted on, and carried if there are more votes for than against. Each
voter can be counted on to vote “yes” if his or her salary is to be in-
creased, “no” if decreased, and otherwise not to bother voting.
The king is both selfish and clever. What is the maximum salary
he can obtain for himself, and how many referenda does he need to
get it?
Solution: There are two key observations: (1) that the king must
temporarily give up his own salary to get things started, and (2) that
the game is to reduce the number of salaried citizens at each stage.
The king begins by proposing that 33 citizens have their salaries
doubled to 2 zircons, at the expense of the remaining 33 citizens (him-
self included). Next, he increases the salaries of 17 of the 33 salaried
voters (to 3 or 4 zircons) while reducing the remaining 16 to no salary
at all. In successive turns, the number of salaried voters falls to 9, 5, 3,
and 2. Finally, the king bribes three paupers with one zircon each to
help him turn over the two big salaries to himself, thus finishing with
a royal salary of 63 zircons.
142
Working for the System
It is not difficult to see that the king can do no better at any stage
than to reduce the number of salaried voters to just over half the pre-
vious number; in particular, he can never achieve a unique salaried
voter. Thus, he can do no better than 63 zircons for himself, and the
seven rounds above are optimal. ♡
More generally, if the original number of citizens is n, the king
can achieve a salary of n−3 zircons in k rounds, where k is the least
integer greater than or equal to log2 (2n−4).
Packing Slashes
Given a 5 × 5 square grid, on how many of the squares can you draw
diagonals (slashes or backslashes) in such a way that no two of the
diagonals meet?
Solution: You can get 15 easily (see figure below) using rows (or
columns) 1, 3, and 5, with all slashes or all backslashes on each line,
or by nested Ls. Is it possible to do any better than that?
There are 6 × 6 = 36 vertices (cell corners) in the grid and each
diagonal accounts for two, so you certainly will not be able to fit in
more than 18 diagonals. But you can see that, for example, it won’t
be possible to use all 12 corners of the top row of squares.
143
Mathematical Puzzles
When we try to achieve 16, we notice that using up all the outer
vertices of the inside 3 × 3 grid to take care of outer vertices won’t
work—that leaves the four corners of the center cell unmatched, and
a diagonal in that cell takes care of only two, taking us back to 15
diagonals. We’ll need to leave at least two of the four corners of the
big square unmatched, and use two or four unmatched outer vertices
of the inside 3 × 3 grid to cover the corners of the central cell. A little
experimentation shows that this works only if you miss all the corners
of the big square, producing the picture below—the unique solution
to the puzzle, up to reflection.
Unbroken Lines
Can you re-arrange the 16 square tiles below into a 4 × 4 square—
no rotation allowed!—in such a way that no line ends short of the
boundary of the big square?
144
Working for the System
[See Notes & Sources for the composer and inspiration behind this
and the next puzzle.]
Similar, but harder:
Unbroken Curves
Can you re-arrange the 16 square tiles below into a 4 × 4 square—
no rotation allowed!—in such a way that no curve ends short of the
boundary of the big square?
145
Mathematical Puzzles
Conway's Immobilizer
Three cards, an ace, a deuce, and a trey, lie face-up on a desk in some
or all of three marked positions (“left,” “middle,” and “right”). If they
are all in the same position, you see only the top card of the stack; if
they are in two positions, you see only two cards and do not know
which of them is concealing the third card.
Your objective is to get the cards stacked on the left with ace on
top, then deuce, then trey on bottom. You do this by moving one card
at a time, always from the top of one stack to the top of another (pos-
sibly empty) stack.
The problem is, you have no short-term memory and must, there-
fore, devise an algorithm in which each move is based entirely on
what you see, and not on what you last saw or did, or on how many
moves have transpired. An observer will tell you when you’ve won.
Can you devise an algorithm that will succeed in a bounded number
of steps, regardless of the initial configuration?
Solution: Since there aren’t that many things you can do, it’s tempt-
ing to try some arbitrary set of rules and see if they work. Actually,
there’s a surprising number of different algorithms possible with the
above constraints—more than a quintillion. So some reasoning will
be needed. But it’s tricky to design an algorithm that makes progress,
146
Working for the System
147
Mathematical Puzzles
148
Working for the System
length (the unit being 100 furlongs = 12 12 miles), having the following
property: Every three vertices contain an edge.
If there were only three vertices, we could of course arrange them
as an equilateral triangle of side 1, and get more: an edge between
every pair of vertices. In fact, two of these equilateral triangles (say,
ABC and DEF ), no matter their relative position, would get us a
six-vertex solution. Why? Because any three vertices would include
at least two in one of the two triangles, and there’s our edge.
So let’s see if we can add a seventh vertex, call it G, to our two
triangles. Then we only have to worry about sets of three vertices that
contain vertex G.
We can’t connect G to all three vertices of one of our triangles, but
we can connect it to two (say, A and B from the first triangle, and D
and E from the second) by making diamonds AGBC and DGEF that
share vertex G. That leaves just one set of three vertices without and
edge: the set {G, C, F }. No problem: We just angle the two diamonds,
hinged at G, so that their far ends are a unit distance apart. Done!
Here’s what it looks like:
This graph is known as the “Moser spindle,” and it’s the only
graph with the desired property.
Theorem. Suppose seven distinct points in the plane have the property that
among any three of them, there are two that are exactly a unit distance apart.
Then the graph on those seven points, defined by inserting an edge between
each pair that are a unit distance apart, is the Moser spindle.
149
Mathematical Puzzles
150
12. The Pigeonhole
Principle
The pigeonhole principle is nothing more than the evident fact that if n
pigeons are to be housed in m holes, and n > m, then some hole must
contain more than one pigeon. Yet this principle has wide-ranging
application, and is the key to proving some surprising statements and
some important mathematical truths.
First, a warm-up.
151
Mathematical Puzzles
For the shoes, you could have one shoe from each pair, six in all;
so you need seven to guarantee a pair.
For the socks, one black and one gray will not work but the third
sock gets you a pair.
The gloves are yet another issue: You need a right- and a left-
hander, so the biggest disaster would be six brown all left or all right,
and six tan, also all left or all right. So 13 gloves are required, although
you would have to count yourself very unlucky indeed to take only 12
and not get a match!
The same idea is easily employed in certain poker calculations. A
standard deck of 52 playing cards contains 13 cards of each suit, and
within each suit, an ace, deuce, 3, 4, etc. up to 9, 10, jack, queen, king.
Thus there are four cards of each rank.
A poker hand is five cards. Two cards of the same rank constitute
a pair; three, trips (or “three of a kind”). Five cards of the same suit
make a flush; five cards of consecutive ranks (including 5432A as well
as AKQJ10) make a straight.
152
The Pigeonhole Principle
Polyhedron Faces
Prove that any convex polyhedron has two faces with the same num-
ber of edges.
No, because there are 36 vertices on the boundary of the grid, and
no non-vertical, non-horizontal line can cover more than two of them.
153
Mathematical Puzzles
Solution: The first issue to be addressed here is: When do two lat-
tice points, say (a, b, c) and (d, e, f ), have another lattice point on the
line segment between them? A moment’s thought will convince you
that this happens when the numbers a−d, b−e, and c−f have a com-
mon divisor. The “easiest” common divisor for them to have is 2, and
154
The Pigeonhole Principle
this will happen if a−d ≡ b−e ≡ c−f ≡ 0 mod 2, that is, if the two
vectors have the same parity coordinatewise. When that happens, the
midpoint of the two vectors is a lattice point.
But there are only 23 = 8 parities available, so by pigeonhole, we
can’t have nine points in our set. Can we have eight? Yes, just take the
corners of a unit cube.
Here’s another number problem.
155
Mathematical Puzzles
Line Up by Height
Yankees manager Casey Stengel famously once told his players to
“line up alphabetically by height.” Suppose 26 players, no two ex-
actly the same height, are lined up alphabetically. Prove that there
are at least six who are also in height order—either tallest to shortest,
or shortest to tallest.
Solution: Let’s try small numbers to see what’s going on. Two play-
ers are, obviously, enough to get two that are also in height order one
way or the other. Three or four players won’t get you any more: For
example, their heights could be 73′′ , 75′′ , 70′′ , and 72′′ respectively.
But five players will get you three in height order; by the time you
reach that fifth player (say, Rizzuto) alphabetically, there’s a previous
player (say, Berra) who’s got both a taller and shorter player before
him. Then, whether Rizzuto is taller or shorter than Berra, he ends a
height-order subsequence of length 3.
This reasoning suggests a sort of “dynamic programming” ap-
proach to the 26-player problem. Give each player two numbers, an
“up” number and a “down” number. The up number records the
length of the longest height-increasing subsequence that ends with
that player, and the down number is defined analagously. For exam-
ple, in the height sequence 73′′ , 75′′ , 70′′ , 72′′ from above, the up-
down number pairs would be (1,1), (2,1), (1,2), and (2,2).
Notice these are all different—they have to be! Rizzuto and Berra,
for instance, can’t have the same pair because if the alphabetically
later player (Rizzuto) is taller his up number would be higher, and if
shorter, his down number would be higher.
Now we see why five players guarantees a subsequence of three
in height order: Only four different up-down pairs can be made of
numbers less than 3. Similarly, if there were no height-order subse-
quence of 26 players of length 6, all the up-down pairs would have to
be made up of numbers from 1 to 5 and there are only 25 of those. By
the pigeonhole principle, there must be a player with an up-number
or down-number of 6.
The key relationship is that if a subsequence of length k+1 is
sought, you need the number of players to be greater than k 2 . Still
more generally, if the number of players is at least jk+1, you are
guaranteed either a height-increasing subsequence of length j+1 or a
height-decreasing subsequence of length k+1. The argument is the
same: If you didn’t have either such subsequence, the number of
156
The Pigeonhole Principle
up-down pairs would be limited to jk, and since the pairs are all dif-
ferent, you get a pigeonhole contradiction.
In fact, this last statement is known as the Erd˝os–Szekeres The-
orem, and can be even further generalized (with almost the same
pigeonhole proof) to a statement about height and width of par-
tially ordered sets—for those readers who know what they are.
The Erdős–Szekeres Theorem is “tight” in the sense that if there
are only jk players, you might indeed be limited to length j for
height-increasing subsequences and k for height-decreasing. An ex-
ample: If, say, j = 4 and k = 3, the heights (in inches) could be
76, 77, 78, 79, 72, 73, 74, 75, 68, 69, 70, 71.
Here’s a related problem where we can use a similar idea.
157
Mathematical Puzzles
158
The Pigeonhole Principle
159
Mathematical Puzzles
To get this idea to work we put each set of dice in some fixed
left-to-right order. Amazingly, it doesn’t matter a bit what orders we
choose. Let ri be the sum of the first i red dice, reading the dice from
left to right, and similarly let bj be the sum of the leftmost j black dice.
We claim that there are contiguous subsets of the red and of the black
dice with the same sum.
A subset is “contiguous” if it is a substring of the dice as laid out,
for
(n+1)example, all the red dice from the third to the seventh. There are
2 = n(n+1)/2 such subsets of each color, because we can get one
by choosing two of the n+1 spaces between or at the ends of the dice
in which to put down supermarket dividers. It’s hard to believe that
we can get away with limiting ourselves, in this seemingly arbitrary
manner, to just these few of the exponentially many subsets of each
color. Can this really work no matter how the dice are rolled, and no
matter how we order them?
We can assume rn < bn ; if they are equal we’re done, and if the
inequality goes the other way we can just switch the roles of the colors.
Let us find, for each i, the j for which bj comes closest to ri without
exceeding it. More formally, let
j(i) = max{j : bj ≤ ri }
with the understanding that b0 = 0, and thus j(i) may be zero for
some small i’s if the red sequence starts with smaller numbers than
the black sequence.
Now let’s look at the discrepancies ri − bj(i) . All are non-negative
by definition of j(i); moreover, all are less than n, because if ri − bj(i)
were equal to n or more, we could have thrown in the next black die
without exceeding ri . (Since rn < bn , there always is a next black die.)
If any of the discrepancies ri − bj(i) is zero, we’re done, so we can
assume all the discrepancies are among the numbers 1, 2, . . . , n−1.
There are n such discrepancies, one for each i, so there most be two
that are equal; in other words, there are two distinct indices i < i′
with
ri′ − bj(i′ ) = ri − bj(i) .
Now we play the subtraction game, concluding that the red dice
from number i+1 up to number i′ must add up to the same value as
the black dice from number j(i)+1 up to number j(i′ ). Done!
Our last puzzle looks perhaps less like a pigeonhole problem than
its predecessors, but now that you’ve seen the subraction trick, you
won’t be fooled. Nonetheless, it’s not easy.
160
The Pigeonhole Principle
Zero-sum Vectors
On a piece of paper, you have (for some reason) made an array whose
rows consist of all 2n of the n-dimensional vectors with coordinates
in {+1, −1}n —that is, all possible strings of +1’s and −1’s of length
n.
Notice that there are lots of nonempty subsets of your rows which
sum to the zero vector, for example any vector and its complement;
or the whole array, for that matter.
However, your 2-year-old nephew has got hold of the paper and
has changed some of the entries in the array to zeroes.
Prove that no matter what your nephew did, you can find a
nonempty subset of the rows in the new array that sums to zero.
Solution: The technique used in Same Sum Dice suggests that to get
a set of new rows that sum to zero, we might try to build a sequence
of new rows and use pigeonhole to argue that two of its partial sums
coincide; then the portion of the sequence between those two partial
sums will add to the zero vector.
To make that work, the sequence will have to be designed so that
the partial sums belong to some small set. How small can we make it?
Would you believe that we can force all the partial sums to be {0, 1}-
vectors?
We can certainly start the list with a {0, 1}-vector: We just take the
row u′ that used to be u = ⟨1, 1, 1, . . . , 1⟩. If our nephew happened to
have changed all of u’s coordinates to zeroes, we’re done. Otherwise,
there will be some 1’s in u′ , and we need to choose the next row v ′
in our sequence in such a way that u′ + v ′ has all of its coordinates
in {0, 1}. But we can do that by choosing v to be the vector that has
−1 in the places where u′ is 1, and +1 in the places where u′ is zero.
Then no matter how v was altered by your nephew, u′ + v ′ will have
the desired property.
We continue this procedure as follows: At time t, t altered rows
have been put on our sequence and all partial sums, including the sum
x of all t of them, are {0, 1}-vectors. Let z be the original row with −1
wherever t has a 1, and +1 wherever t has a 0; add z’s altered form z ′
to the sequence.
Since there are only finitely many {0, 1}-vectors of length n, we
will eventually hit the same sum twice; let us stop when this happens
for the first time. (We consider the 0th partial sum to be the zero vec-
tor, so one way this can happen is for the zero vector to arise again as
a partial sum.) Call the vectors w1 , w2 , . . . , so that our critical time is
161
Mathematical Puzzles
Theorem. For any irrational number r, if {nr} is the fractional part of nr,
then the numbers {r}, {2r}, {3r}, . . . are dense in the unit interval.
Proof. Fix some irrational r. Of course {nr} is never zero for any
positive integer n, but we can borrow an idea from the Zeroes and Ones
puzzle above to show that we can choose n to get nr is as close as we
want to an integer.
Let 1 ≤ i < j. If {ir} < {jr}, , then {(j−i)r} = {jr} − {ir};
if {ir} > {jr}, then {(j−i)r} = 1 − ({ir}−{jr}). Pick any ε > 0,
and let m be an integer bigger than 1/ε. Divide the unit interval into
m equal intervals; by pigeonhole, one of those little intervals (each of
length < ε) contains two of the values {r}, {2r}, . . . , {(m+1)r}. Let
those be {ir} and {jr} with i < j; then if k = j−i, we conclude that
either {kr} < ε or 1−{kr} < ε.
Suppose that the former inequality holds, that is, {kr} < ε. Given
any real value x ∈ [0, 1], let p be the greatest integer such that p{nr} <
x. Then {pkn} = p{kn} < x ≤ (p+1){kr} but the outside quatities
differ by {kr} which is less than ε, so in particular |x−{pkr}| < ε and
we have our approximation.
If instead 1−{kr} < ε, we take p to be the greatest integer
such that p(1−{kr}) > 1−x, and a similar argument again shows
|x−{pkr}| < ε. ♡
162
13. Information, Please
The basis of this chapter is simple: If you want to distinguish among n
possibilities, you have to do something that results in at least n differ-
ent possible outcomes. A common puzzle application is to balance-
scale problems.
Each weighing by a balance scale can produce at most three out-
comes: tilt left (L), tilt right (R), or balance (B). If you are permitted
two weighings, you get 3×3 = 9 possible outcomes: LL, LR, LB, RL,
RR, RB, BL, BR, and BB. Similarly, with w weighings you could have
as many as 3w outcomes, but no more.
So, if a puzzle gives you a bunch of objects to test, k possible an-
swers, and allows w weighings on a balance scale, the first thing to
ask yourself is whether k ≤ 3w . If not, the task is impossible (or you
have missed some trick in the wording). If you do have k ≤ 3w , the
task may or may not be possible, and you can use the idea above to
help you construct a solution or to prove impossibility.
Here’s a classic example.
163
Mathematical Puzzles
In fact k can’t be more than 4 because then “tilt left” would lead to
10 > 32 possible outcomes. So we have reached a firm conclusion:
If the task can be done, it must be right to put 4 coins against 4 (say,
coins ABCD against EFGH) in the first weighing.
Suppose they balance. Then the temptation is to put 1 against
1 or 2 against 2 of the remaining coins, but either is information-
theoretically deficient: If 1 balances against 1, four (so, more than
three) possibilities remain; if 2 tilts against 2, again four possibilities
remain. Either way one more weighing is insufficient. So we must use
the known-genuine coins A through H in the second weighing, and
the easiest thing to do is put three of them against three of the sus-
pect coins (say, IJK). If they balance, coin L is counterfeit and we can
weigh it against A to determine whether it is light or heavy. If IJK are
light or heavy, test I against J.
If the initial 4-against-4 weighing tilts left, so that either one of
ABCD is heavy or one of EFGH is light, put (say) ABE against CDF.
If they balance, the culprit is a light G or H and you can test either
against the genuine L. If they tilt left, you’re left with A or B heavy or
F light and you can determine which by putting A and F against two
genuine coins, say K and L; the solution is similar if CDF outweigh
ABE.
Now suppose you are given the same problem but with 13 coins.
There are now 26 possible outcomes, which is still less than or equal to
27, but our previous reasoning already showed that nonetheless three
weighings are not enough. Why? Because we saw that 5-against-5 in
the first weighing is no good, while 4-against-4, when they balance,
leaves five coins—too many—untested.
164
Information, Please
165
Mathematical Puzzles
Attic Lamp
An old-fashioned incandescent lamp in the attic is controlled by one
of three on–off switches downstairs—but which one? Your mission is
to do something with the switches, then determine after one trip to the
attic which switch is connected to the attic lamp.
Solution: This seems not to be doable: There are three possible an-
swers (as to which of three switches controls the bulb), but when you
get to the attic either the bulb is on or off. So only one bit of informa-
tion is available, and we need a “trit.”
Is there anything that can be observed about the bulb other than
whether it is on or off ? There’s a hint in the puzzle wording: It’s an
incandescent bulb, whose efficiency is limited by its habit of putting
out quite a lot of heat as well as light. So you could feel the bulb and
see if it’s hot; can that help?
Yes. Flip switches A and B on, wait 10 minutes or so, then flip
switch B off. Go quickly up to the attic: If the bulb is on, it’s switch
A; if off but warm, switch B; off but cold, switch C.
You could even do four switches: Flip A and B on, wait 10 min-
utes, then flip B off and C on and run up the stairs. The four possible
states of the bulb (on/warm, off/warm, on/cool, or off/cool) will tell
you what you need to know.
166
Information, Please
Solution: Tristan and Isolde can, in advance, label the 16 teams (in
alphabetic order, perhaps) by the binary numbers 0000 through 1111.
Then, when the time comes, Tristan can send Isolde eight bits: the
four bits corresponding to one team, and the four bits corresponding
to the other one. Isolde can then send back a 0 if the winning team
was the one with the smaller number, and a 1 otherwise. That comes
to nine bits, and we can trim that to 8 by noting that the number of
unordered pairs of teams is only 16 × 15/2 = 120 < 27 and thus
Tristan can code the matchup with only seven bits.
But an easier and faster solution is to just have Isolde send Tristan
the four bits corresponding to the winning team. Surely, we can’t do
any better than four bits, right?
Amazingly, we can! We can code those four positions (leftmost,
next-to-left, next-to-right, rightmost) by, say, 00, 01, 10, and 11 re-
spectively. The codes of the two playing teams must differ in at least
one of the four positions; Tristan picks such a position and sends its
code (two bits) to Isolde. She now only needs to look at the value
of the bit in that position of the winning team and sent it to Tristan.
Three bits total!
For example, suppose the playing teams are 0010 and 0110, and
0110 won. The only position where the playing teams differ is the
next-to-left, code 01, so Tristan sends “01” to Isolde. She checks the
next-to-left position of the winning team—it is a “1”—and sends it
back to Tristan. Done.
It is not hard to show three bits is unbeatable. Note that in the
most efficient communication scheme, more information is passed
from the student to the teacher than vice-versa. Is there a lesson to be
learned from that?
Here’s another example where we need to think about informa-
tion, and also to be clever.
Missing Card
Yola and Zela have devised a clever card trick. While Yola is out of the
room, audience members pull out five cards from a bridge deck and
hand them to Zela. She looks them over, pulls one out, and calls Yola
into the room. Yola is handed the four remaining cards and proceeds
to guess correctly the identity of the pulled card.
How do they do it? And once you’ve figured that out, compute
the size of the biggest deck of cards they could use and still perform
the trick reliably.
167
Mathematical Puzzles
52 · 51 · 50 · 49 = 6,497,400,
168
Information, Please
the pile of four, so already Yola will know the suit of the removed
card. The remaining three of the four can be ordered six ways, and
Yola will use that info to determine the rank of the missing card.
Here’s how. Yola and Zela fix an ordering of all the cards, per-
haps A,2,3,... up to 10,J,Q,K, with ties broken by suit (the traditional
magician’s ordering of suits is the “CHaSeD” order, namely Clubs,
Hearts, Spades, Diamonds). Let the three cards in question be called
A, B, and C, according to the ordering above. If they are handed to
Yola in order ABC, that codes the number 1; if ACB, the number 2;
BAC = 3, BCA = 4, CAB = 5, and CBA = 6.
Yola looks at the rank of the top card and adds her code number
to it, going “around the corner” if necessary. For example, suppose
the top card is the queen of spades, and the order of the other three
cards is CAB. Since the code of CAB is 5 and the queen is rank 12 of
13, Yola adds 5 to 12: 13=K, 14=1=A, 2, 3, 4. She concludes that the
missing card is the 4 of spades.
Wait, suppose the missing card had been the 6 of spades; then
Yola would have had to add 8 to the Q, and there’s no code 8. Not
to worry: In that case, Zela would have removed not the 6 of spades
but the Q of spades; and adding 6 gets you from 6 to queen. In other
words, given two cards of the same suit, we can always pick one so
that you can get to the other by adding a number from 1 to 6. ♡
Yes, this will take some practice on the part of Yola and Zela.
There’s actually quite a bit of “room” in this trick. Information-
(n)
theoretically,
(n) it can be done with a deck of any size n satisfying 5 ≤
4! × 4 which is true up to n = 124. In fact, you really can do it with
a deck of size 124, but we will leave it to you, the reader, to figure out
how.
Peek Advantage
You are about to bet $100 on the color of the top card of a well-shuffled
deck of cards. You get to pick the color; if you’re right you win $100,
otherwise you lose the same.
169
Mathematical Puzzles
Bias Test
Before you are two coins; one is a fair coin, and the other is biased
toward heads. You’d like to try to figure out which is which, and to
do so you are permitted two flips. Should you flip each coin once, or
one coin twice?
Solution: Suppose you only get one flip. If you flip coin A and it
comes up heads, you will of course guess that it is the biased coin; if
it comes up tails, that it is the fair coin.
Now if you flip coin B and get the opposite face, you will be even
happier with your previous decision. If you get the same face, you will
be reduced to no information and may as well stick with the same
choice. Thus, as with the card-peeking, flipping the second coin is
worthless.
Could flipping the same coin twice change your mind? Yes. If you
get heads the first time you are inclined to guess that coin is biased, but
seeing tails the next time will change your best guess to “unbiased.”
We conclude that flipping one coin twice is strictly better than flipping
each coin once.
170
Information, Please
Dot-Town Exodus
Each resident of Dot-town carries a red or blue dot on his (or her) fore-
head, but if he ever thinks he knows what color it is he leaves town
immediately and permanently. Each day the residents gather; one
day a stranger comes and tells them something—anything—nontrivial
about the number of blue dots. Prove that eventually Dot-town be-
comes a ghost town, even if everyone can see that the stranger’s statement
is patently false.
171
Mathematical Puzzles
172
Information, Please
same dot-color so they all leave together on the nth night. It follows
that Dot-town is always deserted within n days.
It is perhaps worth noting also that the definition of db makes no
distinction between S and its complement; from this it follows that
it makes no difference whether the stranger says “X” or “not X,” the
residents of Dot-town will behave exactly the same way in either case.
You might reasonably wonder whether the Dot-town residents,
knowing that a stranger is coming and liable to break the manifestly
justifiable no-talk-about-dot-colors taboo, can organize some defense.
For example, everyone who knows the stranger is lying jumps up and
says so. Alas, a little thought will show you that neither this nor any
similar strategy can save the town. A fragile lot, these Dot-towners.
A whole class of puzzles is built around conversations in which
the speakers take several rounds to make a deduction. Your job is to
deduce something of your own from the conversation, even though
you have less information than the speakers!
My favorite of these is the following. Part of the beauty of this one
is that no numbers are named in the puzzle statement.
Conversation on a Bus
Ephraim and Fatima, two colleagues in the Mathematics Department
at Zorn University, wind up seated together on the bus to campus.
Ephraim begins a conversation with “So, Fatima, how are your
kids doing? How old are they now, anyway?”
“It turns out,” says Fatima as she is putting the $1 change from the
bus driver into her wallet, “that the sum of their ages is the number of
this bus, and the product is the number of dollars that happen to be
in my purse at the moment.”
“Aha!” replies Ephraim. “So, if I remembered how many kids you
have, and you told me how much money you are carrying, I could
deduce their ages?”
“Actually, no,” says Fatima.
“In that case,” says Ephraim, “I know how much money is in your
purse.”
What is the bus number?
173
Mathematical Puzzles
otherwise Ephraim would have been able to deduce the kids’ ages
from sum, product and number of kids.
One would expect that large values of n would tend to have this
property; what prevents any large number from being the answer? Ah,
the last line of the conversation shows that there can’t be two pairs of
kids’-age-sets with sum n, one pair sharing one product, the other
sharing a different product. If there were two such pairs, Ephraim
would not have been able to deduce the amount of money in Fatima’s
purse at the conversation’s end.
Bus number n = 13 is such an example. Fatima could have five
kids of ages 6, 2, 2, 2, and 1, or of ages 4, 4, 3, 1, and 1; either would
put $48 in her purse. But she could instead have three kids of ages 9,
2, and 2, or of ages 6, 6, and 1; those possibilities would both give her
purse $36. So even with the information that knowing the number of
kids and purse contents (in addition to the bus number) would not
have been sufficient to deduce the kids’ ages, Ephraim would still not
be in a position to deduce the purse contents if the bus number had
been 13.
What about higher numbers? Here’s the crucial observation: Once
you’ve hit a number with 13’s “ambiguity” property, every higher
number has it too! Why? Because you can take those four sets of kids’
ages and add one kid of age 1 to each one of them. That changes no
products but raises all the sums by 1, so if n is ambiguous, so is n+1.
Now it’s time to do the math, checking values of n below 13 to
try to find one that boasts exactly one pair of kids’-age-sets with the
same number of kids, sum n, and the same product. That’s not as time
consuming as it sounds, because (a) you only need consider sets of size
at least three (one or two numbers can always be deduced from their
sum and product), and (b) many products yield the kids’ ages readily
on account of unique prime factorization.
Turns out the puzzle-composer has not misled you: There is just
one bus number that qualifies, n = 12. The critical kids’-age-sets are
{4, 4, 3, 1} and {6, 2, 2, 2}.
The next example illustrates the complexities of trying to commu-
nicate and play a game at the same time.
Matching Coins
Sonny and Cher play the following game. In each round, a fair coin
is tossed. Before the coin is tossed, Sonny and Cher simultaneously
174
Information, Please
declare their guess for the result of the coin toss. They win the round if
both guessed correctly. The goal is to maximize the fraction of rounds
won, when the game is played for many rounds.
175
Mathematical Puzzles
Two Sheriffs
Two sheriffs in neighboring towns are on the track of a killer, in a case
involving eight suspects. By virtue of independent, reliable detective
work, each has narrowed his list to only two. Now they are engaged
in a telephone call; their object is to compare information, and if their
pairs overlap in just one suspect, to identify the killer.
The difficulty is that their telephone line has been tapped by the
local lynch mob, who know the original list of suspects but not which
pairs the sheriffs have arrived at. If they are able to identify the killer
with certainty as a result of the phone call, he will be lynched before
he can be arrested.
Can the sheriffs, who have never met, conduct their conversation
in such a way that they both end up knowing who the killer is (when
possible), yet the lynch mob is still left in the dark?
176
Information, Please
AB CD EF GH
AC BD EG FH
AD BC EH FG
AE BF CG DH
AF BE CH DG
AG BH CE DF
AH BG CF DE
Let’s name the sheriffs Lew and Ralph. Lew can share the above array
with Ralph over the phone and then tell Ralph which row his pair (i.e.,
the pair of suspects to which Lew has narrowed down his search) lies
in. If Ralph’s pair lies in the same row, he tells Lew; that means the
two sheriffs have arrived at the same pair, so they may as well hang
up.
Otherwise, Ralph announces a partition of the row into sets of two
pairs each, with the property that Ralph’s two final suspects are in the
same part.
For example, suppose Lew’s pair is EF . Then he announces that
his pair is in the first row. If Ralph’s pair is F G, he partitions that row
into one part consisting of the pairs AB and CD, and another con-
taining the pairs EF and GH. (At this point, Lew and Ralph already
have established a shared secret: They both know which part the killer
is in.)
Lew now reveals whether his pair is the leftmost or rightmost in its
part of the row (in this case, it’s the leftmost). That tells Ralph which
pair is Lew’s, and hence who the killer is (here, F ). To communicate
that safely to Lew, he just tells Lew whether the killer is the left or the
right member of Lew’s pair (here, the rightmost).
The conversation would be identical if the pairs had been AB and
BC, making B the killer instead of F . We hope that the mob either
refuses to chance lynching an innocent person, or doesn’t have enough
rope for two.
177
Mathematical Puzzles
Suppose Eve has the time and computing power to test every pos-
sible key, looking for one which, when used to decrypt the message
she intercepted, yields a credible possibility for the message Alice in-
tended Bob to get. When might this work?
If the number of possible keys is small, Eve can expect that only
one will yield an intelligible message; but if it’s large, many might do
so. Information theory can give us an idea of how many possible keys
there should be, in order for Alice and Bob to be safe.
Suppose that for every choice of message Alice might have wanted
to send Bob on this occasion, and every “cyphertext” x1 , . . . , xn that
Eve might intercept, there is a unique key that would encrypt that
message as x1 , . . . , xn . Then, assuming the key was chosen uniformly
at random and Eve doesn’t know it, we have an easy conclusion.
Theorem. In the above situation, Eve can gain no information whatever
about Alice’s intended message.
Proof. Since any message could have been intended, each associ-
ated with one key, and all keys are equally likely, Eve learns nothing.
♡
There actually is a cryptographic scheme that achieves this goal—
assuming accurate random generation and perfect secrecy in the key
choice. It’s called a “one-time pad,” and here’s an example of how it
could work. Alice translates her intended message into a stream of n
0s and 1s (by some means that Bob needs to know and Eve may also
know). Then she extracts the next n bits from the one-time pad that
she and Bob share, and adds those bits one by one, modulo 2, to the
message bits. For example, if the message is 00101110 and the bits
from the one-time pad are 01001001, then the encrypted message is
01100111 and this is what Alice sends (and Eve intercepts).
Bob, who knows where he and Alice are in the one-time pad, takes
his received message 01100111 and, one by one, adds the one-time
pad bits 01001001 to it to get the original message, 00101110, in-
tended by Alice. (This works nicely because modulo 2, addition and
subtraction are equivalent. Much more about this useful kind of arith-
metic is found in Chapter 17.)
Eve is kept completely in the dark, because looking only at
01100111, any eight-bit message could have been intended by Alice.
As its name suggests, the security of the one-time pad is heavily
dependent on each bit of the pad being used only once, and in only
one message. Otherwise a “depth” is created and Eve may be able to
crack the code.
178
Information, Please
The difficulty with one-time pads is that if Alice and Bob are plan-
ning any long conversations, they need to share (and keep private) a
great many bits. In most applications, keys are much shorter than
messages, and the security of encryption relies on Eve not having the
time and/or computing power to test enough keys.
179
14. Great Expectation
The expectation or expected value of a random number is the average
value that is anticipated (via the Law of Large Numbers) when the
random number is “redrawn” independently many times. If the ran-
dom number can take only finitely or countably many values (e.g.,
if it takes only integer values), we can define its expectation as the
average of the values, weighted by their probabilities.
Numbers whose values are determined by chance are called by
probabilists random variables, and denoted typically by boldface capital
letters from the end of the Latin alphabet, such as X. If X’s possible
values are x1 , x2 , . . . with corresponding probabilities p1 , p2 , . . . , then
the expectation of X is
∑
EX := p i xi .
i
181
Mathematical Puzzles
1/36, 2/36, . . . , 5/36, 6/36, 5/36, . . . , 1/36. But if X and Y are both
the outcome of the first roll, that is, if X = Y, then X+Y = 2X takes
on only even values from 2 to 12, each with probability 16 . And if Y
happens to be defined as 7 − X, we find that X + Y is the constant
value 7. All very different, but notice that in every case E(X + Y) =
3 12 + 3 12 = 7.
This miracle is a special case of what mathematicians call “linear-
ity of expectation,” whose general formulation is
∑ ∑
E ci Xi = ci EXi ,
i i
Solution: You should not bid. If you do bid $x, then the expected
value to the widget’s owner, given that he sells, is $x/2; thus, its expected
value to you, if you get it, is 1.8 · $x/2 = $0.9x. Thus you lose money
on average if you win, and of course, you gain or lose nothing when
you do not, so it is foolish to bet. ♡
One common setting for expectation is waiting time; in particu-
lar, the average number of times you expect to have to try something
until you succeed. For example, how many times, on average, do you
need to roll a die until you get a 6? We encountered this sort of prob-
lem in Odd Run of Heads in Chapter 5. Let x be the expected number
of rolls. “If at first you don’t succeed” (probability 56 ) you still have
an average of x rolls to “try, try again,” so x = 1 + 56 · x giving x = 6.
The same argument shows that in general, if you conduct a series of
“trials” each of which has probability of success p, then the average
number of trials you need to get your first success is 1/p.
Let’s apply this observation to a slightly trickier dice puzzle.
182
Great Expectation
Spaghetti Loops
The 100 ends of 50 strands of cooked spaghetti are paired at random
and tied together. How many pasta loops should you expect to result
from this process, on average?
183
Mathematical Puzzles
Solution: The key here is to recognize that you start with 100
spaghetti-ends and each tying operation reduces the number of
spaghetti-ends by two. The operation results in a new loop only if the
first end you pick up is matched to the other end of the same strand.
At step i there are 100−2(i−1) ends, thus 100−2(i−1)−1 = 101−2i
other ends you could tie any given end to. In other words, there are
101−2i choices of which only one makes a loop; the others just make
two strands into one longer one.
It follows that the probability of forming a loop at step i is 1/(101−
2i). If Xi is the number of loops (1 or 0) formed at step i, then the
expected value of Xi is 1/(101 − 2i). Since X := X1 + · · · + X50 is
the final number of loops, we apply linearity of expectation to get
1 1 1 1 1
EX = EX1 +· · ·+EX50 = + + +· · ·+ + = 2.93777485 . . . ,
99 97 95 3 1
less than three loops! ♡
For the last two puzzles, the summands were independent random
variables—we didn’t actually need to know that independence is not
required for linearity of expectation. Independence of two events A
and B means that the probability they both occur is the product of
their individual probabilities, so, for example, if we wanted to know
the probability of getting all six numbers in only six rolls of a die, we
could have obtained it as
5 4 3 2 1 6!
1· · · · · = 6 ∼ 1.5%.
6 6 6 6 6 6
For all the spaghetti to end up in one big loop, you must never
tie a strand to its other end except at the last step; in other words,
X1 , . . . , X49 must all be zero. This happens with probability
98 96 94 2
· · · ··· ·
99 97 95 3
49! · 249 49!2 · 298
= = = 0.12564512901 . . . ,
99!/(49! · 249 ) 99!
so about one time in eight.
184
Great Expectation
Ping-Pong Progression
Alice and Bob play table tennis, with Bob’s probability of winning
any given point being 30%. They play until someone reaches a score
of 21. What, approximately, is the expected number of points played?
Solution: With high probability, Alice will win, and thus the ex-
pected number of points won by Bob is (3/7)21 = 9 and therefore the
expected total number of points is close to 30. Another way to make
that calculation: Since Alice wins any given point with probability
70%, it takes on average 1/0.7 = 10/7 rallies to earn Alice a point,
thus 21 × 10/7 = 30 rallies on average for her to get to 21.
The actual answer is a bit less than 30, because playing until Alice
scores 21 points is sufficient, but not always necessary, to finish the
game. How much less?
To find out, we employ a bit of statistics (readers not familiar with
variance and normal approximations are invited to skip to the next
puzzle).
The probability of Bob winning is equal to the probability that he
wins the majority of the first 41 points. Let Xi = 1 if Bob wins the
ith point, 0 otherwise. The variance of Xi is 0.3 × 0.7 = 0.21, thus
the√standard deviation of the number of points Bob wins out of 41
is 41 × 0.21 = 2.9343. His expected score being 0.3 × 41 = 12.3,
we apply the normal approximation with the intent of computing the
probability that Bob’s score exceeds 20.5; that amounts to (20.5 −
12.3)/2.9343 ∼ 2.795 sigmas, which works out to a probability of
about 0.0000387. If Bob does win, he’ll win by about 2 points on
average, leading to 40 points played instead of the approximately 43
points needed if we wait for Alice to hit 21. Thus, the cost to our 30-
point estimate is around 3 × 0.0000387 ∼ 0.0001.
So the result of all that work is revising our estimate to 29.9999.
Do you recall a puzzle called “Finding a Jack” from a Chapter 8?
You can use its solution technique—twice!—for the next puzzle.
Drawing Socks
You have 60 red and 40 blue socks in a drawer, and you keep drawing
a sock uniformly at random until you have drawn all the socks of one
color. What is the expected number of socks left in the drawer?
185
Mathematical Puzzles
them, starting from the beginning of the order, until all of one color
have been removed. If the color of the last sock is blue (probability
0.4), then it must have been the red socks that were all removed, and
the number of socks “left in the drawer” is the number of blue socks
encountered starting from the end of the arrangement before any red
sock is found.
If indeed the last sock is blue, there are 39 other blue socks dis-
tributed in 61 slots (before the first red sock, between the first and sec-
ond red socks, and so forth, finally after the 60th red sock). Thus, we
expect 39/61 blue socks in that last slot; adding the final blue sock
gives on average of 100/61 blue socks left in the drawer. Similarly,
if the last sock is red (probability 0.6), we have 59 other red socks in
41 slots so on average 59/41 in the last slot; that leaves 1 + 59/41
= 100/41 red socks behind. Putting these together, we have that the
expected number of socks left is 0.4 × 100/61 + 0.6 × 100/41 ∼ 2.12.
If there are m socks of one color and n of the other, the above
argument gives you an average of m/(n+1) + n/(m+1) socks left in
the drawer.
Linearity of expectation applies even when there are continuum-
many random variables. Modern mathematicians would replace the
sum by an integral, but sometimes an Archimedean approach will do
the trick.
Random Intersection
Two unit-radius balls are randomly positioned subject to intersecting.
What is the expected volume of their intersection? For that matter,
what is the expected surface area of their intersection?
Solution: We can assume that the center of the first ball is at the
origin of a three-dimensional coordinate system; the first ball thus
consists of all points in space within distance 1 of the origin. The cen-
ter C of the second ball must be somewhere in the ball of radius two
about the origin, in order for it to intersect the first ball. The condi-
tions of the problem imply that C is uniformly random subject to this
constraint.
(Note that this is not at all the same as taking the center of the
second ball to be a random point between −2 and 2 on the x-axis.
The latter assumption would give a much-too-big expected intersec-
tion size of π/2.)
186
Great Expectation
Now consider a point P inside the first ball: What’s the probability
that P will be in the intersection of the two balls? That will happen
just when C falls in the unit ball whose center is P . This ball is inside
the ball of radius 2 about the origin that C is chosen from, with 1/23 =
1/8 of the volume. Thus the probability that P lies in our intersection
is 1/8, and it follows from linearity of expectation that the expected
volume of the intersection is 1/8 times the volume of the first ball,
that is, 1/8 × 4π/3 = π/6.
If it seems fishy to you to be adding up points P like this, good
for you! Think of P not as a point but a small cell, or “voxel,” inside
the ball. If the voxel’s volume is (4π/3)/n with the ball divided into
n voxels, n being some large integer, then an ordinary finite applica-
tion of linearity of expectation gives approximately the same answer,
π/6. It’s not exact owing to the fact that a few voxels will lie partly
inside and partly outside the intersection. As the voxels get smaller
the approximation gets better.
For the surface area of the intersection, the point P —now repre-
senting a two-dimensional pixel—is taken on the surface of the unit
ball centered about the origin. This will lie on the surface of the inter-
section if it’s inside the second ball, that is, again, if C lies in the unit
ball centered at P . We’ve already seen that this happens with prob-
ability 1/8, but note that the intersection of the two spheres has two
surfaces of the same area, one that was part of the surface of the first
ball—that’s the part that could contain P —and one that was part of
the surface of the second ball. Thus the expected surface area of the
intersection is 2 × 18 × 4π = π.
You may have noticed, by the way, that all this can be done in
any dimension; with disks on the plane, for example, you get ex-
pected area π/4 and perimeter π. You can even do it with (some)
other shapes.
One place where linearity of expectation arises frequently is in
gambling. A game is called “fair” if the expected return for each player
is 0, and we can deduce that any combination of fair games is fair.
This applies even if your choice of game, or strategy within a game,
is made “as you play” (as long as you can’t foresee the future).
Of course, in a gambling casino, the games are not fair; your ex-
pectation is negative, the casino’s positive. For example, in (Amer-
ican) roulette there are 38 numbers (0, 00, and 1 through 36) on
the wheel, but if you bet $1 on a single number and win, you earn
only $36, not $38, in return for your dollar. The result is that your
187
Mathematical Puzzles
expectation is
1 37 1
· $35 + · (−$1) = −$ ,
38 38 19
so that you lose, on average, about a nickel per dollar bet. This same
negative expectation applies also to bets made on groups of numbers
or colors.
However:
The probability that Elwyn wins exactly twice is the number of pairs
of bets times the probability of winning two specified bets and losing
188
Great Expectation
Adding these three numbers and subtracting from 1 gives the proba-
bility that Elwyn comes out ahead: 0.52417026698, better than 50%!
No, this does not mean that Elwyn has figured out how to beat
’Vegas. He comes out slightly ahead rather often but far behind quite
often as well, since winning only twice leaves him with just $72 to
show for his $105 stake. Elwyn’s negative expectation is the more rel-
evant statistic here.
If you want to go to Vegas and be able to tell your friends that you
made a profit at roulette, here’s a suggestion: Pick a number of dollars
that’s one less than a power of 2, and that you can afford to lose.
Suppose it’s $63. Then bet $1 on “red.” (Half the positive numbers
are red, so you get your dollar back and win an additional $1 with
probability 18/38, but lose your dollar otherwise.) If you do win, go
home. If you lose, bet $2 on red; if you win, go home having made a
$1 profit. If you lose, bet $4 next time, etc., until you win or have lost
your sixth straight bet ($32). At this point, you must give up or risk
ruin; fortunately the probability that you will be this unlucky is only
(20/38)6 , about 2%. Your expectation for the whole experiment is of
course still negative.
An Attractive Game
You have an opportunity to bet $1 on a number between 1 and 6.
Three dice are then rolled. If your number fails to appear, you lose
your $1. If it appears once, you win $1; if twice, $2; if three times, $3.
Is this bet in your favor, fair, or against the odds? Is there a way to
determine this without pencil and paper (or a computer)?
189
Mathematical Puzzles
and rolled by shaking the cage). Like any gambling game it is designed
to look attractive but to make money for the house, and indeed that
is the case.
The easiest way to see this is to imagine that there are six players
each of whom bets on a different number. The expectation for each
player is of course the same, since the rules don’t discriminate. If that
expectation is x then the house’s expectation must be −6x by linearity
of expectation—this is a “zero-sum game,” since no money leaves or
enters from outside.
But now if the three rolls are different, three players win and three
lose so the house breaks even. If two numbers are the same, the house
pays $2 to one player and $1 to another while picking up $1 from each
of the remaining four players, so makes a $1 profit. If all three dice
come up the same, the house pays out $3 and collects $5, making a $2
profit. So the house’s expectation is positive and therefore the players’
is negative.
(It’s not hard to work out that the probability the three rolls are
different is (6·5·4)/63 = 5/9, the probability that they are all the same
is 1/62 = 1/36, and thus the probability that just two of them match is
the remaining 15/36 = 5/12. Thus the house’s expectation is (5/12) ·
$1+(1/36)·$2 = $17/36 and each player’s expectation is thus (−1/6)·
$17/36 ∼ −$0.0787037037, so a player loses on the average about 8
cents per dollar bet—worse even than American roulette, about which
more later.)
Here’s a game which is definitely favorable; the question is, to
what extent can you turn positive expectation into a sure thing?
190
Great Expectation
bet everything for the remaining three rounds and go home with $8.
If one is red and the others black, bet 1/3 of your money on black;
if you’re right you now have $1 13 which you can double at the last
card for a final tally of $2 23 . If you’re wrong you’re down to $ 32 but
the remaining cards are both black, so you can double this twice to
again end with $2 23 . Since a similar strategy works when the remain-
ing cards are two red and one black, you have found a way to guar-
antee $2 23 .
To extend that backward and guarantee even more starts to look
messy, so let’s look at the problem another way. Whatever betting
strategy you use, you’ll certainly want to bet everything at every round
as soon as the remaining deck becomes monochromatic; let’s call
strategies with this property “sensible.”
It is useful first to consider which of your strategies are optimal
in the sense of expectation, that is, which maximize your expected
return. It is easy to see that all such strategies are sensible.
Surprisingly, the converse is also true: No matter how crazy your
betting is, as long as you come to your senses when the deck becomes
monochromatic, your expectation is the same! To see this, consider
first the following pure strategy: Imagine some fixed specific distribu-
tion of red and black in the deck, and bet everything you have on that
distribution at every turn.
Of course, you will nearly always go broke with this strategy, but
( )is then 2 × $1,
52
if you win you can buy the earth—your take-home
around 4.5 quadrillion dollars. Since there are 52 ways the colors
26 ( )
52 52
can be distributed in the deck, your expected return is $2 / 26 =
$9.0813.
Of course, this strategy is not realistic, but it is “sensible” by our
definition, and, most importantly, every sensible strategy is a combination
( )
of pure strategies of this type. To see this, imagine that you have 52 26
assistants working for you, each playing a different one of the pure
strategies.
We claim that every sensible strategy amounts to distributing your
original $1 stake among these assistants, in some way. If at some point
your collective assistants bet $x on red and $y on black, that amounts
to you yourself betting $x − $y on red (when x > y) and $y − $x on
black (when y > x).
Each sensible strategy can be implemented by a distribution of
money to the assistants, as follows. Say you want to bet $0.08 that the
first card is red; this means that the assistants who are guessing “red”
first get a total of $0.54 while the others get only $0.46. If, on winning,
191
Mathematical Puzzles
you plan next to bet $0.04 on black, you allot $0.04 more of the $0.54
total to the “red–black” assistants than to the “red–red” assistants.
Proceeding in this manner, eventually each individual assistant has
his assigned stake.
Now, any mix of strategies with the same expectation shares that
expectation, hence every sensible strategy has the same expected re-
turn of $9.08 (yielding an expected profit of $8.08). In particular, all
sensible strategies are optimal.
But one of these strategies guarantees $9.08; namely, the one in
which the $1 stake is divided equally among the assistants. Since we
can never guarantee more than the expected value, this is the best
possible guarantee.
This strategy is actually quite easy to implement (assuming as we
do that US currency is infinitely divisible). If there are b black cards
and r red cards remaining in the deck, where b ≥ r, you bet a fraction
(b − r)/(b + r) of your current worth on black; if r > b, you bet
(r − b)/(b + r) of your worth on red. You will be entirely indifferent
to the outcome of each bet, and can relax and collect your $8.08 profit
at the end.
Sometimes the notion of fair game comes in handy even when
there is no mention of a game.
Serious Candidates
Assume that, as is often the case, no one has any idea who the next
nominee for President of the United States will be, of the party not
currently in power. In particular, at the moment no person has prob-
ability as high as 20% of being chosen.
As the politics and primaries proceed, probabilities change con-
tinuously and some candidates will exceed the 20% threshold while
others will never do so. Eventually one candidate’s probability will
rise to 100% while everyone else’s drops to 0. Let us say that after the
192
Great Expectation
Rolling a Six
How many rolls of a die does it take, on average, to get a 6—given
that you didn’t roll any odd numbers en route?
Solution: Obviously, three. Right? It’s the same as if the die had
only three numbers, 2, 4, and 6, each equally likely to appear. Then
the probability of rolling a 6 is 1/3, and as we have seen in the puz-
zle Rolling All the Numbers, in an experiment that has probability of
success p, it takes, on average, 1/p trials to get a success.
193
Mathematical Puzzles
Except that it’s not the same at all. Imagine that you arrange to
compute your answer to this puzzle via multiple experiments, mak-
ing use of the law of large numbers. You start rolling your die, count-
ing trials as you go. If you hit a “6” before you get an odd number,
you record the number of trials and repeat. (For example, if you roll
“4,4,6” you record a 3.) What happens if you do roll an odd number?
Then you can’t simply throw out that roll and continue counting trials
(if you did that, you would eventually converge to 3 as your answer).
Instead, you must throw out that whole experiment, recording noth-
ing, and start anew, beginning with roll #1 of your new experiment.
That will produce a smaller average than 3, but how much smaller?
An intuitive way to look at it: When you’ve rolled a 6 with-
out rolling an odd number, there’s an inference that you succeeded
quickly—since if you took a long time to get your 6, you’d probably
have hit an odd number.
To figure out the correct answer, it helps to think about
what you’re doing in your multi-experiment. Basically, each sub-
experiment consists of rolling the die until you get a 6 or an odd num-
ber. If you counted rolls in all of these, you’d discover their average
length to be 3/2, since the probability of rolling a 6, 1, 3, or 5 is 2/3.
In your gedankenexperiment you’re only counting the sub-experiments
that end in a 6, but does that matter? The finishing roll (be it 1, 3, 5,
or 6) is independent of all that has gone before, and independence is
a reciprocal notion; thus, the number of rolls “doesn’t care” what the
sub-experiment ended with. It follows that the average length of the
subexperiments that ended with a 6 is that same 3/2.
194
Great Expectation
195
Mathematical Puzzles
But you can do better by making correlation work for you. How?
By making simultaneous bets of $1 each of the right kind. Specifically:
Bet one of your dollars on the numbers 1 through 12, and simultane-
ously, the other on 1 through 18. Then, if you do get a number between
1 and 12, you hit your $5 on the nose. If you hit a high number, you
lose it all (but at least you’ve lost it all quickly). If you happen to hit
13, 14, 15, 16, 17, or 18, you again have $2 and can repeat your double
bet.
The probability p of success for this scheme is given by
12 6
p= + · p,
38 38
which yields p = 1238 /(1 − 38 ) = 3/8 = 0.375, quite a bit better. In
6
196
Great Expectation
Next is a puzzle that you might find familiar. Posed and solved by
Georges-Louis Leclerc, Comte de Buffon in 1733, it is said to be the
very first solved problem in geometric probability.
But to solve it we will use almost no geometry, relying instead on
linearity of expectation.
Buffon's Needle
A needle one inch in length is tossed onto a large mat marked with
parallel lines one inch apart. What is the probability that the needle
lands across a line?
197
Mathematical Puzzles
get α = 2/π. We deduce that EXN = 2/π, and since (with probability
1) the needle either produces one crossing or none, the probability that
Buffon’s needle crosses a line is that same 2/π. ♡
This wonderful proof was published by T. F. Ramaley in 1969, in
a paper entitled “Buffon’s Noodle Problem.”
Here are a couple of more modern geometry problems, that seem
not to have any probability in them.
198
Great Expectation
199
Mathematical Puzzles
200
Great Expectation
201
Mathematical Puzzles
X = j is counted j times in the sum. But that’s easy: It’s counted once
for each i between 0 and j−1, so j times as required.
It’s time for our theorem, which, as promised, will be proved using
the probabilistic method.
Arguably the most famous theorem in combinatorics, the follow-
ing remarkable fact was proved in 1930 by Frank Plumpton Ramsey,
scion of a famous family of British intellectuals (and brother of Arthur
Michael Ramsey, Archbishop of Canterbury). In its simplest finite
form, Ramsey’s Theorem states that for any positive integer k there
is a number n such that if you color every unordered pair of numbers
202
Great Expectation
from the set {1, . . . , n} either red or green, then there must be a set
S of k numbers which is “homogeneous” in the sense that every pair
from S is the same color.
The least n for which this is true is called the “kth Ramsey num-
ber” and denoted R(k, k). For example, R(4, 4) turns out to be 18;
that means that for any two-coloring of the pairs of numbers between
1 and 18, there’s a homogeneous set of size 4; but this does not hold
for all colorings of pairs from the set {1, . . . , 17}. But R(5, 5) is not
known! Paul Erdős, who wrote more papers than any other mathe-
matician in history and was fascinated by Ramsey’s theorem, enjoyed
giving the following advice. If a powerful alien force demands, on
penalty of Earth’s annihilation, that we tell them the value of R(5, 5),
we should put all the computing power on the planet to work and
perhaps succeed in computing that number.
But if they ask for R(6, 6), we should attack them before they at-
tack us.
It is not hard to prove—and, ( indeed,
) we will prove it in Chap-
ter 15—that R(k, k) is at most 2r−2 2k
r−1 , which in turn is less than 2 .
What we’re going to do is use linearity of expectation to get an expo-
nential lower bound for R(k, k).
Theorem. For all k > 2, R(k, k) > 2k/2 .
The idea of the proof, published by Erdős in 1947, is to show that
a random coloring of the pairs of numbers from 1 to n = 2k/2 will,
with positive probability, have no monochromatic set of size k. Thus,
such colorings exist (although the proof does not exhibit one).
By a random coloring, we mean this: For each pair {i, j} of
numbers between 1 and n, we flip a fair coin to decide whether to
color
(k) it red or green. If we pick a fixed set S of size k, it contains
2 = k(k−1)/2 pairs and thus will be homogeneous with probabil-
2
ity 2/2k(k−1)/2 = 2(k+1)/2−k /2 .
The number of candidates for( the ) set S, that is, the2 number of
subsets of {1, . . . , n} of size k, is nk < (2k/2 )k /k! = 2k /2 /k!, thus
by linearity of expectation, the expected number of homogeneous sets
is less than
2 2 2(k+1)/2
2(k+1)/2−k /2 · 2k /2 /k! =
k!
which is equal to 1 when k = 2 and declines as k increases.
So the expected number of homogeous sets is less than 1, and we
claim that means the probability that there are no homogeneous sets
is greater than zero. One way to see this is to use the formula for
203
Mathematical Puzzles
204
15. Brilliant Induction
Induction (from the verb induce, not induct!) is one of the most elegant
and effective tools in mathematics. In its simplest form, you want to
prove something for all positive integers n; you do it by proving the
statement for n = 1 and then showing that for all n > 1, if it’s true
for n−1, it’s true for n.
More generally, when proving your statement for n, you may as-
sume it’s already true for all positive integers m < n. That assumption
is known as the induction hypothesis, or “IHOP” for short (see Notes &
Sources).
I also like the following formulation, which is even more general.
You want to show that some statement is true in all instances satis-
fying certain conditions. You do this by assuming that there is some
instance in which it is false, and focusing on such an instance which
is in some sense minimal. Then you show how this bad instance can
be turned into another bad instance that is even smaller, contradicting
your assumption that the instance you began with was minimal. You
conclude that there are no bad instances, therefore your statement is
always true.
So in a sense, induction is a special case of reductio ad absurdum—in
other words, showing that a contrary assumption leads to a contra-
diction.
Is this all a bit too abstract for you? That’s what the puzzles are
for.
205
Mathematical Puzzles
Swapping Executives
The executives of Women in Action, Inc., are seated at a long ta-
ble facing the stockholders. Unfortunately, according to the meeting
organizer’s chart, every one is in the wrong seat. The organizer can
persuade two executives to switch seats, but only if they are adjacent
and neither one is already in her correct seat.
Can the organizer organize the seat-switching so as to get every-
one in her correct seat?
Solution: Yes. Let the positions (and the executives that belong in
them) be numbered 1 to n from left to right. By induction on n, it
suffices to get executives m through n into their correct seats (for some
m ≤ n) provided the rest are still all incorrectly seated.
To do that we move executive n to the right by successive swaps
until she encounters an executive, say the ith, who’s sitting in posi-
tion i+1 and therefore would be swapped into her correct seat if we
206
Brilliant Induction
207
Mathematical Puzzles
all the bulbs except possibly bulb i. If for any i the set Si does turn off
bulb i we are done, so let’s assume no i has this property.
Choose a pair of distinct bulbs, i and j, and perform Si followed by
Sj . The result is that except for i and j, every bulb that was initially
off stays off, while every bulb that was initially on was flipped off
and then on again—thus, remains in the state it was in before. The
exceptions are bulbs i and j, which are both flipped.
It follows that if bulbs i and j are both on, we can use Si ∪ Sj to
turn them both off without changing the state of any other bulb. So if
an even number of bulbs are on, we can turn them off pairwise and
thus turn all the bulbs off.
What if an odd number of bulbs are on? Then we use the given
condition, the relevant set of bulbs being all of them, to change the
number of lit bulbs to an even number. ♡
There’s something a bit mysterious about this proof—didn’t we
use the given condition only in one special case, where the set of bulbs
that we’re trying to flip an odd number from is the whole set of bulbs?
Maybe that’s all we needed!? No, that would fail even for two bulbs,
when there’s just one switch and it flips one bulb; then there’d be no
way to turn the other bulb off.
The issue here is that to execute the induction, we needed a con-
dition that “persists downward”—in this case, one that continues to
hold when we remove a bulb. Otherwise, we could not apply the
IHOP after removing bulb i.
In fact we really do need the condition for all subsets. If there’s a
set S of bulbs we can’t flip an odd number from, and we begin with
just one bulb from S on, we’re stuck.
208
Brilliant Induction
{1, 4} versus {2, 3}. Then of course {5, 8} versus {6, 7} also works for
the numbers from 5 to 8, and if you put these together cross-wise, you
get {1, 4, 6, 7} versus {2, 3, 5, 8} which works perforce for sums and
now also seems to work for sums of squares.
In general, you can prove by induction that the integers from 1 to
2k can be partitioned into sets X and Y so that each part has the same
sum of jth powers, where j runs from 0 to k − 1; equivalently, such
that for any polynomial
∑ P of degree less than k, the number P (X),
which we define as {P (x) : x ∈ X}, is equal to P (Y ).
To move up to 2k+1 , take X ′ = X ∪(Y +2k ) (where you get Y +2k
by adding 2k to each element of Y ) and Y ′ = Y ∪ (X+ 2k ). We need
to prove that for any polynomial P of degree at most k,
P (X) + P (Y + 2k ) = P (Y ) + P (X + 2k ).
Non-Repeating String
Is there a finite string of letters from the Latin alphabet with the prop-
erty that there is no pair of adjacent identical substrings, but the ad-
dition of any letter to either end would create one?
209
Mathematical Puzzles
Baby Frog
To give a baby frog jumping practice, her four grandparents station
themselves at the corners of a large square field. When a grandpar-
ent croaks, the baby leaps halfway to it. In the field is a small round
clearing. Can the grandparents get the baby to that clearing, no matter
where in the field she starts?
210
Brilliant Induction
In general, in any n-gon, ⌊n/3⌋ (that is, the greatest integer in n/3)
guard-posts suffice, and this number is the best bound possible. The
next figure shows, by extrapolation, that ⌊n/3⌋ posts may be neces-
sary; the following proof shows that they suffice, and in fact can be
placed in corners.
The first move is to triangulate the polygon. This can done by draw-
ing non-crossing diagonals until no more will fit; a diagonal is a line
segment between two vertices of the polygon whose interior lies en-
tirely in the interior of the polygon.
Next we show by induction on n that the polygon’s vertices can be
colored with three colors so that every triangle’s vertices get all three
colors. Choose any diagonal D in the triangulation and cut through it
“lengthwise” to form two polygons, each with fewer than n vertices,
and each having D as an edge. Color both using the IHOP and per-
mute the colors of one so that the colors at the endpoints of D match,
then put the two small polygons back together to get a coloring of the
original polygon (as is done in the figure below).
211
Mathematical Puzzles
212
Brilliant Induction
213
Mathematical Puzzles
214
Brilliant Induction
215
Mathematical Puzzles
Summing Fractions
Gail asks Henry to think of a number n between 10 and 100, but not
to tell her what it is. She now tells Henry to find all (unordered) pairs
of numbers j, k that are relatively prime and less than n, but add up
to more than n. He now adds all the fractions 1/jk.
Whew! Finally, Gail tells Henry what his sum is. How does she
do it?
216
Brilliant Induction
fillable. Then you’ll need another el, another le, another el, and so
forth, alternating out to infinity.
The next row is already half-covered; to cover the rest of those
cells, you’ll need to start with a le. Each successive choice of el or le
must leave an even-length gap on row 3, otherwise you’ll be stumped
later. The good news is that the choice of el or le always changes the
length of the previous gap by one, thus you can always make that gap
even.
217
Mathematical Puzzles
Traveling Salesmen
Suppose that between every pair of major cities in Russia, there’s a
fixed one-way air fare for going from either city to the other. Trav-
eling salesman Alexei Frugal begins in St. Petersburg and tours the
cities, always choosing the cheapest flight to a city not yet visited (he
does not need to return to St. Petersburg). Salesman Boris Lavish also
needs to visit every city, but he starts in Kaliningrad, and his policy
is to choose the most expensive flight to an unvisited city at each step.
It looks obvious that Lavish’s tour costs at least as much as Fru-
gal’s, but can you prove it?
Solution: One way is to show that for any k, the kth cheapest flight
(call it f ) taken by Lavish is at least as costly as the kth cheapest flight
taken by Frugal. This seems like a stronger statement than what was
requested, but it really isn’t; if there were a counterexample, we could
adjust the flight costs, without changing their order, in such a way that
Lavish paid less than Frugal.
For convenience, imagine that Lavish ends up visiting the cities in
west-to-east order. Let F be the set of Lavish’s k cheapest flights, X
the departure cities for these flights, and Y the arrival cities. Note that
X and Y may overlap.
Call a flight “cheap” if its cost is no more than f ’s; we want to
show that Frugal takes at least k cheap flights. Note that every flight
eastward out of a city in X is cheap, since otherwise it would have
been taken by Lavish instead of the cheap flight in F that he actually
took.
Call a city “good” if Frugal leaves it on a cheap flight, “bad”
otherwise. If all the cities in X are good, we are done; Frugal’s de-
partures from those cities constitute k cheap flights. Otherwise, let
x be the westernmost bad city in X; then when Frugal gets to x, he
has already visited every city to the east of x, else Frugal could have
218
Brilliant Induction
departed x cheaply. But then every city to the east of x, when visited
by Frugal, had its cheap flight to x available to leave on, so all are
good. In particular, all cities in Y east of x are good, as well as all
cities in X west of x; that is k good cities in all. ♡
Lame Rook
A lame rook moves like an ordinary rook in chess—straight up, down,
left, or right—but only one square at a time. Suppose that the lame
rook begins at some square and tours the 8 × 8 chessboard, visiting
each square once and returning to the starting square on the 64th
move. Show that the number of horizontal moves of the tour, and
the number of vertical moves of the tour, are not equal!
219
Mathematical Puzzles
We note first that since there are no pairs inside a set of size 1,
R(1, k) = R(k, 1) = 1 for any k. Further, to get (say) a red set (i.e., a
set all of whose pairs are red) of size 2 we only need one red edge. It
follows that R(2, k) = R(k, 2) = k, because (in the case of R(2, k)) if
there’s any red pair its members give us a red set of size 2, else all the
pairs are green and we can use all the numbers to get our green set of
size k.
These observations conform to the theorem. Now we will proceed
by induction on the sum s+t.
( ′ ′ −2)
Fix s and t and suppose R(s′ , t′ ) ≤ s s+t for all s′ , t′ with
′ ′
′ −1
( )
s +t < s+t. Let U be the set {1, . . . , n} where n = s+t−2 s−1 , and
220
Brilliant Induction
suppose some adversary has colored all the unordered pairs in U red
or green. We want to find in U either a red subset S of size s or a green
subset T of size t. That would ( show ) that the conclusion of Ramsey’s
theorem holds when n = s+t−2 s−1 , therefore that R(s, t) is at most
this number. ( )
Recall that (from Pascal’s triangle) n = j+k, where j = s+t−3
(s+t−3) s−2
and k = s−1 . Note that j is our “n” when s′ = s−1 and t′ = t,
while k is our “n” when s′ = s and t′ = t−1.
Let’s focus our attention on the pairs containing the number 1.
There are n−1 of those, and we claim that either at least j of these
pairs are red, or at least k of them are green. Why? Because otherwise
there are at most j−1 red pairs and at most k−1 green pairs, and
that adds up to only j+k−2 = n−2. (Yes, you can think of it as an
application of the pigeonhole principle.)
Suppose the former, that is, there are j red pairs of the form {1, i},
and let V be the set of numbers i that appear ( in them
) (not including
1 itself). Since (s−1) + t < s+t, and j = (s−1)+t−2 (s−1)−1
, we know from
′
our IHOP that there’s either a red set S ⊂ V of size s−1 or a green
set T ′ ⊂ V of size t. If it’s the latter, we are happy; and if the former,
we can add the number 1 to our set—since all of the pairs involving 1
are red—and get a red set S = S ′ ∪ {1} of size s.
The other case is similar: If there are k green pairs of the form
{1, i}, let W be the set of numbers i that appear in them; since s +
( )
(t−1) < s + t, and k = s+(t−1)−2 (s−1
, we know from our IHOP that
there’s either a red set S ′ ⊂ V of size s or a green set T ′ ⊂ V of size
t−1. If it’s the former, we have our S; if the latter, we can add the
number 1 to T —since all of the pairs involving 1 are green—and get
a green set T = T ′ ∪ {1} of size t. Done! ♡
( ) ()
As it happens, R(3, 3) is equal to 3+3−2 = 24 = 6, but
3−1 (4+4−2) (6)
R(4, 4) = 18 which is strictly less than our bound of 4−1 = 3 =
20. Putting our theorem together with the one proved in the previous
chapter, we know that R(k, k) lies somewhere between 2k/2 and 22k .
Most combinatorialists would guess that there’s some number α be-
tween 12 and 2 such that R(k, k) behaves like 2αk as k grows—more
precisely, that the logarithm base 2 of the kth root of R(k, k) tends to
some α as k goes to infinity. Finding α would have earned you $5000
from “Uncle Paul” Erdős, and he’d have paid happily.
221
16. Journey into Space
We all live in three spacial dimensions, and are attuned to thinking
three-dimensionally even though we see, draw and paint, for the most
part, only in two. Thus, geometrical problems in three dimensions,
while potentially much harder than problems in the plane, can appeal
to our intuition in pleasant and even useful ways.
Some of the puzzles that follow are set naturally in three dimen-
sions; others can be placed there to good effect.
Solution: You can get any number k of pieces with the same
amount of cake and the same amount of icing in the following neat
way: Looking at the cake from above, divide the perimeter of the
square top of the cake into k equal parts and make straight, verti-
cal cuts to the middle of the square from each boundary point on the
perimeter.
That works because each piece, looked at from the top, is the
union of triangles with the same altitude (namely, half the side of the
cake) and the same total base (namely, 1/k times the perimeter), as
in the figure below.
Speaking of cubes, here’s a question about painting them.
223
Mathematical Puzzles
Curves on Potatoes
Given two potatoes, can you draw a closed curve on the surface
of each so that the two curves are identical as curves in three-
dimensional space?
224
Journey into Space
225
Mathematical Puzzles
the center of the manhole many times, or laying boards too close to
the edge to be of much use. Putting it another way, it’s relatively ex-
pensive to cover parts of the manhole far from the center. Can you
quantify that statement in a useful way?
It turns out you can, using a famous fact known sometimes as
Archimedes’ hat box theorem. Archimedes used his “method of ex-
haustion” (these days, we would use calculus) to show that if a sphere
of radius r is intersected by two parallel planes a distance d apart, as
in the figure below, the surface area of the sphere between the planes
is 2πrd. In particular, it doesn’t depend on where the planes cut the
sphere, but only on how far apart the planes are. (The “hat box” pre-
sumably alludes to a cylinder of radius r perpendicular to the planes;
the cylinder’s area between the planes is that same 2πrd.)
226
Journey into Space
two parallel vertical planes whose distance d apart is the width of the
board. Now the key observation: Arranging the boards to cover the
manhole is equivalent to arranging the slabs to cover the sphere.
But by Archimedes’ theorem, the slabs cannot cover more than
2π w2 d = πwd of the surface of the sphere, which has area πw2 . So if
d < w, you’re stuck. ♡
Now we are set up perfectly to conquer the next puzzle.
Slabs in 3-Space
A “slab” is the region between two parallel planes in three-
dimensional space. Prove that you cannot cover all of 3-space with
a set of slabs the sum of whose thicknesses is finite.
Solution: In a way the conclusion seems obvious; if you can’t cover
space when the slabs are parallel and disjoint, surely you can’t cover
when they waste space by overlapping. But infinity is a tricky concept.
The slabs all have infinite volume, so what’s to prevent them from
covering anything they want?
Actually, we know from the previous puzzle that they have trou-
ble covering a large ball. If the total thickness of the slabs is T , then,
by Archimedes’ theorem, they can’t cover the surface of a ball of di-
ameter greater than T , thus they can’t cover the ball itself.
Thus they certainly can’t cover all of 3-space. But it’s odd that to
show the latter, we seem to need to reduce the problem to just a finite
piece of space.
Solution: As the title of this chapter suggests, lifting the puzzle into
space provides an elegant solution. How? By means of a time axis.
Suppose every pair of bugs meets except bug 3 with bug 4. Construct
a time axis perpendicular to the plane of the bugs, and let gi be the
227
Mathematical Puzzles
graph (this time, in the sense of graphing a function) of the ith bug in
space. Since each bug travels at constant speed, each such graph is a
straight line; its projection onto the plane of the bugs is the line that
bug travels on. If (and only if) two bugs meet, their graphs intersect.
The lines g1 , g2 , and g3 are coplanar since all three pairs inter-
sect, and the same applies to g1 , g2 , and g4 . Hence all four graphs are
coplanar. Now g3 and g4 are certainly not parallel, since their projec-
tions onto the original plane intersect, thus they intersect on the new
common plane. So bugs 3 and 4 meet as well.
Circular Shadows II
Show that if the projections of a solid body onto two planes are perfect
disks, then the two projections have the same radius.
Solution: The conclusion seems eminently reasonable, yet it’s not
completely obvious how to prove it.
An easy way to make your intuition rigorous is to select a plane
which is simultaneously perpendicular to the two projection planes,
and move parallel copies of it toward the body from each side. They
hit the body at the opposite edges of each projection, so that the dis-
tance between the parallel planes at that moment is the common di-
ameter of the two projected circles. ♡
Box in a Box
Suppose the cost of shipping a rectangular box is given by the sum of
its length, width, and height. Might it be possible to save money by
fitting your box into a cheaper box?
228
Journey into Space
Solution: The issue here is that if packed diagonally, the inside box
could have some dimensions that exceed the greatest dimension of
the outside
√ box. For example, a narrow needle-like box of length al-
most 3 could be packed inside a unit cube. This particular example
wouldn’t provide a way to cheat, because in this case the total cost of
the outside cube would be 3, much more than the 1.7 or so you might
have to pay for the inside box. But how do we know that some better
example won’t turn up?
Here’s a delightful argument that lets ε go to infinity(!) in order to
show that you can’t cheat the system.
Suppose your box is a × b × c, and let R stand for the region of
space occupied by your box including its interior. Suppose R can be
packed into an a′ × b′ × c′ box R′ with a + b + c > a′ + b′ + c′ . Let
ε > 0 and consider the region Rε consisting of all points in space that
are within distance ε of R. This Rε region will be a rounded convex
shape containing your box R. The volume of Rε is equal to your box’s
volume plus 2ε(ab + bc + ac)s for the volume added to the sides, plus
πε2 (a + b + c) for the volume added to the edges, plus 43 πε3 for the
volume (consisting of the eight octants of a ball) added to the corners.
If you do the same to the outside box R′ you get a region Rε′ which of
course must contain Rε . But that’s impossible! In the expression for
vol(Rε′ ) − vol(Rε ), the ε3 terms cancel, so if you take ε to be large, the
dominant term is the ε2 term, namely πε2 ((a′ + b′ + c′ ) − (a + b + c)),
which is negative. ♡
Angles in Space
Prove that among any set of more than 2n points in Rn , there are three
that determine an obtuse angle.
Solution: It makes sense that the 2n corners of a hypercube repre-
sent the most points you can have in n-space without an obtuse angle.
But how to prove it?
Let x1 , . . . , xk be distinct points (vectors) in Rn , and let P be their
convex closure. We may assume P has volume 1 by reducing the di-
mension of the space to the dimension of P , then scaling appropri-
ately; we may also assume x1 is the origin (i.e., the 0 vector). If there
are no obtuse angles among the points, then we claim that for each
i > 1, the interior of the translate P + xi is disjoint from the interior
of P ; this is because the plane through xi perpendicular to the vector
xi separates the two polytopes.
229
Mathematical Puzzles
230
Journey into Space
Given any two circles in the plane of different radii, neither con-
tained in the other, we can construct two lines that are tangent to the
circles such that for each line, the circles are on the same side of the
line. (See picture below). These lines will intersect at some point on
the plane, known as the Monge point of the two circles.
Theorem. Suppose three circles are given, all of different radii, none con-
tained in another. Then the three Monge points determined by the three pairs
of circles all lie on a line.
This is what the picture looks like (we have taken the circles to be
disjoint, but in fact they’re allowed to overlap).
The theorem is attributed to Gaspard Monge, 1746–1818, a dis-
tinguished French mathematician and engineer. On Wikipedia (as I
write this) you will find a proof which is elegant, famous, and wrong!
Here’s how it goes:
Replace each circle by a sphere whose equator is that circle, so
now you have three spheres (of different diameters) intersecting the
original plane at their equators. Pick two of them: Instead of two
231
Mathematical Puzzles
tangent lines you now have a whole tangent cone whose apex is the
Monge point of the circles.
Now, take a plane tangent to the three spheres, thus also tangent
to the three cones. The three Monge points will all lie on that plane,
as well as on the original plane. But the two planes intersect in a line,
so the Monge points are all on that line, QED!
It’s not easy to spot the hole in this proof. The difficulty is that
there may not be a plane tangent to the three spheres; for example, if
two of the circles are large and the third is between them and smaller.
The following proof, attributed by cut-the-knot.org to Nathan
Bowler of Trinity College, Cambridge, works by erecting cones instead
of spheres on top of the circles. Call them C1 , C2 , and C3 , and let them
all be “right” cones—that is, they support 90◦ angles at their apices.
(Actually, we only need all the cones to have the same angle.) Each
pair of cones determines two (outside) tangent planes, say P1 and Q1
(for cones C2 and C3 ), P2 and Q2 (for cones C1 and C3 ), and finally
P3 and Q3 (for cones C1 and C2 ).
Each pair of planes Pi , Qi intersect in a line Li which passes
through the apex of both tangent cones, as well as through the point
where the corresponding circle tangents meet. Thus, in particular, L1
232
Journey into Space
233
17. Nimbers and the
Hamming Code
Probably the most famous equation in mathematics is not E = mc2
or eiπ = −1 but 1 + 1 = 2. But if, like many computer scientists, you
are fond of binary arithmetic, you might prefer 1 + 1 = 10; if you are
an algebraist or logician who works with numbers modulo 2, you
might prefer 1 + 1 = 0.
It turns out to be surprisingly useful, in certain circumstances, to
work in a world where any number added to itself is zero. Such is the
world of nimbers.
Nimbers are a lot like numbers, and in fact you can think of them
as non-negative integers, written in binary. But their rules for addition
and subtraction are different from the usual ones. In particular, you
add nimbers without carrying.
Here’s another way to say the same thing: To compute the ith bit
(from the right) of the sum of a bunch of nimbers, you only need to
know the ith bit of each nimber. If an odd number of these are 1’s, the
ith bit of the sum will be a 1; otherwise it will be a 0.
Let’s try this. To avoid confusion, we’ll write the decimal expres-
sion of a nimber with an overline, so, for example, 7 = 111 and
10 = 1010. To distinguish nimber addition from ordinary addition
of binary numbers, we’ll use the symbol ⊕ instead of +.
Thus, 7 ⊕ 10 = 111 ⊕ 1010 = 1101 = 13. Of course, 1 ⊕ 1 =
1 ⊕ 1 = 0 = 0 and in fact, as we said, n ⊕ n = 0 for any n.
Nimber arithmetic, once you get used to it, is really rather nice. It
obeys the usual laws of arithmetic—it’s commutative, associative, and
satisfies x ⊕ 0 = x for any x. It has additive inverses, as we saw: Any
nimber is the additive inverse of itself! Thus, we have no use for minus
signs in nimber arithmetic, and subtraction is the same as addition. If
we have two nimbers m and n and we want to know which nimber to
add to m to get n, why, it’s the nimber m ⊕ n, since m ⊕ (m ⊕ n) =
(m ⊕ m) ⊕ n = 0 ⊕ n = n.
235
Mathematical Puzzles
236
Nimbers and the Hamming Code
If there are just two stacks, and they are of different sizes, you (as first
player) have the following winning strategy: Take chips from the big
stack to reduce it to exactly the size of the smaller one, and repeat.
If there are more than two stacks, things start to get compli-
cated. Nimbers make it simple—they enable you to win whenever
you should, and often (in practice) when you shouldn’t!
Here’s how it works. We define the nimsum of a position to be the
nimber-sum of the stack sizes. For example, the nimsum of the initial
position in the cherries puzzle is
The fact is that you (as first player) can force a win from any posi-
tion whose nimsum is not zero. How do you do it? Easy: Change it to
a position whose nimsum is zero. Your opponent will have to change
the position to one whose nimsum is again non-zero, and then you
repeat. Eventually you get to the empty position, whose nimsum is of
course zero, and you win!
There are some things to verify here. First of all, how do you know
that your opponent can’t change a zero-nimsum position to another
zero-nimsum position? Well, your opponent (like you) must remove
one or more chips from just one stack, so he reduces one of the stack-
sizes by some positive number k. That will have the effect of nimber-
subtracting k from the previous position nimsum, but remember, nim-
ber subtraction is the same as nimber addition. So the nimsum of the
new position will be 0 ⊕ k = k ̸= 0.
A bit more subtle is showing that from any position whose nim-
sum is not zero, you can get to one whose nimsum is zero. Here’s
how you can do it. Suppose the current nimsum is s, and suppose the
leftmost 1 in the binary representation of s is in the ith bit from the
right (that is, the bit representing 2i−1 ). Then there must be at least
one stack whose size (sj , say) also has a 1 as its ith bit—otherwise,
the ith bit of s would have been zero. We claim we can remove some
chips from that stack to change its size to sj ⊕ s. Doing so will change
the position’s nimsum to s ⊕ s = 0. The only thing we need to check
is that sj ⊕ s is a smaller number than sj (since we’re not allowed to
add chips to a stack). But that is easy because nimber-adding s to sj
will change the ith bit from 1 to 0, and won’t affect any bits of sj that
are to the left of the ith. It follows that s ⊕ sj is smaller than sj , so
reducing the sj -stack to size s ⊕ sj is a legal move.
Let’s try that with the cherries. We saw that the nimsum of the
given position was 12 = 1100, whose leftmost 1 is in the fourth
237
Mathematical Puzzles
position from the right. Here there happens to be only one stack
whose size (in binary) has a 1 in the fourth position from the right:
the stack of size 8. Nimber-adding 1100 to 1000 gives 100 = 4 so we
reduce the number of cherries in the bowl of 8 to 4.
The resulting position, 7|6|5|4, has nimsum 111 ⊕ 110 ⊕ 101 ⊕
100 = 0 and we have Amit where we want him.
In some positions there are several stacks whose sizes, in binary,
have a 1 in the same position as the leftmost 1 in the position’s nim-
sum; in such cases, there will be one winning move in each of those
stacks. For our initial cherries position, there is only one such stack,
thus only one winning move. After any other first move, it is Amit
who can force a win.
Even within the specialized field of combinatorial games (where
two players alternate and the first one who is unable to move loses),
nimbers play a much bigger role than just their part in Nim. It turns
out that any position in an “impartial” combinatorial game—that
is, one in which both players have the same move choices from any
given position—can be represented by a nimber! This is the content of
the celebrated Sprague-Grundy Theorem, about which the interested
reader can read in Winning Ways or any other book on combinatorial
games.
In fact, here’s another impartial game to which we can apply
nimbers—but perhaps not in the way you would think.
Solution: So, in effect, in this second puzzle you want your friend
to win. (In such a situation you are said to be playing the misère version
of the game.) It looks like since your objective is the opposite of the
previous puzzle’s, you should make any move but the one that reduces
the number of cherries in the bowl of eight to four.
That’s fine if Amit cooperates, that is, if he himself wants the last
cherry, but it will not do if you want to insist that Amit get the last
cherry. Surprisingly, your unique winning first move for the second
puzzle is the same as the one for the first!
238
Nimbers and the Hamming Code
Whim-Nim
You and a friend, bored with Nim and Nim Misère, decide to play a
variation in which at any point, either player may declare “Nim” or
“Misère” instead of removing chips. This happens at most once in a
game, and then of course the game proceeds normally according to
that variation of Nim. (Taking the whole single remaining stack in an
undeclared game loses, as your opponent can then declare “Nim” as
his last move.)
What’s the correct strategy for this game, which its inventor, the
late John Horton Conway, called “Whim”?
239
Mathematical Puzzles
240
Nimbers and the Hamming Code
Option Hats
One hundred prisoners are told that at midnight, in the dark, each
will be fitted with a red or black hat according to a fair coinflip. The
prisoners will be arranged in a circle and the lights turned on, enabling
each prisoner to see every other prisoner’s hat color. Once the lights
are on, the prisoners will have no opportunity to signal to one another
or to communicate in any way.
Each prisoner will then be taken aside and given the option of
trying to guess whether his own hat is red or black, but he may choose to
pass. The prisoners will all be freed if (1) at least one prisoner chooses
to guess his hat color, and (2) every prisoner who chooses to guess
guesses correctly.
As usual, the prisoners have a chance to devise a strategy before
the game begins. Can they achieve a winning probability greater than
50%?
241
Mathematical Puzzles
of being right, so what’s the advantage of ever having more than one
person guess?
Suppose we fix some strategy S that tells each prisoner whether to
guess black (“B”), guess red (“R”), or decline to guess (“D”), depend-
ing on the 99 hats he sees. Imagine that we write down a huge matrix
indicating, for each of the 2100 possible hat configurations, what each
prisoner does according to S. If each guess (B or R) is boldfaced if
it is correct, then the matrix will have exactly the same number of
boldfaced guesses as lightfaced; because, if prisoner i’s guess is (say)
a boldface R in a particular configuration, it will be a lightface R for
the configuration that is exactly the same except that prisoner i’s hat
is changed to black.
In other words, no matter what the strategy, over all possible con-
figurations half the guesses are correct. That suggests an idea: What
if we crowd as many wrong guesses as possible into a few configura-
tions, and try to put just one correct guess into each remaining config-
uration?
Let’s do a little bit of arithmetic. Fixing a strategy S, let w be the
number of winning configurations (that is, those in which all pris-
oners who guess are correct). Let x be the average number of (cor-
rect) guesses in winning configurations, and y the average number of
wrong guesses in losing configurations. Then wx ≤ (2100 −w)y with
equality only when all guesses in the losing configurations are wrong.
To maximize w, we would like to have every prisoner guess and all
be wrong, in losing configurations; in winning configurations, to have
just one prisoner guess and be correct. If we could achieve that for n
prisoners, we would get a winning probability of n/(n+1). We call
this number the count bound. Achieving the count bound would be
very good news indeed for our 100 prisoners, as they would all be
freed with probability 100/101—better than 99%.
But let’s not get ahead of ourselves. For one thing, we could never
get 100/101 probability of winning for our 100 prisoners, because
that would require that the number of losing configurations be ex-
actly 1/101 times the total number of configurations, and 2100 is not
divisible by 101.
But n+1 does divide evenly into 2n for n = 3; let’s see if we can
get probability 3/4 of winning for three prisoners. We need two of the
23 = 8 hat configurations to be losers; the logical ones to try are all
red, and all black. If we instruct each prisoner to guess “red” when he
sees two black hats and “black” when he sees two red, that will have
the desired effect: They’ll all guess wrong in the losing configurations.
242
Nimbers and the Hamming Code
Let’s see: If we ask them to decline to guess otherwise, we get just what
we want: In any configuration with both colors present, the prisoner
with the odd hat will guess correctly while the other two decline!
Here’s the matrix for this strategy:
243
Mathematical Puzzles
244
Nimbers and the Hamming Code
With this the prisoners can get winning probability 1−7/64 = 57/64,
beating the Hamming code. Notice here that if, for example, the ac-
tual configuration is 11111 (all hats red), two prisoners—numbers 1
and 2, counting from the left—will guess (correctly) that their hats
are red, the first to avoid the codeword 01111, the second to avoid
10111.
It turns out that for large n, radius-1 covering codes that are (rela-
tively) close in size to 2n /(n+1) can always be found. They are much
harder to describe than Hamming codes, but if the number of pris-
oners is large and awkward (e.g., equal to 2k − 2 for some k), hard
work will enable the prisoners to cut down their losing probability by
a factor of almost 2.
Chessboard Guess
Troilus is engaged to marry Cressida but threatened with deportation,
and Immigration is questioning the legitimacy of the proposed mar-
riage. To test their connection, Troilus will be brought into a room
containing a chessboard, one of whose squares is designated as spe-
cial. On every square will be a coin, either heads-up or tails-up. Troilus
gets to turn over one coin, after which he will be ejected from the room
and Cressida brought in.
Cressida, after examining the chessboard, must guess the desig-
nated square. If she gets it wrong, Troilus is deported.
Can Troilus and Cressida save their marriage?
245
Mathematical Puzzles
heads; that gives a nimber and she now guesses that its associated
square is the designated special square.
So Troilus needs to do is make sure the sum points to the right
square, but that’s easy. He computes the sum of the nimbers of the
heads-squares of the board as presented to him, and compares it with
the nimber of the designated special square. If their sum (i.e., differ-
ence!) is the nimber b, he turns the coin on square b. That will add
(i.e., subtract) b from the sum and leave the sum pointing to the spe-
cial square.
Majority Hats
One hundred prisoners are told that at midnight, in the dark, each
will be fitted with a red or black hat according to a fair coinflip. The
prisoners will be arranged in a circle and the lights turned on, enabling
each prisoner to see every other prisoner’s hat color. Once the lights
are on, the prisoners will have no opportunity to signal to one another
or to communicate in any way.
Each prisoner is then taken aside and must try to guess his own
hat color. The prisoners will all be freed if a majority (here, at least
51) get it right.
As before, the prisoners have a chance to devise a strategy before
the game begins. Can they achieve a winning probability greater than
50%? Would you believe 90%? How about 95%?
246
Nimbers and the Hamming Code
247
Mathematical Puzzles
example: All prisoners with even nimbers guess as if they know the
total number of red hats in their group is even, while all those with odd
nimbers assume the opposite. Then groups 2 through 5 will each be
exactly half right, and the prisoners end up with a 16-to-15 majority
correct.
If prisoner 1’s hat is red, Group 2 plays the Unanimous Hats
strategy—they all guess as if they knew the number of red hats in
their group were even. If they’re right (probability 1/2), then each re-
maining group splits itself as before and again the prisoners win by
one.
If Group 2 is doomed to failure as well as Group 1—which, again,
everyone else can see—then there are three wrong guesses coming,
but they are rescued by Group 3 which now attempts to be all cor-
rect. This pattern continues and always produces a 16-15 majority
unless every one of the five groups contains an odd number of red
hats, which happens with probability only 1/32. So the 31 prisoners
achieve success probability 1 – 1/32 = 96.875%. We know this is un-
beatable because it achieves the ideal: The prisoners either enjoy a
1-guess victory, or everyone is wrong.
We can achieve this ideal (though probability of success will be
only 1 − 1/16) with 30 prisoners as well; here there’s no group of size
1, and the group of size two plays the Unanimous Hats strategy to try
to achieve the 2-guess advantage.
What about 100 prisoners? The count bound is never exactly
achievable unless n+1 or n+2 is a power of 2, because there are 2n hat
configurations and thus any protocol’s probability of winning must be
a multiple of 1/2n . One hundred is not a good number, but we could
let prisoners 1 through 62 use our “St. Petersburg protocol,” while the
remaining 38 prisoners just split themselves using the Half-Right Hats
strategy, so as not to get in the way of the others. That frees the pris-
oners with probability 1 – 1/32 = 96.875%, pretty good. But it seems
as if this strategy wastes 38 prisoners.
Let’s go back to small numbers again. The smallest number that’s
not one or two less than a power of 2 is 4. Can 4 prisoners win with
probability better than 1/2? Yes: Have prisoner 1 guess black. If he’s
wearing a black hat, the other three prisoners can run their St. Peters-
burg protocol to get 2-out-of-3 right with probability 3/4. If prisoner
1 has a red hat, the other three play the Unanimous Hats strategy and
thus all three are right with probability 1/2. Altogether the 4 prisoners
achieve their 2-guess majority with probability 12 · 34 + 12 · 21 = 5/8.
248
Nimbers and the Hamming Code
With this observation we can split our 100 prisoners into groups
of sizes 4, 6, 12, 24, and 48, with just 6 left over. The group of 4 plays
as above, succeeding with probability 5/8. As usual, if they are going
to succeed (which everyone else can see), all other prisoners play the
Half-Right Hats strategy. If they are going to fail, the next group (size 6)
plays Unanimous Hats, and if they fail the group of 12 plays Unanimous
Hats, etc. The final group of 6 always plays Half-Right Hats.
Result? The prisoners win unless the first group of 4 fails and the
next four groups all suffer an odd number of red hats. This strategy
thus frees the prisoners with probability 1− 38 · 12 · 12 · 12 · 12 = 1−3/128 =
97.65625%.
Can we tweak this any further? Yes, by recursively computing
the best strategies of this kind for achieving k correct guesses out
of n, for all n and k up to 100. This “dynamic programming” ap-
proach can reach a success probability of 1129480068741774213/
1152921504606846976, about 97.96677954%; very close indeed to
the count bound of 100/102 = 98.039215686%.
That last solution didn’t end up making much use of nimbers, but
the next puzzle brings us back to the Hamming code.
Solution: Since there are 16 things the spy can do (change any bit
or none), she can in principle communicate as much as four bits of
information each day to her control. But how?
The answer is easy once you have nimbers in your arsenal. The spy
and her control assign the 4-bit nimber corresponding to the number
249
Mathematical Puzzles
250
Nimbers and the Hamming Code
251
Mathematical Puzzles
252
18. Unlimited Potentials
Puzzles often involve processes—systems that evolve in time randomly,
deterministically, or under your control. Popular questions include:
Can the system reach a certain state? Does it always reach a certain
state? If so, how long does it take?
The key to such a puzzle may be to identify some parameter of the
current state of the system that measures progress toward your goal.
We call such a parameter a potential.
For example, suppose you can show that the potential never in-
creases, but starts below the potential of the desired end state. Then
you have proved that the end state is unreachable.
On the other hand, perhaps the end state has potential zero, the
beginning state has positive potential p > 0, and every step of the
process reduces the potential by at least some fixed amount ε > 0.
Then you must reach the end state, and moreover must do so in time
at most p/ε.
If the loss per step in potential is not bounded, it could be that the
potential never reaches zero and may not even approach zero. But
if the system has only finitely many states, you don’t need to worry
about this possibility.
Can you find an appropriate potential for the following puzzle?
Signs in an Array
Suppose that you are given an m × n array of real numbers and per-
mitted, at any time, to flip the signs of all the numbers in any row or
column. Can you always arrange matters so that all the row sums and
column sums are non-negative?
Solution: We note first that there are only finitely many states here:
Each number in the array has at most two states (positive or negative)
so there can’t be more than 2mn possible states of the array.
Actually, there’s a better bound: If a line (a row or column) is
flipped twice, it’s as if it had never been flipped. Thus the state of
253
Mathematical Puzzles
254
Unlimited Potentials
Solution: The idea is that even though a flip might result in turning
more pancakes upside-down, it rights some pancake that’s relatively
high in the stack. Let’s penalize the underchef 2k points for an upside-
down pancake k pancakes from the bottom, and keep track of the total
of the penalties at any given time.
Every flip decreases the total penalty, because the penalty of the
target pancake exceeds the sum of all possible penalties below it. Thus
the penalty total must reach 0, at which time the task is finished.
An equivalent way of thinking about this potential function is to
code a stack of pancakes by a binary number whose left-most digit
is 1 if the top pancake is upside-down, and 0 otherwise. The next-to-
top pancake determines the next digit, and so forth. Flipping always
decreases the code until the code reaches 0.
255
Mathematical Puzzles
Solution: Suppose you pair the red and blue points up arbitrarily
and draw the connecting line segments. If the line segment connect-
ing r1 and b1 intersects the segment connecting r2 and b2 , then these
segments are the diagonals of a quadrilateral and by the triangle in-
equality, the sum of the lengths of the non-crossing segments from r1
to b2 and from r2 to b1 is less then sum of the lengths of the diagonals.
The trouble is, if you re-pair the points as suggested above, you
may have created new intersections between these segments and oth-
ers. So “number of intersections” is not the right potential; how about
“total length of line segments?”
That works beautifully! Just take any matching that minimizes the
sum of the lengths of its line segments, and by the above argument, it
contains no crossings.
Show that no matter how long this process continues, there’s al-
ways a bacterium inside the circle of radius 3 about the origin.
Solution: It’s worth trying this to see how things get clogged up
near the origin, preventing that area from clearing. How can we
demonstrate this using a potential function?
256
Unlimited Potentials
Since each bacterium divides into two, it’s natural to give each
child half the potential of its parent. We can do this by penalizing its
potential by a factor of 2 for each additional edge in its shortest path
to the origin.
This can be done by assigning value 2−x−y to a bacterium at (x,y),
so that the total assigned value begins at 1 and never changes.
The total potential of all bacteria on the half line y = 0 (i.e., the
positive X-axis) cannot exceed 1 + 1/2 + 1/4 + · · · = 2, nor can the
potential of the points on the half-line y = 1 exceed 1/2 + 1/4 +
1/8 + · · · = 1; continuing in this manner, we see that even if the
whole north-east quadrant were full of bacteria, the total potential
would only add up to 4.
But the potentials of bacteria at the nine non-negative integer
points inside the circle x2 + y 2 = 9 already add up to 49/16, more
than 3. Thus the potentials of all the bacteria not inside this circle add
up to less than 1, and it follows that there must be bacteria left inside
the circle no matter how long the process continues.
Solution: The difficulty is that as pegs rise higher, grid points be-
neath them are denuded. What is needed is a parameter P which is re-
warded by highly placed pegs, but compensatingly punished for holes
left behind. A natural choice would be a sum over all pegs of some
function of the peg’s position. Since there are infinitely many pegs,
we must be careful to ensure that the sum converges.
We could, for example, assign value ry to a peg on (0, y), where
r is some real number greater than 1, so that∑the values of the pegs
0
on the lower Y -axis sum to the finite number y=−∞ ry = r/(r−1).
Values on adjacent columns will have to be reduced, though, to keep
the sum over the whole plane finite; if we cut by a factor of r for each
step away from the Y -axis, we get a weight of ry−|x| for the peg at
257
Mathematical Puzzles
r 1 1 1 1 r2 + r
+ + + + + ··· = <∞
r−1 r−1 r−1 r(r −1) r(r−1) (r−1)2
Pegs in a Square
Suppose we begin with n2 pegs on a plane grid, one peg occupying
each vertex of an n-vertex by n-vertex square. Pegs jump only hori-
zontally or vertically, by passing over a neighboring peg and into an
unoccupied vertex; the jumped peg is then removed. The goal is to
reduce the n2 pegs to only 1.
Prove that if n is a multiple of 3, it can’t be done!
Solution: Color the points (x, y) of the grid red if neither x nor y is
a multiple of 3, otherwise white. This leaves a regular pattern of 2 × 2
red squares (as in the figure).
258
Unlimited Potentials
First-Grade Division
On the first day of class Miss Feldman divides her first-grade class into
k working groups. On the second day, she picks the working groups
a different way, this time ending up with k+1 of them.
Show that there are at least two kids who are in smaller groups on
the second day than they were on the first day.
259
Mathematical Puzzles
Infected Checkerboard
An infection spreads among the squares of an n × n checkerboard
in the following manner: If a square has two or more infected neigh-
bors, then it becomes infected itself. (Neighbors are orthogonal only,
so each square has at most four neighbors.)
For example, suppose that we begin with all n squares on the main
diagonal infected. Then the infection will spread to neighboring diag-
onals and eventually to the whole board.
Prove that you cannot infect the whole board if you begin with
fewer than n infected squares.
Solution: This puzzle was presented to me (by NYU’s Joel
Spencer) as having a “one-word solution.” That’s an exaggeration,
perhaps, but not a huge one.
At first it might seem that to infect the whole board, you need to
start with a sick square in every row (and in every column). That
would imply the conclusion, but it’s not true. For example, sick
squares in alternating positions in the leftmost column and bottom
row can infect the whole board.
What we really need is a potential function, and the one that works
like a charm—and the one word Spencer had in mind—is “perime-
ter.”
The perimeter of the infected region is just the total length of its
boundary. We may as well assign each grid edge length 1, so the
perimeter could as well be defined as the number of edges that have
a sick square on one side and either a well square or nothing on the
other side.
Here is the key observation: When a square becomes infected (by
two or more neighbors), the perimeter cannot increase! Indeed, it is
easy to check that when just two neighbors administer the dose, the
perimeter remains the same; if the well square had three or four sick
neighbors, the perimeter actually goes down.
If the whole board gets infected, the final perimeter is 4n; since
the perimeter never increased, the initial perimeter must have been at
least 4n. But to start with perimeter 4n there must have at least n sick
squares.
Impressionable Thinkers
The citizens of Floptown meet each week to talk about town poli-
tics, and in particular whether or not to support the building of a
260
Unlimited Potentials
new shopping mall downtown. During the meetings each citizen talks
to his friends—of whom there are always an odd number, for some
reason—and the next day, changes (if necessary) his opinion regard-
ing the mall so as to conform to the opinion of the majority of his
friends.
Prove that eventually, the opinions held every other week will be
the same.
Solution: To prove that the opinions eventually either become fixed
or cycle every other week, think of each acquaintanceship between
citizens as a pair of arrows, one in each direction. Let us say that an
arrow is currently “bad” if the opinion of the citizen at its tail differs
from the next week’s opinion of the citizen at its head.
Consider the arrows pointing out from citizen Clyde at week t−1,
during which (say) Clyde is pro-shopping mall. Suppose that m of
these are bad. If Clyde is still (or again) pro on week t+1, then the
number n of bad arrows pointing toward Clyde at week t will be exactly
m.
If, however, Clyde is anti-shopping mall on week t+1, n will be
strictly less than m since it must have been that the majority of his
friends were anti on week t. Therefore a majority of the arrows out of
Clyde were bad on week t−1 and now only a minority of the arrows
into Clyde on week t are bad.
The same observations hold, of course, if Clyde is anti on week
t−1.
But, here’s the thing: Every arrow is out of someone on week t−1,
and into someone on week t. Thus, the total number of bad arrows
cannot rise between weeks t−1 and t and, in fact, will go strictly down
unless every citizen had the same opinion on week t−1 as on week
t+1.
But, of course, the total number of bad arrows on a given week
cannot go down forever and must eventually reach some number k
from which it never descends. At that point, every citizen will either
stick with his opinion forever or flop back and forth every week.
Frames on a Chessboard
You have an ordinary 8 × 8 chessboard with red and black squares. A
genie gives you two “magic frames,” one 2 × 2 and one 3 × 3. When
you place one of these frames neatly on the chessboard, the 4 or 9
squares they enclose instantly flip their colors.
261
Mathematical Puzzles
Bugs on a Polyhedron
Associated with each face of a solid convex polyhedron is a bug which
crawls along the perimeter of the face, at varying speed, but only in the
clockwise direction. Prove that no schedule will permit all the bugs to
circumnavigate their faces and return to their initial positions without
incurring a collision.
262
Unlimited Potentials
This cycle divides the surface of the polyhedron into two portions;
let us define the “inside” of the cycle to be that portion surrounded
clockwise by the cycle. Let P be the number of vertices of the polyhe-
dron inside the cycle.
Initially, P could be anything from 0 to all of the polyhedron’s
vertices; the extremes occur if there are two bugs on the same edge,
causing a cycle of length 2. In the P = 0 case, the two bugs are facing
each other, and doomed to collide.
When a bug on the cycle moves to its next edge, the arrow through
it rotates clockwise. The vertex through which it passed, previously
on the inside of the cycle, is now outside; other vertices may also have
passed from inside to outside the cycle, but there is no way for a vertex
to move inside. To see this, note that the new arrow now points inside
the cycle. The chain of arrows emanating from its head has no way
to escape the cycle so must hit the tail of some cycle arrow, creating a
new cycle with smaller interior. In particular, P has now dropped by
at least 1.
Since we can never restore P to its starting value, there is nothing
to do but hope that the bugs are carrying collision insurance. ♡
263
Mathematical Puzzles
Bugs on a Line
Each positive integer on the number line is equipped with a green,
yellow, or red light. A bug is dropped on “1” and obeys the following
rules at all times: If it sees a green light, it turns the light yellow and
moves one step to the right; if it sees a yellow light, it turns the light
red and moves one step to the right; if it sees a red light, it turns the
light green and moves one step to the left.
Eventually, the bug will fall off the line to the left, or run out to
infinity on the right. A second bug is then dropped on “1,” again fol-
lowing the traffic lights starting from the state the last bug left them
in; then, a third bug makes the trip.
Prove that if the second bug falls off to the left, the third will march
off to infinity on the right.
Solution: We first need to convince ourselves that the bug will either
fall of to the left, or go to infinity on the right; it cannot wander forever.
To do so, it would have to visit some numbers infinitely often; let n
be the least of those numbers, but now observe that every third visit
to n will find it red and thus will incur a visit to n − 1, contradicting
the assumption that n − 1 was visited only finitely often.
With that out of the way, it will be useful to think of a green light
as the digit 0, red as 1, and yellow, perversely, as the “digit” 12 . The
configuration of lights can then be thought of as a number between 0
and 1 written out in binary,
x = .x1 x2 x3 . . . ,
where, numerically,
( 1 )1 ( 1 )2
x = x1 · + x2 · + ··· .
2 2
Think of the bug at i as an additional “1” in the ith position, defining
( 1 )i
y =x+ .
2
The point of this exercise is that y is an invariant, that is, it does not
change as the bug moves. When the bug moves to the right from point
i, the digit upon which it sat goes up in value by 12 ; therefore, x in-
( )i+1
creases by 12 , but the bug’s own value diminishes by the same
( )i
amount. If the bug moves to the left from i, it gains in value by 12 ,
but x decreases by a whole digit in the ith place to compensate.
264
Unlimited Potentials
The exception is when the bug falls off to the left, in which case
both x and the bug’s own value drop by 12 , for a loss of 1 overall. When
the next bug is added, y goes up by 12 . To put it another way, the value
of x goes up by 12 if a bug is introduced and disappears to the right;
and drops by 12 if a bug is introduced and falls off to the left.
Of course, x must always lie in the unit interval. If its initial value
lies strictly between 0 and 12 , the bugs must alternate right, left, right,
left; if between 12 and 1, the alternation will be left, right, left, right.
The remaining cases can be checked by hand. If x = 1 initially (all
points red) the first bug turns point 1 green and drops off to the left;
the second wiggles off to infinity leaving all points red again, so the
alternation is left, right, left, right. If x = 0 initially (all points green),
the bugs will begin right, right (as the points change to all yellow, then
all red), and then left, right, left, right as before.
The x = 12 case is the most interesting because there are several
ways to represent 12 in our modified binary system: x can be all 12 ’s,
or it can start with any finite number (including 0) of 12 ’s, followed
either by 0111 . . . or 1000 . . . . In the first case, the leadoff bug turns
all the yellows to red as it zooms off to the right; thus, we get a right,
left, right, left alternation. The second case is similar, the first bug
wiggling off to the right, but again leaving all points red behind it. In
the third case, the bug changes the yellows to red as it marches out,
but when it reaches the red point, it reverses and heads left, turning
reds to green on its way to dropping off the left end. Thereafter, we
are in the x = 0 case, so the final pattern is left, right, right, left, right,
left, right.
Checking back all the cases, we see that indeed, whenever the sec-
ond bug went left, the third went right. ♡
265
Mathematical Puzzles
negative entries doesn’t necessarily go down, nor does the size of the
largest negative entry.
Similarly, neither the sum of the absolute values of the differences
between adjacent numbers, nor the sum of the squares of the differ-
ences, seems to go reliably down (or up).
But it turns out, if you take the sum of the squares of the differ-
ences between non-adjacent numbers, it works!
Suppose the numbers are, reading around the pentagon, a, b, c, d
and e. Then the sum in question is s = (a − c)2 + (b − d)2 + (c − e)2 +
(d − a)2 + (e − b)2 . Suppose b is negative and we flip it, replacing b
by −b, a by a + b, and c by c + b. Then the new s is equal to the old s
plus 2b(a + b + c + d + e), and since b is negative and a + b + c + d + e
is positive, s goes down. And since s is an integer, it goes down by at
least 1.
But s is non-negative (being a sum of squares) so it can’t go below
zero. That means we must reach a point where there’s no negative
entry left to flip, and we are done.
But there’s an even better potential—better because it works for
all polygons, not just the pentagon. It’s the sum, over all sets of con-
secutive vertices, of the absolute value of the sum of the numbers in
the set.
An even more remarkable solution was later found by Prince-
ton computer scientist Bernard Chazelle. Construct a doubly-infinite
sequence of numbers whose successive differences are the pentagon
(or polygon) values, reading clockwise around the figure. If the pen-
tagon’s labels began as 1, 2, −2, −3, 3, the sequence might be
. . . , −1, 0, 2, 0, −3, 0, 1, 3, 1, −2, 1, 2, 4, 2, −1, 2, 3, 5, . . . .
Notice that the sequence climbs gradually (since the sum of the
numbers around the polygon is positive) but not steadily (since some
of the numbers around the polygon are negative).
Now the key observation: Flipping a vertex has the effect of trans-
posing pairs of entries of the above sequence that were in the wrong
order—in other words, the flipping process turns into a sorting pro-
cess for our infinite sequence!
For example, if we flip the −2 on our pentagon to get 1, 0, 2, −5,
3, the sequence changes to
. . . , −1, 0, 0, 2, −3, 0, 1, 1, 3, −2, 1, 2, 2, 4, −1, 2, 3, 3, . . . .
It turns out to be easy to find a potential for the sorting progress
that declines by exactly one per turn, and to conclude that not only
266
Unlimited Potentials
does the process always terminate, but it terminates in the same num-
ber of steps and in the same final configuration, no matter which la-
bels you flip!
267
Mathematical Puzzles
How can this be? Sounds like there must be some potential func-
tion at work here, something that is improving each time you throw
someone off or add someone to the current prospective committee.
Let’s see: When you throw someone off, you destroy at least three
on-committee friendships; when you put someone on, you add at
most two. Let F (t) be the number of friendships on the committee
minus 2 12 times the number of people on the committee at time t. Then
when Fred is thrown off, F (t) goes down by at least 12 . When Mona
is put on, F (t) again goes down by at least 12 . But F (0) can’t be more
than (100 × 99)/2 − 250 = 245 and F (t) can never dip below −250,
so there can’t be more than 2 × (245 − (−250)) = 990 steps total. (A
computer scientist would say that the number of steps in the process
is at worst quadratic in the number of faculty members.)
In practice, the number of steps is so small that if there are 100
faculty members and you start with (say) the empty committee, you
will reach a solution easily by hand. Of course, you’ll need access to
the friendship graph, so you might need to do some advance polling.
It might be interesting to see who claims friendship with whom that
isn’t reciprocated.
For the last puzzle, we use the mother of all potentials—potential
energy!
Bulgarian Solitaire
Fifty-five chips are organized into some number of stacks, of arbitrary
heights, on a table. At each tick of a clock, one chip is removed from
each stack and those collected chips are used to create a new stack.
What eventually happens?
268
Unlimited Potentials
269
Mathematical Puzzles
in descending order of height order, and the blocks in each stack num-
bered from bottom to top; then let sij be the ith block in the jth col-
umn. We can size the V-frame and blocks so that the height of the
center of square sij is i+j, and then the potential energy of a con-
figuration will be proportional to the sum over all the blocks of the
quantities i+j.
Now, what happens when we perform an operation? The blocks
along the right-hand arm of the V move to the left-hand arm; their
potential energy does not change. Nor does the potential of the other
blocks, since each of those just moves one position to the right. But
wait, there’s one more step: We might have to rearrange blocks to
get the (original) columns in descending order. That’s equivalent to
letting gravity push blocks downward (diagonally to the left), as in
the next figure, reducing the potential energy of the configuration.
If we’re already in the staircase configuration, we are at minimum
potential energy and rearrangement of the stacks is never again re-
quired. Suppose we’re not in the staircase configuration; what then?
The staircase configuration is possible, to begin with, only because
55 is a “triangular number,” equal to 1 + 2 + 3 + · · · + ( k for
) some k;
these are just the numbers that can be expressed as k+1 2 for some
positive integer k. In the staircase configuration, there’s a block in
every position (i, j) with 2 ≤ i+j ≤ k+1, and no block any higher. It
follows that if the number of blocks is triangular but we’re not in the
triangular configuration, there’s a “hole” somewhere at height k+1
and a block somewhere at height k+2.
As long as no rearrangement is needed, the hole and the block
each move one square to the right at every operation, regularly hitting
the right arm of the V and cycling back to the left. But the hole’s cycles
are of length k and the block’s of length k+1, so eventually the block
will find itself directly above and to the right of the hole. At that point
the block will fall into the hole, decreasing the potential energy of the
configuration.
We have shown, therefore, that if the number of blocks is 55 or
any other triangular number, and the current configuration is not a
staircase, that its potential energy will eventually go down. There are
only finitely many possible configurations, thus only finitely many
values for this potential. It follows that eventually we must reach the
minimum-potential triangular configuration.
270
Unlimited Potentials
the vertex set V into two sets with the property that every vertex in
V has at least as many neighbors in the other part as it has in its own
part.
271
19. Hammer and Tongs
Often, to solve a puzzle (or prove a theorem), you need to try things,
see where problems arise, then fix them. We call this the “hammer-
and-tongs” approach, and sometimes it works wonders.
Phone Call
A phone call in the continental United States is made from a west
coast state to an east coast state, and it’s the same time of day at both
ends of the call. How is this possible?
273
Mathematical Puzzles
could carry at most two people. Can they get to the other side with-
out violating their social norms? If so, what’s the minimum number
of crossings needed?
Solution: This is just a question of trying it out. Call the women
1, 2, and 3, the corresponding husbands A, B, and C. The ideal plan
would require nine crossings, with the boat carrying two people across
and one back with each round trip. If 1 and A cross, it must be A
that returns with the boat (else 1 would find herself on the near shore
with B and C but no husband). Now 2 and 3 must cross with one
woman returning; two men can then join their wives on the far side.
Now, however, a married couple must come back together in the boat,
costing us a couple of crossings and making the nine-crossing ideal
impossible.
Now the remaining men cross the river for good and the women
finish the job. The final plan has eleven crossings, the minimum pos-
sible, and is illustrated below.
274
Hammer and Tongs
Sprinklers in a Field
Sprinklers in a large field are located at the vertices of a square grid.
Each point of land is supposed to be watered by exactly the three
closest sprinklers. What shape is covered by each sprinkler?
Solution: We first must ask ourselves: What are the three sprinklers
closest to a given point in the field? Suppose the point is in the grid
square bounded by sprinklers at a, b, c, and d, labeled clockwise. Di-
vide the square into four congruent subsquares, and call them A, B,
C, and D respectively, according to whether the corner shared with
the big square is a, b, c, or d. It’s not hard to see that for any point in A
the closest three sprinklers are at a, b, and d, and similarly for points
in the other small squares.
It follows that the sprinkler at a has to reach all the points in A,
B, and D, plus the points in corresponding subsquares of the other
three grid squares incident to a. This amounts to 12 little subsquares
in the shape of a fat Greek cross.
Fair Play
How can you get a 50-50 decision by flipping a bent coin?
Solution: Flip the bent coin twice hoping to get a head and a tail; if
the head comes first, call the result HEADS; if the tail comes first, call
it TAILS. If the result is two heads or two tails, repeat the experiment.
This solution is often attributed to the late, great mathemati-
cian and computing pioneer John von Neumann, and called “von
275
Mathematical Puzzles
Neumann’s trick.” It relies on the fact that even if the coin is bent, suc-
cessive flips are (or at least should be) independent events. Of course,
it also relies on it being at least possible for the bent coin to land on
either side!
If you want to minimize the number of flips to get your decision,
the above scheme can be improved upon. For example, if you get HH
for the first pair of flips and TT for the second, you can quit and call
the result HEADS (TT followed by HH would then be called TAILS).
276
Hammer and Tongs
Poorly-Placed Dominoes
What’s the smallest number of dominoes one can place on a chess-
board (each covering two adjacent squares) so that no more fit?
277
Mathematical Puzzles
Can we do any better? Note that except for holes on the top row,
every hole has a domino directly above it—and no domino can be
directly above two holes. Moreover, dominoes that touch the bottom
row (of which there must be at least 3) aren’t helping.
In the best case, therefore, where there are four holes on the top
row and three dominoes touching the bottom, d ≥ h−1 and therefore
(64 − h)/2 ≥ h − 1, 33 ≥ 3h/2, h ≤ 22.
But wait, if we really did have four holes on the top row and only
three dominoes touching the bottom, then we could up-end the above
argument to show that h ≤ 23. But this is impossible since the number
of holes must be even. Conclusion: we can’t beat our 22-hole solution.
Dominoes appear in many intriguing puzzles.
278
Hammer and Tongs
Solution: No. You need two dominoes, not just one, to cross each
interior line—with just one, there’s be an odd number of squares on
each side of that line, but that number is a multiple of 6. Since there
are 10 interior lines, you’ll need 20 crossing dominoes, but there’s
room for only 62 /2 = 18 dominoes on the board. The 6 × 5 rectan-
gle is in fact the only one with both dimensions under 7 that can be
“unbreakably” covered.
Filling a Bucket
Before you are 12 two-gallon buckets and a 1-gallon scoop. At each
turn, you may fill the scoop with water and distribute the water any
way you like among the buckets.
However, each time you do this your opponent will empty two
buckets of her choice.
You win if you can get one of the big buckets to overflow. Can you
force a win? If so, how long will it take you?
Solution: It’s safe to assume your opponent will always empty the
fullest two buckets. To force your opponent to pour out as little water
as possible, it’s natural to begin by keeping all the buckets at the same
level. How far will this get you?
You’ll start by putting 1/12 of a gallon in each bucket; your op-
ponent will empty two buckets, reducing the total amount of water
to 10/12. You can then add a gallon total to bring each bucket up
to (1 + 10/12)/12 = 11/72. Continuing in this manner, you make
progress as long as the amount in each bucket is less than half a gal-
lon (since then your opponent is pouring off less than you’re adding).
You can get close to, but never quite reach, half a gallon per bucket
by this method. Then what?
Then you’re going to need to give up on keeping all the buckets
level. Suppose you build up to x gallons per bucket, then give up on
the two buckets your opponent just emptied, and fill the rest evenly.
Then you can get x + 1/10 gallons in those; she empties two of them
and you build up to x + 1/10 + 1/8 in the remaining eight, and so on.
You end with x+1/10+1/8+1/6+1/4+1/2 = x+1.141666 in the
last two buckets, not good enough to cause overflow, since x < 1/2.
But wait—you don’t need two buckets overflowing, only one. So,
you start by building up only 11 buckets, with the idea of later re-
ducing to 9, 7, 5, 3, and finally, 1 bucket. That will get you up to
x + 1/9 + 1/7 + 1/5 + 1/3 + 1 ∼ x + 1.7873015873. That’s more like
it! So it’s enough to get x ≥ 0.2127.
279
Mathematical Puzzles
Solution: Both are equal to the area of the polygon. One way to
see that is to let L1 , . . . , Lk be the integer-height horizontal lines that
intersect the interior of the polygon, dividing it into two triangles (at
the top and bottom ends) and k−1 trapezoids. If the length of the
segment of Li that intersects the polygon is ℓi , then the sum of the
areas of the triangles and trapezoids is
1 1 1 1 1
ℓ1 + (ℓ1 + ℓ2 ) + (ℓ2 + ℓ3 ) + · · · + (ℓk−1 + ℓk ) + ℓk ,
2 2 2 2 2
which equals h, and a similar argument holds for v.
One-Bulb Room
Each of n prisoners will be sent alone into a certain room, infinitely
often, but in some arbitrary order determined by their jailer. The pris-
oners have a chance to confer in advance, but once the visits begin,
their only means of communication will be via a light in the room
which they can turn on or off. Help them design a protocol which
will ensure that some prisoner will eventually be able to deduce that
everyone has visited the room.
280
Hammer and Tongs
More precisely, Alice always turns on the light if she finds it off,
otherwise she leaves it on. The rest of the prisoners turn it off the first
two times they find it on, but otherwise leave the light alone.
Alice keeps track of how many times she finds the room dark after
her initial visit; after 2n−3 dark revisits she can conclude that everyone
has visited. Why? Every dark revisit signals that one of the other n−1
prisoners has visited. If one of them, say Bob, hasn’t been in the room,
then the light cannot have been turned off more than 2(n−2) = 2n−4
times. On the other hand, Alice must eventually achieve her 2n − 3
dark revisits because eventually the light will have been turned off
2(n−1) = 2n−2 times and only one of these (caused by a prisoner
darkening an initially light room before Alice’s first visit) can fail to
cause a dark revisit by Alice.
Solution: Yes. Let the numbers be x1 < x2 < · · · < x25 , and sup-
pose that every two of them have either their sum or their difference
represented among the other numbers. For i < 25, x25 + xi can’t be
on the list, so x25 − xi must be there; it follows that the first 24 num-
bers are paired with xi + xn−i = x25 . Now consider x24 together with
any of x2 , . . . , x23 ; these pairs sum to more than x25 = x24 + x1 and
so x2 , . . . , x23 must also be paired, and in particular x2 + x23 = x24 .
But we just had x2 + x23 = x25 , a contradiction.
281
Mathematical Puzzles
Love in Kleptopia
Jan and Maria have fallen in love (via the internet) and Jan wishes to
mail her a ring. Unfortunately, they live in the country of Kleptopia
where anything sent through the mail will be stolen unless it is sent
in a padlocked box. Jan and Maria each have plenty of padlocks, but
none to which the other has a key. How can Jan get the ring safely
into Maria’s hands?
Solution: In one solution, Jan sends Maria a box with the ring in
it and one of his padlocks on it. Upon receipt Maria affixes her own
padlock to the box and mails it back with both padlocks on it. When
282
Hammer and Tongs
Jan gets it he removes his padlock and sends the box back to Maria,
who can now open her own padlock and enjoy the ring. This solu-
tion is not just play; the idea is fundamental in Diffie-Hellman key
exchange, an historic breakthrough in cryptography.
Depending on one’s assumptions, other solutions are possible as
well. A nice one was suggested by several persons at the Gathering
for Gardner VII, including origami artist Robert Lang: It requires that
Jan find a padlock whose key has a large hole, or at least a hole which
can be sufficiently enlarged by drilling, so that the key can be hooked
onto a second padlock’s hasp.
Jan uses this second padlock, with the aforementioned key
hooked on its hasp, to lock a small empty box which he then sends
to Maria. When enough time has passed for it to get there (perhaps
he awaits an email acknowledgment from Maria) he sends the ring in
another box, locked by the first padlock. When Maria gets the ring
box, she picks up the whole first box and uses the key affixed to it to
access her ring.
Solution: Let us first note that for the problem to make sense, we
must assume that the hands move continuously, and that we are not
tasked with deciding whether a time is a.m. or p.m. (We assume there
is no “second hand.”) Note that we can tell what time it is when the
hour and minute hands coincide, even though we can’t tell which
hand is which; this happens 22 times a day, since the minute hand
goes around 24 times while the hour hand goes around twice, in the
same direction.
This reasoning turns out to be good practice for the proof. Imag-
ine that we add to our clock a third “fast” hand, which starts at 12
midnight and runs exactly 12 times as fast as the minute hand.
Now we claim that whenever the hour hand and the fast hand
coincide, the hour and minute hands are in an ambiguous position.
Why? Because later, when the minute hand has traveled in all 12 times
as far as it had moved since midnight, it will be where the fast hand
(and thus also the hour hand) is now, while the hour hand is where the
minute hand is now. That’s the definition of an ambiguous moment.
283
Mathematical Puzzles
284
Hammer and Tongs
If the worms have no high-up way to get in her bedroom, Lori can
more easily accomplish this same task by encircling the room itself
with a water-filled gutter.
Funny Dice
You have a date with your friend Katrina to play a game with three
dice, as follows. She chooses a die, then you choose one of the other
two dice. She rolls her die while you roll yours, and whoever rolls the
higher number wins. If you roll the same number, Katrina wins.
Wait, it’s not as bad as you think; you get to design the dice! Each
will be a regular cube, but you can put any number of pips from 1 to
6 on any face, and the three dice don’t have to be the same.
Can you make these dice in such a way that you have the advan-
tage in your game?
285
Mathematical Puzzles
The key is that if die A’s roll has the same average as die B’s, that
doesn’t mean A beats B half of the time. It could be that when A beats
B, it wins by a lot (e.g., 6 versus 1) but when it loses, it does so by only
a little bit (e.g., 5 versus 4). Then it would follow that B would win
more often.
To take an extreme example, put a 6 and a five 3’s on die A (av-
eraging 3.5), and a 1 and five 4’s on die B (same average). Then with
probability 56 × 56 = 25/36 > 1/2, there’ll be a 3 on die A and a 4 on
die B. And you’ve eliminated ties by using different numbers on the
two dice.
Let’s use the remaining numbers, 2 and 5, on die C—three of each,
so that again the average roll is 3.5. It remains only to check that,
indeed, die C is a favorite over die B (winning anytime C rolls a 5,
and also occasionally 2 to 1, altogether with probability 7/12), but die
A is the expected winner over die C. Since we already know B beats
A, your strategy against Katrina is clear.
Sharing a Pizza
Alice and Bob are preparing to share a circular pizza, divided by radial
cuts into some arbitrary number of slices of various sizes. They will
be using the “polite pizza protocol”: Alice picks any slice to start;
thereafter, starting with Bob, they alternate taking slices but always
from one side or the other of the gap. Thus after the first slice, there
are just two choices at each turn until the last slice is taken (by Bob if
the number of slices is even, otherwise by Alice).
Is it possible for the pizza to have been cut in such a way that Bob
has the advantage—in other words, so that with best play, Bob gets
more than half the pizza?
Solution: If the number of slices is even (as with most pizzas), the
puzzle Coins in a Row from Chapter 7 applies and Alice can always
get at least half the pizza. In fact that is so even if Bob gets to start
by choosing one radial cut and insisting that Alice’s choice of first
slice be on one side or the other of that cut. That makes the problem
exactly the same as Coins in a Row; Alice can just number the slices 1,
2, etc. starting clockwise (say) from the cut, and play so as to take all
the even-numbered slices or all the odd, whichever is better for her.
The argument fails if the number of slices is odd. But the odd case
sounds even better for Alice since then she ends up with more slices.
How can we get a handle on the odd case?
286
Hammer and Tongs
Taking another cue from the Chapter 7, let’s limit the slice sizes
to 0 or 1. (Can a slice be of size zero? Mathematically, no problem;
gastronomically, think of a slice of size ε = one one-hundredth of a
pizza, say.) To try to give the advantage to Bob, we somehow need to
organize these so that no matter where Alice begins, Bob can use his
parity advantage to overcome Alice’s one-slice head start.
That takes a fair number of slices, but it turns out that 21 of these
{0, 1}-sized slices is enough to turn the advantage to Bob. With a
bit more fooling around, you will find that you can combine some
of the slices to get a 15-slice pizza with slice-sizes 0, 1, and 2 of
which nothing can stop Bob from acquiring 5/9. (Two schemes work:
010100102002020 and 010100201002020.) Pictured below is one of
the Bob-friendly 15-slice schemes, with pepperoni distributed to in-
dicate the slice sizes. No matter how she plays, Alice can never get
more than 4 of the 9 pepperoni chunks against a smart, hungry Bob.
It has been shown that this pizza is best possible for Bob. Sum-
mary: If the number of slices is even, or odd but at most 13, Alice can
get at least half the pizza; if the number of slices is odd and at least
15, she can guarantee at least 4/9 but no larger fraction.
287
Mathematical Puzzles
Names in Boxes
The names of 100 prisoners are placed in 100 wooden boxes, one
name to a box, and the boxes are lined up on a table in a room. One
by one, the prisoners are led into the room; each may look in at most
50 boxes, but must then leave the room exactly as he found it and is
permitted no further communication with the others.
The prisoners have a chance to plot their strategy in advance, and
they are going to need it, because unless every single prisoner finds his
own name all will subsequently be executed.
Find a strategy that gives the prisoners a decent chance of survival.
288
Hammer and Tongs
Life-Saving Transposition
There are just two prisoners this time, Alice and Bob. Alice will be
shown a deck of 52 cards spread out in some order, face-up on a table.
She will be asked to transpose two cards of her choice. Alice is then
dismissed, with no further chance to communicate to Bob. Next, the
cards are turned down and Bob is brought into the room. The warden
names a card and to stave off execution for both prisoners, Bob must
find the card after turning over, sequentially, at most 26 of the cards.
As usual the prisoners have an opportunity to conspire before-
hand. This time, they can guarantee success. How?
Self-Referential Number
The first digit of a certain 8-digit integer N is the number of zeroes in
the (ordinary, decimal) representation of N . The second digit is the
number of ones; the third, the number of twos; the fourth, the number
of threes; the fifth, the number of fours; the sixth, the number of fives;
289
Mathematical Puzzles
the seventh, the number of sixes; and, finally, the eighth is the total
number of distinct digits that appear in N . What is N ?
290
Hammer and Tongs
Sadly, I don’t know. This method does not work with all problems
of this type. But it is surprisingly useful—a great weapon to have in
your armory.
291
Mathematical Puzzles
The formula certainly works when the polygon is a single grid cell,
since there I = 0 and B = 4.
Unfortunately we can’t generally build lattice polygons out of grid
cells, but it’s worth thinking about how we could build them out of
smaller units. Suppose P is the union of two lattice polygons R and
S that share one side from each, as in the next figure.
If the formula is correct for R and S, does it follow that it’s correct
for P ? Indeed, that is the case: If there are k lattice points on the com-
mon edge, not counting its endpoints, then we have IP = IR + IS + k
and BP = BR + BS − k − 2, so that the area of P is IR + IS + k +
(BR + BS − k − 2)/2 − 1 = (IR + BR /2 − 1) + (IS + BS /2 − 1)
which is indeed the area of R plus the area of S. So far so good.
Note that this calculation also shows that if the formula is cor-
rect for any two of the three polygons P , R, and S, it works for the
third—in other words, the formula works with subtraction as well as
addition.
That’s great—and because we can cut any lattice polygon into lat-
tice triangles, as in the next figure, it’s enough to prove the theorem for
triangles. This is something of a hammer-and-tongs type operation.
292
Hammer and Tongs
First we note that right triangles are easy, if their sides are vertical
and horizontal line segments. The reason is that we can copy such a
triangle, rotate the copy 180◦ , then match its hypotenuse to the orig-
inal to get an “aligned” lattice rectangle (i.e., one with sides parallel
to the axes).
The formula holds for aligned rectangles, because they’re made
out of unit cells. Since our two triangles have the same values for I and
B, Pick’s formula assigns them the same area which must therefore
be half the area of the aligned rectangle, as it should be.
Finally, we only need observe that any triangle can be made into
an axis-aligned rectangle by adding (at most) three right triangles of
the above sort, as in the final figure. ♡
293
20. Let's Get Physical
Rotating Coin
While you hold a US 25-cent piece firmly to the tabletop with your
left thumb, you rotate a second quarter with your right forefinger all
the way around the first quarter. Since quarters are ridged, they will
interlock like gears and the second will rotate as it moves around the
first.
295
Mathematical Puzzles
296
Let's Get Physical
Falling Ants
Twenty-four ants are placed randomly on a meter-long rod; each ant
is facing east or west with equal probability. At a signal, they proceed
to march forward (that is, in whatever direction they are facing) at 1
cm/sec; whenever two ants collide, they reverse directions. How long
does it take before you can be certain that all the ants are off the rod?
297
Mathematical Puzzles
Solution: This time we have to be a bit more careful about the ants’
anonymity; the argument that we can replace bouncing by passing
tells us only that the ants’ set of locations will be exactly the same after
100 seconds, but any particular ant might end up in some other ant’s
starting spot.
In fact, since the ants cannot pass one another, their final locations
will be some rotation of their initial locations. Putting it another way,
the whole collection will rotate by some number of ants, and we are in
effect being asked to determine the probability that that number will
be a multiple of 24.
In fact it could be 24 (clockwise or counterclockwise) only if the
ants are all facing the same way, thus each walks once around the track
without any collisions. There are 224 ways to choose how the ants
face of which only two have this property, so the probability of one of
these outcomes is a minuscule 1/223 .
Much more likely is that the net rotation will be zero. When does
that happen? Well, conservation of angular momentum tells us that the
rate of rotation of the ant collection as a whole is constant. Thus the
net rotation will be zero if and only if the initial rate of rotation is zero,
meaning that exactly the same number ants start off facing (counter- ) 24
clockwise as clockwise. The probability of that happening is 24 12 /2
which is about 16.1180258%. Adding 1/223 to that boosts the final
answer to about 16.1180377%.
298
Let's Get Physical
299
Mathematical Puzzles
ball’s momentum flips, reflecting the new point across the X-axis back
to the positive side.
In this way the system point zigzags down and up, moving slightly
eastward on the down-zigs, until finally it reaches a point just a bit
northwest of (1,0) from which moving southeast along a line of slope
s would either miss the circle entirely or hit it above the X-axis. That
indicates there will be no more collisions.
The figure below shows our circle, with four system states corre-
sponding to the first two and last two system points.
300
Let's Get Physical
We’re a bit lucky that this already works for k = 1 (if we change
from base 10 to some other base, it sometimes fails for k = 1). But as
k goes up the approximation above gets better so rapidly that there’s
only a wisp of a chance that it every fails.
What would it take to fail? Roughly speaking, it would miss by 1 if
for some k, digits k+1 through 2k of the decimal expansion of π were
all 9’s. If, as most mathematicians believe, the digits of π behave like
a random sequence, this is ludicrously unlikely. (In 2013 A.J. Yee and
S. Kondo computed the first 12.1 trillion digits of π, with no more
than a dozen 9’s in a row anywhere, about what you’d expect.)
But no one has been able to prove that the digits of π continue to
behave randomly, and even if they did the above glitch could occur.
So it’s not a theorem. But you could bet your life on it.
Theorem. For any polyhedron, the sum over all faces F of the vectors vF is
zero.
Proof. Pump the polyhedron full of air! The pressure on each face
F will be proportional to the area of F , and is exerted outwardly
301
Mathematical Puzzles
302
21. Back from the Future
Nothing says you have to try to solve a puzzle by starting with the
premise, then working straight toward the answer. Often starting from
the end—“retrograde analysis” is the fancy term for it—will make
things much easier. (Are you among those that think solving a maze
any way other than by drawing a line from “start” to “finish” is tanta-
mount to cheating? That’s fine if that makes it more fun for you, but
I advise against applying this strategy to every puzzle.)
Consider the following classic.
Portrait
A visitor points to a portrait on the wall and asks who it is. “Brothers
and sisters have I none,” says the host, “but that man’s father is my
father’s son.” Who is pictured?
Three-way Duel
Alice, Bob, and Carol arrange a three-way duel. Alice is a poor shot,
hitting her target only 13 of the time on average. Bob is better, hitting
his target 23 of the time. Carol is a sure shot.
They take turns shooting, first Alice, then Bob, then Carol, then
back to Alice, and so on until only one is left. What is Alice’s best
course of action?
303
Mathematical Puzzles
Solution: Let’s think about the situation after Alice takes her turn.
If only Carol survives Alice’s turn, Alice is doomed. If only Bob sur-
vives, Alice has probability p of survival where p = 13 ( 13 + 23 p), giving
p = 1/7, not very good. If both Bob and Carol survive, things are
much better because they will aim at each other, with only one sur-
vivor, at whom Alice gets to shoot first. Thus, in that situation, her
survival probability is more than 13 .
It follows that Alice doesn’t want to kill anyone, and her best
course of action is to shoot to miss!
But wait. We’e been assuming the others wouldn’t do that, but
now that we have allowed Alice the option of abstaining, we must
surely allow it to the others. They can work out that whenever three
duelers are still alive, Alice will never aim to kill. Again applying ret-
rograde analysis, if it gets to Carol’s turn with no one dead, should she
kill Bob? If Bob tried to shoot her, then yes. But if Bob shot into the
air, thereby suggesting a willingness to do so indefinitely, then Carol
should do the same—that way, no one’s life is at risk and when the
ammunition runs out, everyone can go home and do math puzzles.
Going back one turn, we deduce that Bob should indeed shoot into
the air and the whole duel will be a dud.
Thinking back on it, it’s pretty obvious that if the highest prior-
ity for all three parties is to stay alive—which is what we’ve been
assuming—then the duel should never have been arranged.
Here’s an application of retrograde analysis to experimental de-
sign.
304
Back from the Future
possible egg rating m (namely, the highest floor from which the first
egg survived) and some maximum possible egg rating M (one less
than the floor from which the first egg went splat). That adds up to
M −m drops.
The plan for dropping the first egg will be some increasing se-
quence of floors, say f1 , f2 , . . . , fk . The spaces between the fi ’s will
be decreasing, since (assuming you want to prevent having to make
more than some fixed number d of drops) the more drops made with
the first egg, the fewer remain for the second.
For example, suppose Oskar’s first drop of the first egg is from the
10th floor. If it breaks, he’s got 9 floors to try with the 2nd egg, for a
total of 10 drops. But then to prevent having to make 11 drops, he’d
have to make his second drop of egg number one from the 19th floor,
allowing for 8 more drops of the 2nd egg, the 3rd from the 27th floor,
4th from the 34th, 5th from the 40th, 6th from the 45th, 7th from the
49th, 8th from the 52nd, 9th from the 54th, and 10th from the 55th.
That’s his ten drops, so he’d be OK only if the building had at most
55 floors.
How high must Oskar start, to make it to floor 102? Easy way to
figure this out: Start at the other end! Add 1 + 2 + 3 + · · · until you
reach or exceed 102, and your last addend, which proves to be 14, is
Oskar’s starting floor—and also his guaranteed maximum number of
drops. Later drops of the first egg, until it breaks, are at floors 27, 39,
50, 60, 69, 77, 84, 90, 95, 99, and 102.
305
Mathematical Puzzles
306
Back from the Future
Pancake Stacks
At the table are two hungry students, Andrea and Bruce, and two
stacks of pancakes, of height m and n. Each student, in turn, must eat
from the larger stack a non-zero multiple of the number of pancakes
in the smaller stack. Of course, the bottom pancake of each stack is
soggy, so the player who first finishes a stack is the loser.
For which pairs (m, n) does Andrea (who plays first) have a win-
ning strategy?
How about if the game’s objective is reversed, so that the first
player to finish a stack is the winner?
Solution: Let m and n be the two stack sizes. You (if you are play-
ing) are immediately stuck just when m = n; this is therefore a P
position. If m > n and m is a multiple of n, you are in a winning
N position because you can then eat m−n pancakes from the n-stack
and reduce your opponent to the above P position. In particular, if
the short stack has just one pancake, you are in great shape.
What if m is close to a multiple of n? Suppose, for example, that
m = 9 and m = 5. Then you are forced to reduce to m = 4, n = 5
but your opponent must now give you a 1-stack. If m = 11 and n = 5
you have a choice but reducing to m = 6, n = 5 wins for you.
It’s beginning to look like you want to make the ratio of the stacks
small for your opponent, forcing her to make the ratio big for you.
Let’s see. Suppose the current ratio r = m/n is strictly between 1 and
1
2; then the next move is forced and the new ratio is 1−r . These ratios
√
are equal only for r = ϕ = (1+ 5)/2 ∼ 1.618, the golden mean; since
1
ϕ is irrational, one of the two ratios r and 1−r must exceed ϕ while the
other is smaller than ϕ. Aha! Thus, when you present your opponent
with r < ϕ she must make it bigger, then you make it smaller, etc.,
until she’s stuck with r = 1 and must lose!
We conclude that Andrea wins exactly when the initial ratio of
larger to smaller stack exceeds ϕ. In other words, the P positions of
the game are exactly those with m/n < ϕ, where m ≥ n. To see this,
suppose m > ϕn, but m is not a multiple of n. Write m = an + b,
where 0 < b < n. Then either n/b < ϕ, in which case Alice eats an,
or n/b > ϕ, in which case she eats only (a−1)n. This leaves Bruce
with a ratio below ϕ, and faced with a forced move which restores a
ratio greater than ϕ.
Eventually, Andrea will reach a point where her ratio m/n is an
integer, at which point she can reduce to two equal stacks and stick
Bruce with a soggy pancake. But note that she can also, if desired, grab
307
Mathematical Puzzles
a whole pile for herself, thus winning the alternative game where the
eater of a soggy pancake is the victor.
Of course, if Andrea is instead faced with a ratio m/n which is
strictly between 1 and ϕ, she is behind the eight-ball and it is Bruce
who can force the rest of the play.
We conclude that no matter which form of Pancakes is played, if
the stacks are at heights m > n, Andrea wins precisely when m/n >
ϕ. Only in the trivial case when the stacks are initially of equal height
does it matter what the game’s objective is!
Try the above approach on this similar game.
Chinese Nim
On the table are two piles of beans. Alex must either take some beans
from one pile or the same number of beans from each pile; then Beth
has the same options. They continue alternating until one wins the
game by taking the last bean.
What’s the correct strategy for this game? For example, if Alex is
faced with piles of size 12,000 and 20,000, what should he do? How
about 12,000 and 19,000?
308
Back from the Future
309
Mathematical Puzzles
is the case, and you can prove it using the theorem at the end of this
chapter. The key is that because r and r2 are irrational numbers that
sum to 1, every positive integer can be uniquely represented either as
⌊rj⌋ for some integer j, or ⌊r2 k⌋ for some integer k.
Let’s use this to find Alex’s move in the example positions. Note
that 12000/r is a fraction under 7417, and 7417r = 12000.9581 . . . so
12000 is an xi , namely x7417 . The corresponding y7417 is ⌊7417r⌋ =
19417 so if the other pile has 20000 beans, Alex can win by taking
20000 − 19417 = 583 beans away from it. If there are only 19000
beans in the other pile, Alex can win instead by reducing the piles
simultaneously to {x7000 , y7000 } = {11326, 18326}. Since 1900 hap-
pens to be a yj , namely y2674 , Alex can also win by reducing the x-pile
to x2674 = ⌊2674r⌋ = 4326.
310
Back from the Future
Let’s see how this process would start (in other words, how the
game ends). The 21’s are all P positions, since the previous player has
now won the game. Position 20A is also a P position, since the 1 is
unavailable to turn to; the player facing 20A will have to overshoot
and lose. The other 20’s, 20B and 20C, are N positions.
Continuing in this way, you eventually determine the state of the
six possible opening positions, namely 1A, 2B, 3C, 4C, 5B, and 6A
(boxed in the figure below). It turns out that of these only 3C and 4C
are P positions, so if you go first, you will with probability 23 start with
an N position and be able to force a win.
311
Mathematical Puzzles
It’s perhaps worth noting that in some vague sense, you usually
want to be the first player in a combinatorial game that begins in a
random position. The reason is that the condition for being an N po-
sition (that some move leads to a P) is milder than the condition for
being a P position (that every move leads to an N position). This is
why you usually find more N positions than P. When the game starts
in an N position, you want to be first to play.
Game of Desperation
On a piece of paper is a row of n empty boxes. Tristan and Isolde take
turns, each writing an “S” or an “O” into a previously blank box. The
winner is the one who completes an “SOS” in consecutive boxes. For
which n does the second player (Isolde) have a winning strategy?
312
Back from the Future
Deterministic Poker
Unhappy with the vagaries of chance, Alice and Bob elect to play
a completely deterministic version of draw poker. A deck of cards
is spread out face-up on the table. Alice draws five cards, then Bob
draws five cards. Alice discards any number of her cards (the dis-
carded cards will remain out of play) and replaces them with a like
number of others; then Bob does the same. All actions are taken with
the cards face-up in view of the opponent. The player with the better
hand wins; since Alice goes first, Bob is declared to be the winner if
the final hands are equally strong. Who wins with best play?
Solution: You need to know a little about the ranking of poker
hands for this puzzle: Namely, that the best type of hand is the straight
flush (five cards in a row of the same suit), and that an ace-high
straight flush (known as a “royal flush”) beats a king-high straight
flush and on down.
That means if Bob is allowed to draw a royal flush, Alice’s goose
is cooked. For Alice to have a chance, her initial hand must contain a
card from each of the four possible royal flushes.
The best card of each suit, for that purpose, is the 10, since it stops
all straight flushes which are 10-high or better. Indeed, a moment’s
thought will convince you that any hand of Alice’s containing the
four 10s will win. Bob cannot now hope to get a straight flush better
than 9-high. To stop Alice getting a royal flush, he must draw at least
one high card from each suit, leaving room for only one card below
a 10. Alice can now turn in four cards and make herself a 10-high
straight flush in a suit other than the suit of Bob’s low card, and Bob
is helpless.
Alice has other winning hands as well—see if you can find them
all!
The next puzzle is a difficult one, asking you to solve a bluffing
game (even the simplest of bluffing games need some machinery to
analyze; imagine what poker might require!). For this we do need the
concept of equilibrium—a pair of strategies, one for each player, with
the property that neither player can improve her results by changing
strategy, if the other player doesn’t change hers. Example: In Rock-
Paper-Scissors, the unique equilibrium is achieved when both players
choose each of the three options with equal probability.
For many games, and all bluffing games, equilibrium strategies
are (like the ones for Rock-Paper-Scissors) randomized. To find these
313
Mathematical Puzzles
strategies (which, by the way, are often but not always unique) you
can take advantage of the following fact.
Suppose the equilibrium strategy for Player I calls for her to
choose among several options, say A1 , . . . , Ak , each with some posi-
tive probability. Then each option must give her the same expectation
against Player II’s strategy. Why? because if the expectation of, say,
option A3 were among the highest and better than that of some other
options, she could improve her results by choosing A3 instead of ran-
domizing; and this contradicts the definition of equilibrium.
Solution: For each value x that she could get, Louise has to decide
whether to pass or raise; and for each value y that Jeremy could get,
he has to decide whether to call or fold if Louise raises. Thus, there are
in principle infinitely many strategies for each—a pretty big infinity,
too (technically, two to the power of the continuum).
So to find equilibrium strategies, we’ll need to restrict our search
space. A little thought will convince you that Jeremy needn’t consider
any strategy not of the form “call just when y > q” for some fixed
threshold q. The reason is that no matter what Louise does, a higher
value of y cannot increase Jeremy’s incentive to fold.
So let’s assume that Jeremy has picked such a threshold q and con-
sider Louise’s best response when holding the value x. If she passes,
she wins $1 when y < x (probability x) and otherwise loses $1, so her
expectation is
Suppose x > q. Then when y < q Louise wins $1 whatever she does;
314
Back from the Future
when y > q the game is in Louise’s favor just when x is more than
halfway from q to 1, that is, when x > (q+1)/2, so that’s when she
should raise.
What about when x < q? Should Louise ever raise? If she doesn’t,
we know her expectation is $(2x − 1), which is dismally low when x
is small. If she does raise, she wins $1 when her bluff works, that is,
when y < q, otherwise she loses $2, for a net expectation of
• When x < 0.1 Louise bluffs, winning $1 when y < 0.4 and
losing $2 otherwise for a net gain of −$0.80.
• When 0.1 < x < 0.7 Louise passes and, with her average hold-
ing of x = 0.4, earns $0.40 − $0.60 = −$0.20.
• Finally, when x > 0.7 Louise breaks even on average when
y > 0.7 as well, but she picks up $1 when y < 0.4, and $2
when 0.4 < y < 0.7 and Bob calls her raise. This gives her a net
average profit of $1 even.
315
Mathematical Puzzles
Swedish Lottery
In a proposed mechanism for the Swedish National Lottery, each par-
ticipant chooses a positive integer. The person who submits the low-
est number not chosen by anyone else is the winner. (If no number is
chosen by exactly one person, there is no winner.)
If just three people participate, but each employs an optimal, equi-
librium, randomized strategy, what is the largest number that has pos-
itive probability of being submitted?
316
Back from the Future
Solution: Note first that if the pegs begin on the points of a grid (i.e.,
points on the plane with integer coordinates), then they will remain
on grid points.
In particular, if they sit initially at the corners of a unit grid square,
then they certainly cannot later find themselves at the corners of a
smaller square since no smaller square is available on the grid points.
But why not a larger one?
Here’s the key observation: The jump step is reversible! If you
could get to a larger square, you could reverse the process and end
up at a smaller square, which we now know is impossible.
Slightly trickier:
Touring an Island
Aloysius is lost while driving his Porsche on an island in which ev-
ery intersection is a meeting of three (two-way) streets. He decides to
adopt the following algorithm: Starting in an arbitrary direction from
his current intersection, he turns right at the next intersection, then
left at the next, then right, then left, and so forth.
Prove that Aloysius must return eventually to the intersection at
which he began this procedure.
317
Mathematical Puzzles
Fibonacci Multiples
Show that every positive integer has a multiple that’s a Fibonacci
number.
Solution: We need to show that for any n, as we generate the Fi-
bonacci numbers (1, 1, 2, 3, 5, 8, 13, 21, 34, etc.) we eventually
find one that is equal to zero modulo n. We normally define the Fi-
bonacci numbers by specifying that F1 = F2 = 1 and for k > 2,
Fk = Fk−1 + Fk−2 .
As it stands, this does not seem like a reversible process; given the
value (modulo n) of, say, Fk+1 , we can’t immediately determine the
value (again, modulo n) of Fk . But if we keep track of the value mod-
ulo n of two consecutive Fibonacci numbers, then we can go backwards
by just subtracting.
For example, if n = 9 and F8 ≡ 3 mod 9 and F7 ≡ 4 mod 9
then we know F7 ≡ 3 − 4 ≡ 8 mod 9. Putting it another way, if we
define Dk = (Fk mod n, Fk+1 mod n), then the Dk ’s constitute a
reversible process.
But so what? We’d like to find a k such that one of the coordinates
of Dk is zero, but how do we know it doesn’t cycle among pairs that
don’t contain a zero?
Aha, a second trick: Start the Fibonacci numbers with F0 = 0,
that is, start one step ahead with 0, 1, 1, 2, 3, etc. Then D0 = (0, 1)
and therefore eventually (after at most n2 steps, in fact) Dk will cycle
back to (0,1), which means that Fk is a multiple of n.
If we take n = 9 as above, for instance, our Dk ’s, beginning with
D0 , are (0,1), (1,1), (1,2), (2,3), (3,5), (5,8), (8,4), (4,3), (3,7), (7,1),
(1,8), (8,0) and we can stop there with F12 = 144 ≡ 0 mod 9. The
D sequence continues (0,8), (8,8), (8,7), (7,6), (6,4), (4,1), (1,5), (5,6),
(6,2), (2,8), (8,1), (1,0), (0,1) so it cycles back in this case after only 24
steps.
318
Back from the Future
Prove that if you continue around and around the ring in this man-
ner, eventually all the bulbs will again be on.
Solution: We observe first that there is no danger of turning all the
lights off; if a change is made at time t, bulb t (modulo n) is still on.
Moreover, if we look at the circle just after time t, we can deduce the
state of the bulbs before t (by changing the state of bulb t+1 if bulb t
is on). Thus the process is reversible, provided we take care to include
in the state information not only which bulbs are on and which off,
but which bulb is the one whose state determined the last action.
The number of possible states is less than n×2n , thus is finite, and
we can apply the above argument to conclude that we will eventually
cycle back to the initial all-on state—moreover, we can even insist that
that we reach such a point at a moment when we are slated to again
examine bulb #1.
In the next puzzle, reversibility is just a part of the solution.
Emptying a Bucket
You are presented with three large buckets, each containing an inte-
gral number of ounces of some non-evaporating fluid. At any time,
you may double the contents of one bucket by pouring into it from a
fuller one; in other words, you may pour from a bucket containing x
ounces into one containing y ≤ x ounces until the latter contains 2y
ounces (and the former, x−y).
Prove that no matter what the initial contents, you can, eventually,
empty one of the buckets.
319
Mathematical Puzzles
Solution: There is more than one way to solve this puzzle, but our
strategy here will be to show that the contents of one of the buckets
can always be increased until one of the other buckets is empty.
To do this, we first note that we can assume there is exactly one
bucket containing an odd number of ounces of fluid. This is true be-
cause if there are no odd buckets, we can scale down by a power of 2;
if there are two or more odd buckets, one step with two of them will
reduce their number to one or none.
Second, note that with an odd and an even bucket we can always
do a reverse step, that is, get half the contents of the even bucket into
the odd one. This is because each state of this pair of buckets can be
reached from at most one state, thus if you take enough steps, you
must cycle back to your original state; the state just before you return
is the result of your “reverse step.”
Finally, we argue that as long as there is no empty bucket, the
odd bucket’s contents can always be increased. If there is a bucket
whose contents are divisible by 4, we can empty half of it into the odd
bucket; if not, one forward operation between the even buckets will
create such a bucket. ♡
Our last “reversibility” puzzle is—there’s no other word for it—
unbelievable.
320
Back from the Future
321
Mathematical Puzzles
We claim that these are the angles of all cuts that you will ever
make. In fact, it is not hard to see that the set S is closed under our
operation. The angle 0 maps to itself, while the angle −θ = 2π − θ =
(k−1)θ − δ maps to θ. The only line on the piece thus cut is at angle
(k−1)θ, which then moves to θ − δ. The rest of the angles are shifted
up by θ as the cake rotates, so mθ moves to (m+1)θ and mθ−δ moves
to (m+1)θ − δ for 1 ≤ m ≤ k−2.
All the angles in S are indeed cut, in just two passes around the
cake, so S represents our set of cuts exactly. And here’s where we use
reversibility: Since there are only 2k−1 potential cake slices and each
can only have either all its icing on top or all on bottom, there are
only 22k−1 possible states of the cake. Our operation is completely re-
versible, so we must return to the all-icing-on-top state that we started
with.
In fact, we return after many fewer than 22k−1 steps. To see this,
notice that the portions into which the cuts in S divide the cake come
in only two sizes, δ and θ − δ, with k−1 of the former and k of the
latter. (These sizes could be equal, but the types are still distinct.)
A θ-wedge of cake consists of two of these portions, one of each
type. One operation flips the next two portions, one of each type,
reading clockwise around the cake. Notice that the portions of a given
type remain in order after a flip, since the flip involves only two por-
tions of different type.
To get all the icing back on top, each portion must be flipped an
even number of times; thus the number of operations required must
be an even multiple of k−1 (to get the δ portions right) and simulta-
neously an even multiple of k (to get the θ − δ portions right). The
smallest number of operations that fits the bill is 2k(k−1), and that is
the precise answer—except when δ = 0, that is, when θ = 2π/k for
some integer k, in which case only 2k operations are required.
Notice that except in the δ = 0 case, to get all the icing on the
bottom you’d need the number of flips to be simultaneously an odd
multiple of k−1 and an odd multiple of k, which is impossible since
either k−1 or k must be an even number. So it never happens that all
the icing is on the bottom.
A certain very well known mathematician’s reaction, upon hear-
ing the ice cream cake puzzle, was: “I find it hard to believe that the
icing ever returns to the top. But, one thing I’m sure of: If it does,
there must also be a time when it’s all on the bottom!”
322
Back from the Future
Moth's Tour
A moth alights on the “12” of a clock face, and begins randomly walk-
ing around the dial. Each time it hits a number, it proceeds to the next
clockwise number, or the next counterclockwise number, with equal
probability. It continues until it has been at every number.
What is the probability that the moth finishes at the number “6”?
Solution: No surprise: It pays to think about how the process ends.
Let’s generalize slightly and think about the probability that the
moth’s tour ends at i, where i is any number on the dial except 12.
Consider the first time that the moth gets within one number of i.
Suppose this happens when the moth reaches i − 1 (the argument is
similar if it happens at i + 1). Then i will be the last number visited if
and only if the moth gets all the way around to i+1 before it gets to i.
But the probability of this event doesn’t depend on i. So the prob-
ability of ending at 6 is the same as the probability of ending at any
other number, other than 12 itself. Therefore the probability that the
moth’s tour ends at 6 is 1/11.
Boardroom Reduction
The Board of Trustees of the National Museum of Mathematics has
grown too large—50 members, now—and its members have agreed
to the following reduction protocol. The board will vote on whether
to (further) reduce its size. A majority of ayes results in the immediate
ejection of the newest board member; then another vote is taken, and
so on. If at any point half or more of the surviving members vote nay,
the session is terminated and the board remains as it currently is.
Suppose that each member’s highest priority is to remain on the
board, but given that, agrees that the smaller the board, the better.
To what size will this protocol reduce the board?
323
Mathematical Puzzles
Solution: We start from the end, of course. If the board gets down
to two members they will certainly both survive, as member 2 (num-
bered from most senior to newest) will vote to retain herself. Thus,
member 3 will not be happy if the board comes down to members 1,
2, and 3; members 1 and 2 would then vote “aye” and eject him.
It follows that at size 4, the board would be stable; member 3
would vote nay to prevent reduction to 1, 2, and 3, and member 4
would vote nay to save him/herself immediately.
The pattern suggests that perhaps the stable board sizes are exactly
the powers of 2; if so, the board will reduce to 32 members and then
stop. Is this right? Suppose not. Let n be the least number for which
the claim fails, and let k be the greatest power of 2 strictly below n.
Since n is our least counterexample, the board is stable when it gets
down to members 1 through k. Thus those k will vote “aye” until then,
outvoting the remaining n−k unless n = 2k. Thus when n = 2k the
k newer members must vote “nay” to save themselves, stopping the
process when n is itself a power of 2. Thus n is not a counterexample
after all, and our claim is correct.
Note we have used not just retrograde analysis, but also induction
and contradiction to solve this puzzle—not to mention consideration
of small numbers. So this puzzle could easily have gone into at least
three other chapters of the book.
For our theorem we will look at a surprising (to some) fact about
numbers, which we can formulate in terms of two steadfast blinkers.
Suppose that two regular blinkers begin with synchronized blinks
at time 0, and afterwards there is an average of one blink per minute
from the two blinkers together. However, they never blink simultane-
ously again (equivalently, the ratio of their frequencies is irrational).
The theorem then tells us that for every positive integer t, there
will be exactly one blink between time t and time t+1.
Theorem. Let p and q be irrational numbers between 0 and 1 that sum to 1.
Let P be the set of real numbers of the form n/p, where n is a positive integer,
and Q the set of reals of the form n/q. Then for every positive integer t, there
is exactly one element of P ∪ Q in the interval [t, t+1).
Let’s first see why the theorem applies. Let p be the rate of the first
blinker; that is, it blinks p times per second. Since the first blink will
be at time 0, the next will be at time 1/p, then 2/p, and so forth; that
is, its blinking times after time 0 will be the set P .
Similarly, the second blinker will blink at rate q and its blinking
times will be 0 together with times in the set Q.
324
Back from the Future
325
22. Seeing Is Believing
Your mind’s eye is a powerful tool. It’s not a coincidence that when
you suddenly understand something, you say “I see it now.” Draw-
ing a picture—paper is allowed, too, or laptop or electronic pad—can
be the magic ingredient that helps you solve a puzzle, even one that
doesn’t seem at first to call for it.
Solution: Draw it! Put New York on the left of your page and Le
Havre on the right; imagine time running down the page. Then each
ferry trip is a slanted line across the page, and you can verify that each
line meets 13 others on the way.
327
Mathematical Puzzles
Mathematical Bookworm
The three volumes of Jacobson’s Lectures in Abstract Algebra sit in order
on your shelf. Each has 2′′ of pages and a front and back cover each
1 ′′ 1 ′′
4 , thus a total width of 2 2 .
A tiny bookworm bores its way straight through from page 1, Vol
I to the last page of Vol III. How far does it travel?
Yes, this means that in a sense the correct way to order multi-
volume books on your shelf is right-to-left, not left-to-right. If you pull
the books off the shelf together with the intent of reading them in one
sitting (not recommended), they are then stacked correctly.
Rolling Pencil
A pencil whose cross-section is a regular pentagon has the maker’s
logo imprinted on one of its five faces. If the pencil is rolled on the
table, what is the probability that it stops with the logo facing up?
Solution: A mental picture is all you need for this one. The pencil
will end up with one of the five faces down, therefore none facing
straight up—so the answer is zero. If you count facing partially up,
make that 25 .
328
Seeing Is Believing
Splitting a Hexagon
Is there a hexagon that can be cut into four congruent triangles by a
single line?
Circular Shadows I
Suppose all three coordinate-plane projections of a convex solid are
disks. Must the solid be a perfect ball?
Solution: No, in fact you can take a ball and slice off a piece from
it without affecting its coordinate-plane projections. Just pick a point
on its surface that’s far from any coordinate plane through the ball’s
329
Mathematical Puzzles
center—for example, the point ( √13 , √13 , √13 ) on the surface of the
unit-radius ball centered at the origin.
Mark a small circle on the ball’s surface around your point and
shave off the cap bounded by the circle. That creates a little flat spot
on the sphere that will go undetected by the projections.
If you really want to avoid wasting material when you 3D-print
your solid, you could do this with eight points, one centered in each
octant, making the circles just touch the coordinate planes.
But you can also go the other way and construct a big object that
contains every other object, convex or not, with the same disk-shaped
coordinate projections: Intersect three long cylinders of the same ra-
dius, each with its axis along a different coordinate axis.
Trapped in Thickland
The inhabitants of Thickland, a world somewhere between Edwin
Abbott’s Flatland and our three-dimensional universe, are an infi-
nite set of congruent convex polyhedra that live between two parallel
planes. Up until now, they have been free to escape from their slab,
but haven’t wanted to. Now, however, they have been reproducing
rapidly and thinking about colonizing other slabs. Their high priest is
worried that conditions are so crowded, no inhabitant of Thickland
can escape the slab unless others move first.
Is that even possible?
Solution: Yes, even if the inhabitants are regular tetrahedra. First,
note that if you view a regular tetrahedron edge-on, as shown on the
left of the figure below, you see a square. Arrange light and dark tetra-
hedra as shown, with the near edge of the dark ones running SW to
NE, and of the light ones NW to SE. One of the two parallel planes
enclosing Thickland contains the near edge of each tetrahedron, the
other the far edge.
330
Seeing Is Believing
At the moment the tetrahedra have lots of freedom; each can pop
straight out of Thickland by just traveling perpendicular to the planes.
But now let’s squash the tetrahedra together as shown. Now every
dark tetrahedron is locked in by two light ones (its NW and SE neigh-
bors) from above and two other light ones (its SW and NE neighbors)
from below, and similarly for light tetrahedra. So no one can escape
unless at least two other tetrahedra move over. In fact, if you jam
them in so that their faces touch, infinitely many tetrahedra will need
to move just to get one out.
Polygon Midpoints
Let n be an odd integer, and let a sequence of n distinct points be
given in the plane. Find the vertices of a (possibly self-intersecting)
n-gon that has the given points, in the given order, as midpoints of its
sides.
331
Mathematical Puzzles
332
Seeing Is Believing
You can get this with a hexagon shaped like a three-pointed star.
Arrange the lasers at the vertices of a regular hexagon around David,
beamed outward to cross at three corners, as shown below.
To see that six laser-beam sources are needed, let C be the convex
closure of the protected area; it has at least three sides. At each vertex
of C, at least two beams must cross, but no beam can contribute to two
vertices because then the laser source for that beam would lie outside
the protected area. So there must be at least 3 × 2 = 6 lasers.
Gluing Pyramids
A solid square-base pyramid, with all edges of unit length, and a solid
triangle-base pyramid (tetrahedron), also with all edges of unit length,
are glued together by matching two triangular faces.
How many faces does the resulting solid have?
Solution: This problem showed up in 1980 on the Preliminary
Scholastic Aptitude Exam (PSAT), but, to the embarrassment of the
Educational Testing Service (ETS), the answer they marked as cor-
rect was wrong. A confident student called the ETS to task when his
exam was returned to him. Luckily for us, the correct answer boasts a
marvelous, intuitive proof.
The square-base pyramid has five faces and the tetrahedron four.
Since the two glued triangular faces disappear, the resulting solid has
5 + 4 − 2 = 7 faces, right? This, apparently, was the intended line
of reasoning. It may have occurred to the composer that in theory,
333
Mathematical Puzzles
some pair of faces, one from each pyramid, could in the gluing process
become adjacent and coplanar. They would thus become a single face
and further reduce the count. But, surely, such a coincidence can be
ruled out. After all, the two solids are not even the same shape.
In fact, this does happen (twice): The glued polyhedron has only
five faces.
You can see this in your own head. Imagine two square-based
pyramids, sitting side-by-side on a table with their square faces down
and abutting. Now, draw a mental line between the two apices; ob-
serve that its length is one unit, the same as the lengths of all the
pyramid edges.
Thus, between the two square-based pyramids, we have in effect
constructed a regular tetrahedron. The two planes, each of which con-
tains a triangular face from each square-based pyramid, also contain
a side of the tetrahedron; the result follows. ♡ (Check the figure below
if you find this hard to visualize.)
Precarious Picture
Suppose that you wish to hang a picture with a string attached at two
points on the frame. If you hang it by looping the string over two nails
in the ordinary way, as shown below, and one of the nails comes out,
the picture will still hang (albeit lopsidedly) on the other nail.
334
Seeing Is Believing
Can you hang it so that the picture falls if either nail comes out?
Solution: One of several ways to hang the picture is illustrated be-
low, with slack so you can see better how it works. This solution re-
quires passing the string over the first nail, looping it over the second,
sending it back over the first nail, then looping it again over the second
nail but counter-clockwise.
Solution: Walk across the tiling from any edge to the opposite edge.
That path must cross a similar path from the 90-degree-away edges,
at a rectangle. Since the sides of that rectangle are parallel or perpen-
dicular to only four edges of the polygon, there must be at least 100
such rectangles.
Tiling a Polygon
A “rhombus” is a quadrilateral with four equal sides; we consider two
rhombi to be different if you can’t translate (move without rotation)
one to coincide with the other. Given a regular polygon with 100 sides,
335
Mathematical Puzzles
you can take any two non-parallel sides, make( )two copies of each and
translate them to form a rhombus. You get 50 2 different rhombi that
way. You can use translated copies of these to tile your 100-gon; show
that if you do, you will use each different rhombus exactly once!
The similarly defined path for a different side ⃗v must cross the ⃗u,
and the shared tile is of course made up of ⃗u and ⃗v . Can they cross
twice? No, because a second crossing would have ⃗u and ⃗v meeting at
an angle greater than π inside the common rhombus. ♡
336
Seeing Is Believing
To tile 3-space with 7-cube crosses, use five of the seven cubes of
each of a lot of crosses to tile a unit-thickness flat slab, much as the
flat crosses were used to tile the plane. However, between each pair
of diagonal strips, leave blank a strip of cattycorner dominoes.
Each of these is filled in one cube from below the slab, and one
from above. ♡
Cube Magic
Can you pass a cube through a hole in a smaller cube?
Solution: Yes. To pass a unit cube through a hole in a second unit
cube, it suffices to identify a projection of the (second) cube which
contains a unit square in its interior. A square cylindrical hole of side
slightly more than 1 can then be made in the second cube, leaving
room through which to pass the first cube.
You can then do the same, with even smaller tolerances, if the
second cube is just a bit smaller than a unit cube.
The easiest (but not the only) projection you can try this with is the
regular hexagon you get by placing three vertices and the centroid on
a plane perpendicular to your line of sight. You can see this hexagon
by viewing the cube so that one of its vertices is centered.
Letting A be the projection of one of the visible faces onto√ the
plane, we observe that its long diagonal is the same length ( 2) as a
unit square’s, since that line has not been foreshortened. If we slide a
copy of A over to the center of the hexagon, then widen it to form a
unit square B, B’s widened corners will not reach the vertices of the
hexagon (since the distance between opposing vertices of the hexagon
exceeds the distance between opposing sides).
337
Mathematical Puzzles
It follows that if we now tilt B slightly, all four of its corners will
lie strictly inside the hexagon. ♡
Circles in Space
Can you partition all of 3-dimensional space into circles?
338
Seeing Is Believing
is that every sphere centered at the origin hits the union of those circles
in exactly two points. And, very importantly, the origin is covered (by
the unit circle centered at (1,0)).
Invisible Corners
Can it be that you are standing outside a polyhedron and can’t see
any of its vertices?
Solution: Yes. Imagine six long planks arranged so that they meet
in their middles to form the walls of a cubical room, but do not quite
touch. From the middle of this room you won’t be able to see any
vertices. These planks can easily be hooked up far from the room to
form a polygon, with the necessary additional vertices well hidden.
[If there is a plane separating you from the polyhedron, this can’t
happen.]
For our theorem, I can’t resist using one of the most famous of all
theorems with no-word proofs. A picture is all you need!
A lozenge is a rhombus formed from a pair of unit-edge triangles
glued together along an edge. Suppose a regular hexagon with integer
sides is tiled with lozenges. The tiles come in three varieties, depend-
ing on orientation.
339
Mathematical Puzzles
Theorem. Any tiling of a regular hexagon with integer sides by unit lozenges
uses precisely the same number of lozenges of each of the three orientations.
Proof.
340
23. Infinite Choice
Need an axiom? As often as not, the Axiom of Choice is the axiom
of choice.
The Axiom of Choice (abbreviated AC here and in logic books)
says that given any collection of nonempty sets, you can choose an
element from each set. Seems pretty reasonable, right? What’s to stop
you?
Indeed, if the collection is finite, there’s no problem (you can prove
by induction that one item can be selected from each set.) If the sets
have distinguished objects, you can use them; for instance, among
infinitely many pair of shoes, you could choose the left shoe from
each pair. But suppose you have infinitely many pairs of socks?
There is a name, actually, for the set of all ways to choose an el-
ement from each set: It’s called the product of the sets. The size of
the product, if both the sets and the collection are finite, is the ordi-
nary product of the sizes of the sets. It seems unlikely that the product
of an infinite collection of nonempty sets would suddenly decide to
be empty, but that can happen if you don’t have AC. And if you’re
a mathematician, you might find it handy to have tools like Zorn’s
Lemma, the well-ordering theorem, or the Hausdorff maximal prin-
ciple (each equivalent to AC), as well as myriad other theorems that
require AC without being obvious about it.
On the other hand, AC has some pretty weird consequences. The
most famous of these is the Banach–Tarski paradox: A unit ball in
3-space can be partitioned into five subsets which can then be re-
assembled (using only rotations and translations) to form two unit
balls! Mathematicians are used to having to get around problems like
this by restricting attention to “measurable” sets. But, as you will see
later, there are other bizarre consequences of AC that mathematicians
are less familiar with.
So is AC true or false? I like to tell my students that although
neither the axiom of choice nor its negation can be disproved, either
can be made to look ridiculous. Both AC and “not AC” are consis-
tent with the usual axioms of set theory, so you have a choice; as a
341
Mathematical Puzzles
puzzle solver you will mostly want to choose AC. (Assumptions like
the Axiom of Determinacy that are not consistent with AC can oc-
casionally come in handy, but we will not pursue such contingencies
here.)
You might reasonably ask: How do collections of sets that don’t
have obvious “choice functions” arise? One way is in the considera-
tion of equivalence relations.
A (binary) relation is technically a set of pairs, but you can think
of it as a property that may or may not be true of a given pair of items.
For example, among people, “x knows y” is a relation; so is “x and
y are siblings.” The latter of these is a symmetric relation, one that is
satisfied by the pair (x, y) if it is satisfied by (y, x). It is also a transitive
relation: If (x, y) and (y, z) satisfy the relation, so must (x, z).
Suppose we change the relation to “x and y are either full siblings,
or are the same person.” Then the relation is also reflexive, meaning
that (x, x) satisfies the relation for any x. Relations that are symmet-
ric, transitive, and reflexive are said to be equivalence relations. If a set
has an equivalence relation, the set partitions neatly into equivalence
classes: subsets whose elements are all related to one another but not
to anyone outside the subset. For example, for the above relation, the
equivalence classes are the sets of people that share a given pair of
parents.
Suppose humans are forced to settle a new planet and it’s decided
that exactly one person from each set of siblings will go. Such a col-
lection is called a set of representatives of the equivalence relation. In
this case we don’t need to apply AC to get a set of representatives; for
example, we could always send the eldest of the siblings (and anyway
there are only finitely many sibling sets that we know of).
But, generally, we may indeed need AC to get a set of representa-
tives. Consider, for example, the set of all (countably) infinite binary
sequences. Suppose (a1 , a2 , . . . ) is one such sequence and (b1 , b2 , . . . )
is another. Say that these two sequences are related if for all but
finitely many indices i, ai = bi . You can easily verify that this relation
is symmetric, transitive, and reflexive, therefore is an equivalence re-
lation. Thus the set of all infinite binary sequences breaks up into (a
lot of) equivalence classes. One of these, for example, is the set of all
binary sequences that have only finitely many 1’s.
According to AC, it is possible to pick one sequence from each
equivalence class. From the aforementioned class of sequences with
only finitely many 1’s, you might want to pick the all-zero sequence.
But for most classes there won’t be an obvious choice, so it’s hard to
342
Infinite Choice
see how you can avoid using AC. Let’s go ahead and invoke AC to get
our set of representatives. What good is it? Well, if you’re a prisoner. . .
343
Mathematical Puzzles
Solution: Since this problem appears here, you have a big clue that
the answer is yes if you have AC. You can prove it by well-ordering
all the points on the plane in such a way that the set of points below
any point has cardinality less than 2ℵ0. (2ℵ0 stands for the cardinality
344
Infinite Choice
of the set of all real numbers, also the set of angles, the set of points
on the plane, and many other sets; it’s strictly greater than ℵ0 , the
cardinality of the set of whole numbers. The symbol ℵ, pronounced
“aleph,” is the first letter of the Hebrew alphabet.) We start by picking
three lines that cross one another, so that we already have our three
directions. Let P be the lowest point in our well-ordering that isn’t
already double-covered, and pick a line through P that misses the
three points that are currently double-covered.
Now repeat the process with a new point Q, this time avoiding
a larger, but still finite, set of points that are already double-covered.
We can do this until we have a countably infinite number of lines in
our set. But why stop there? Until we’re done, there’s always a lowest
point of the plane that hasn’t been double-covered yet. And because
the number of points so far considered is less than 2ℵ0, there’s always
an angle available that misses all points that are currently double-
covered.
This construction is perhaps disappointing in that it does not leave
you with any geometry you can wrap your head around. No better
construction is known.
Let us return to direct applications of AC. If you were unim-
pressed by AC’s power to free prisoners, perhaps the next puzzle will
get your attention.
Wild Guess
David and Carolyn are mathematicians who are unafraid of the infi-
nite and cheerfully invoke the Axiom of Choice when needed. They
elect to play the following two-move game. For her move, Carolyn
chooses an infinite sequence of real numbers, and puts each number
in an opaque box. David gets to open as many boxes as he wants—
even infinitely many—but must leave one box unopened. To win, he
must guess exactly the real number in that box.
On whom will you bet in this game, Carolyn or David?
Solution: I can hear you thinking: “I’m betting on Carolyn! She
can just put, say, a random real number between 0 and 1 in each box.
David has no clue what’s in the unopened box, hence his probability
of winning is zero.”
In fact David has an algorithm that will guarantee him at least a
99% chance of winning, regardless of Carolyn’s strategy. You don’t
345
Mathematical Puzzles
believe me? That shows good judgment on your part, but it’s nonethe-
less true given AC.
Here’s how it works. Before the game even starts, David proceeds
much as the prisoners in Hats and Infinity did, but this time with se-
quences of real numbers instead of bits. (If you state the problem using
bits instead of reals, David can use the prisoners’ set of representa-
tives.) So, two sequences of reals x1 , x2 , . . . and y1 , y2 , . . . are related
if xi ̸= yi for only finitely many indices i. Again this is an equivalence
relation, and David invokes AC to choose from each equivalence class
of real sequences one representative sequence. He can even show his
set of representatives to Carolyn; it won’t help her!
Now Carolyn picks her sequence, let’s call it c1 , c2 , . . . , and boxes
up the numbers. David takes the boxes and breaks them up into 100
infinite rows. We may as well assume the boxes in row 1 contain c1 ,
c101 , c201 , etc., while row 2 begins with c2 and c102 ; finally row 100
contains c100 , c200 and so forth. Each row is itself a sequence of real
numbers.
346
Infinite Choice
347
Mathematical Puzzles
348
Infinite Choice
Now√ that we know the limit exists, let us call it y; it must indeed
y
satisfy 2 = y. Looking at the equation x = y 1/y , we observe (per-
haps using elementary calculus—sorry) that x is strictly increasing in
y up to its maximum at y = e and strictly decreasing thereafter. Thus,
there are at most
√ two values of y corresponding to any given value of
x, and for x = 2, we know the values: y = 2 and y = 4.
Since our sequence is bounded by 2, we rule out 4 and conclude
that y = 2. ♡
··
x·
Generalizing the above argument, we see that xx is meaningful
and equal to the lower root of x = y 1/y , as long as x ≤ e1/e . For
x = e1/e , the expression is equal to e, but as soon as x exceeds e1/e ,
the sequence diverges to infinity. This is why Part II of the puzzle fails:
··
x·
There is no x such that xx = 4.
We have already noted that there are different infinities; the small-
est is countable infinity, which we called ℵ0 . A set is said to be count-
able if you can put its members into one-to-one correspondence with
the positive integers. The set of rational numbers (fractions) is count-
able; reference to a particularly nice way of putting them into corre-
spondence with the positive integers is given in Notes & Sources. The
set of real numbers, however, is not countable, as observed by the bril-
liant Georg Cantor in 1878.
Here’s a simple puzzle for which you can make use of countability.
349
Mathematical Puzzles
350
Infinite Choice
three Ys can all have the same triple of circles; for, if that were so,
you could connect the hub of each Y to the center of each circle by
following the appropriate arm until you hit the circle, then following a
radius to the circle’s center. This would give a planar embedding of the
graph K3,3 , sometimes known as the “gas-water-electricity network.”
In other words, we have created six points in the plane, divided
into two sets of three each, with each point of one set connected by a
curve to each point of the other set, and no two curves crossing. This
is impossible; in fact, readers who know Kuratowski’s Theorem will
recognize this graph as one of the two basic nonplanar graphs.
To see for yourself that K3,3 cannot be embedded in the plane
without crossings, let the two vertex sets be {u, v, w} and {x, y, z}.
If we could embed it without crossings the sequence u, x, v, y, w, z
would represent consecutive vertices of a (topological) hexagon. The
edge uy would have to lie inside or outside the hexagon (let us say
inside); then vz would have to lie outside to avoid crossing uy, and
wx has no place to go. ♡
351
Mathematical Puzzles
The graph whose vertices are the digits 0 through 9 with 0 adjacent
to 1, 1 to 2, 2 to 3, . . ., 8 to 9 and 9 to 0, can be colored with two
colors by putting the even digits in X and the odd digits in Y. But if
we try two-coloring the same construction but with an odd number
of vertices—an “odd cycle”—it won’t work.
In fact, no graph containing an odd cycle can be two-colorable. A
famous, elementary theorem of graph theory says the converse.
Theorem. If a graph contains no odd subset of vertices whose adjacencies
include those of an odd cycle, then the graph is two-colorable.
The idea of the proof is this: Pick some vertex v and put it in X,
then put all the vertices that are adjacent to v in Y , then all the vertices
adjacent to them in X again, and so forth. The absence of odd cycles
assures you that you will never find yourself trying to put the same
vertex in both X and Y . If at any stage you find that you are finding
no new adjacencies but haven’t used up all the vertices of the graph,
pick an unassigned vertex v ′ , put it in X, and continue as before.
That’s all very fine, but if the graph is infinite and has infinitely
many connected components, the part of the proof asking you to
“pick an unassigned vertex” requires the Axiom of Choice. Here’s
an example of such a graph: Let the vertices be all real√numbers, with
x adjacent to y if either |x − y| = 1 or |x − y| = 2. This graph
has no odd cycles, because if you start a cycle at x and return to x,
you will necessarily use an even number of 1-sized steps (some num-
ber up, and an equal number down) and likewise
√ √ an even number of
2-sized steps; this is because no multiple of 2 is an integer.
Nonetheless, under some axioms that contradict AC, this graph
has no two-coloring! Indeed, if you try to construct a set of vertices
that could serve as X, you will encounter only frustration. Three-
colorings are easily found, though; it’s really quite reasonable, in
graph-theoretic terms, to postulate that this graph has chromatic num-
ber 3, that is, can be properly colored with three colors but no fewer.
352
24. Startling
Transformation
Often a puzzle that looks impenetrable becomes suddenly transpar-
ent if you just look at it a different way. Yes, that may require some
creativity and imagination on your part; but great ideas, no matter
how brilliant they appear at first, don’t arise out of nothing. A little
experience may go a long way to sparking your next bit of genius.
Sinking 15
Carol and Desmond are playing pool with billiard balls number 1
through 9. They take turns sinking balls into pockets. The first to sink
three numbers that sum to 15 wins. Does Carol (the first to play) have
a winning strategy?
353
Mathematical Puzzles
number of slices you must make in order to do this? You are allowed
to stack pieces prior to running them through the saw.
Solution: If you hold the cube together (carefully!) throughout, you
can make two horizontal cuts all the way through the cube, then two
vertical North–South cuts and two vertical East–West cuts—six cuts
in all—to reduce the cube to 27 cubelets. Can you do it with fewer
than six cuts?
No, because the center cubelet has to be cut out on all six sides,
and no cut can do more than one.
354
Startling Transformation
What’s Victor’s best strategy? How much better than even can he
do? (Assume there are 26 red and 26 black cards in the deck.)
Solution: We know that Victor’s expectation in this game, if he
plays it well, is at least 0—because he can just bet on the first card,
which is equally likely to be one of the 26 red cards or to be one of
the 26 black cards. Or, he could wait for the last card, with the same
result.
But Victor is a smart guy and knows that if he waits for a point
when he’s seen more black cards go by than red, he can bet at that
moment and enjoy odds in his favor. Of course, he could wait until
he’s seen all the black cards go by and then bet knowing he’s going
to win, but that might not ever happen. Perhaps best is the following
conservative strategy: He waits until the first time that the number of
black cards he’s seen exceeds the number of red, and takes the result-
ing (probably small) odds in his favor. For example, if the very first
card is black, he bets on the next one, accepting a positive expectation
of (26/51) · $1 + (25/51) · (−$1) which is about 2 cents.
Of course, though unlikely, it possible that the black cards seen
never get ahead of the red ones, in which case Victor is stuck betting
on the last card, which will be black. It seems like it might be difficult
to compute Victor’s expectation from this or any moderately complex
strategy.
But there is a way—because it’s a fair game! Not only has Victor
no way to earn an advantage, he has no way to lose one either: All
strategies are equally ineffective.
This fact is a consequence of the martingale stopping time theo-
rem, and can also be established by induction on the number of cards
of each color in the deck. But there is another proof, which I will de-
scribe below, and which must surely be in “the book.” (As readers
may know or recall from Chapter 9, the late, great mathematician
Paul Erdős often spoke of a book owned by God in which is written
the best proof of each theorem. I imagine Erdős is reading the book
now with great enjoyment, but the rest of us will have to wait.)
Suppose Victor has elected a strategy S, and let us apply S to a
slightly modified variation of the game. In the new variation, Victor
interrupts Paula as before, but this time he is betting not on the next
card in the deck, but instead on the last card of the deck.
In any given position, the last card has precisely the same proba-
bility of being red as the next card. Thus, the strategy S has the same
expected value in the new game as it did before.
355
Mathematical Puzzles
But, of course, the astute reader will already have observed that
the new variation is a pretty uninteresting game; Victor wins if and
only if the last card is red, regardless of his strategy. ♡
Magnetic Dollars
One million magnetic “susans” (Susan B. Anthony dollar coins) are
tossed into two urns in the following fashion: The urns begin with
one coin in each, then the remaining 999,998 coins are thrown in the
air one by one. If there are x coins in one urn and y in the other, mag-
netic attraction will cause the next coin to land in the first urn with
probability x/(x + y), and in the second with probability y/(x + y).
How much should you be willing to pay, in advance, for the con-
tents of the urn that ends up with fewer susans?
Solution: You might very reasonably worry that one urn will “take
over” and leave very little for the other. In my experience, faced with
this problem, most people are unwilling to offer $100 in advance for
the contents of the lesser urn.
In fact the lesser urn is worth, on average, a quarter of a million
dollars. This is because the final content of (say) Urn A is precisely
equally likely to be any whole number of dollars from $1 all the way
to $999,999. Thus, the average amount in the lesser urn is
1
(2 · $1 + 2 · $2 + . . . 2 · $499,999 + 1 · $500,000)
999,999
356
Startling Transformation
one at random, putting it on top of the current pile, under the current
pile, or between the ace and deuce, each with probability 13 .
We continue in this manner; the nth card is inserted in one of n
possible slots, each with probability 1/n. The result eventually is a
perfectly random permutation of the cards.
Now think of the cards that go in above the Ace of Spades as the
coins (not counting the first) that go into Urn A, and the ones that
go under as coins going into Urn B. The magnetic rule above de-
scribes the process perfectly, because if there are currently x−1 cards
above the Ace of Spades (thus x slots) and y−1 cards under the Ace
of Spades (thus y slots), the probability that the next card goes above
the Ace of Spades is x/(x+y).
Since in the final shuffled deck the Ace of Spades is equally likely
to be in any position, the number of slots ending up above it is equally
likely to be anything from 1 to the number of cards in our deck, which
for our puzzle is 999,999.
Integral Rectangles
A rectangle in the plane is partitioned into smaller rectangles, each of
which has either integer height or integer width (or both). Prove that
the large rectangle itself has this property.
Solution: This problem is famous for its many proofs, each a kind
of transformation. Here’s one proof that turns the picture into a graph.
Place the big rectangle with its lower left corner at the origin of
a Cartesian grid, and sides parallel to the coordinate axes. Let G be
the graph whose vertices are all the points with integer coordinates
that are also corners of small rectangles (indicated by shaded circles),
plus the small rectangles themselves (indicated by white circles at their
centers).
357
Mathematical Puzzles
Laser Gun
You find yourself standing in a large rectangular room with mirrored
walls. At another point in the room is your enemy, brandishing a laser
gun. You and she are fixed points in the room; your only defense is
that you may summon bodyguards (also points) and position them in
the room to absorb the laser rays for you. How many bodyguards do
you need to block all possible shots by the enemy?
358
Startling Transformation
359
Mathematical Puzzles
original room can be reflected twice to provide the last four points in
the original room. In the third figure, the 12 new points (centers filled
in gray) have been added in black to the original rectangle. A virtual
laser path is added, with its corresponding real path crossing one of
the new points.
Since every room looks exactly like the original or one of the other
three we just examined, all the bodyguard points in the plane are re-
flections of the 16 points we have now identified in the original room.
Since every line from a copy of Q passed through a reflected body-
guard, the actual shot hits a “real” bodyguard at its halfway point (if
not sooner) and is absorbed.
360
Startling Transformation
Random Intervals
The points 1, 2, . . . , 1000 on the number line are paired up at random,
to form the endpoints of 500 intervals. What is the probability that
among these intervals is one which intersects all the others?
It is easily checked by induction that after the labels A(j) and B(j)
have been assigned, either an equal number of points have been la-
beled on each side (in case A(j) < B(j)) or two more points have
been labeled on the left (in case A(j) > B(j)).
When the labels A(n−2) and B(n−2) have been assigned, four un-
labeled endpoints remain, say a < b < c < d. Of the three equiprob-
able ways of pairing them up, we claim two of them result in a “big”
interval which intersects all others, and the third does not.
361
Mathematical Puzzles
In case A(n−2) < B(n−2), we have a and b on the left and c and d
on the right, else only a is on the left. In either case, all inner endpoints
lie between a and c, else one of them would have been labeled. It
follows that the interval [a, c] meets all others, and likewise [a, d], so
unless a is paired with b, we get a big interval.
Suppose, on the other hand, that the pairing is indeed [a, b] and
[c, d]. Neither of these can qualify as a big interval since they do not
intersect each other; suppose some other interval qualifies, say [e, f ],
labeled by A(j) and B(j).
When a and b are on the left, the inner endpoint A(j) lies between
b and c, thus [e, f ] cannot intersect both [a, b] and [c, d], contradicting
our assumption.
In the opposite case, since [e, f ] meets [c, d], f is an outer endpoint
(so f = B(j)) and [e, f ] went right; since the last labeled pair went
left, there is some k > j for which [A(k), B(k)] went left, but [A(k−
1), B(k−1)] went right. Then A(k) < n, but A(k) < A(j) since A(k)
is a later-labeled, left-side inner point. But then [A(j), B(j)] does not,
after all, intersect [B(k), A(k)], and this final contradiction proves the
claim.
Infected Cubes
An infection spreads among the n3 unit cubes of an n × n × n cube,
in the following manner: If a unit cube has three or more infected
neighbors, then it becomes infected itself. (Neighbors are orthogonal
only, so each little cube has at most six neighbors.)
Prove that you can infect the whole big cube starting with just n2
sick unit cubes.
Solution: You might recall the Infected Checkerboard puzzle where
you were asked to show that you couldn’t infect all of an n×n checker-
board if you began with fewer than n sick squares. Essentially the
same proof works in higher dimension to show that you need at least
nd−1 initially sick squares to infect all of a d-dimensional hypercube
of side n (where d infected neighbors infect a unit hypercube).
But this time, it’s not obvious how to choose the initial nd−1 unit
hypercubes (“cells”) to infect.
In what follows we will consider only the 3-dimensional case, but
the construction easily generalizes. Label the cells by vectors (x, y, z),
with x, y, z ∈ {1, 2, . . . , n}, so that two cells will be neighbors if all
their coordinates are the same except in one position, where their val-
ues differ by 1.
362
Startling Transformation
363
Mathematical Puzzles
be the set of coordinates (among the first, second, and third) chosen
infinitely often by the doctor. We may as well assume that you are
past the point where any index not in I will ever be chosen. Let m be
the biggest value ever encountered at a coordinate in I. Let J be the
set of indices in I which are at the moment equal to m.
If it ever happens that c > m, then you will be incrementing at
every step, pushing c up until it snaps around the corner to 12 and
you win. Therefore it must be that c is always below m. But then,
whenever the doctor chooses a coordinate j ∈ J, the jth coordinate
must decrease to m−1. It follows that eventually J will disappear,
leaving you forever with a smaller maximum value m. This can’t go
on forever, so we have our contradiction.
We conclude that the above algorithm will win the game for you,
no matter where the doctor starts you off or how she chases you
around. The existence of a winning strategy means that the infection
really does capture the whole big cube, and we are done. ♡
Gladiators, Version I
Paula and Victor each manage a team of gladiators. Paula’s gladiators
have strengths p1 , p2 , . . . , pm and Victor’s, v1 , v2 , . . . , vn . Gladi-
ators fight one-on-one to the death, and when a gladiator of strength
x meets a gladiator of strength y, the former wins with probability
x/(x+y), and the latter with probability y/(x+y). Moreover, if the
gladiator of strength x wins, he gains in confidence and inherits his
opponent’s strength, so that his own strength improves to x+y; simi-
larly, if the other gladiator wins, his strength improves from y to x+y.
After each match, Paula puts forward a gladiator (from those on
her team who are still alive), and Victor must choose one of his to face
Paula’s. The winning team is the one which remains with at least one
live player.
What’s Victor’s best strategy? For example, if Paula begins with
her best gladiator, should Victor respond from strength or weakness?
Solution: All strategies for Victor are equally good. To see this,
imagine that strength is money. Paula begins with P = p1 + · · · + pm
dollars and Victor with V = v1 +· · ·+vn dollars. When a gladiator of
strength x beats a gladiator of strength y, the former’s team gains $y
while the latter’s loses $y; the total amount of money always remains
the same. Eventually, either Paula will finish with $P +$V and Victor
with zero, or the other way ’round.
364
Startling Transformation
q · ($P + $V ) + (1 − q) · $0 = $V,
Gladiators, Version II
Again Paula and Victor must face off in the Colosseum, but this time,
confidence is not a factor, and when a gladiator wins, he keeps the
same strength he had before.
As before, prior to each match, Paula chooses her entry first. What
is Victor’s best strategy? Whom should he play if Paula opens with her
best man?
365
Mathematical Puzzles
366
Startling Transformation
Prove that after some point, one of the urns will never get another
coin!
Solution: The really neat way to show that one urn gets all but
finitely many coins is to employ those continuous memoryless wait-
ing times that proved so useful in the previous puzzle.
Look just at the first urn and suppose that it acquires coins by
waiting an average of 1/n1.01 hours between its nth coin and its
(n+1)st coin, where the waiting time is memoryless. Coins will ar-
rive slowly
∑∞ and sporadically at first, then faster and faster; since the
series n=1 1/n1.01 converges, the urn will explode with infinitely
many coins at some random moment (typically about 4 days after the
process begins).
Now suppose we start two such processes simultaneously, one
with each urn. If at some time t, there are x coins in the first urn
and y in the second, then (as we saw with the gladiator-light bulbs)
the probability that the next coin goes to the first urn is
exactly what it should be. Nor does it matter how long it’s been since
the xth coin in the first urn (or yth in the second) arrived, since the
process is memoryless. It follows that this accelerated experiment is
faithful to the puzzle.
However, you can see what happens now; with probability 1, the
two explosion times are different. (For this, you only need to know
that our memoryless waiting time has a continuous distribution.) But
the experiment ends at the first explosion, at which time the other urn
is stuck with whatever finite number of coins it had. ♡
Seems like kind of a scary experiment, doesn’t it? The slow urn
never got to finish because, in effect, time ended.
367
Mathematical Puzzles
368
Startling Transformation
369
Notes and Sources
1. Out for the Count
Half Grown: Sent by Jeff Steif, of Chalmers University in Sweden.
Powers of Two: Classic.
Watermelons: Adapted from Gary Antonick’s New York Times “Number Play” blog,
11/7/12; but the puzzle appeared earlier in Kvant, June/August 1998, contributed
by I. F. Sharygin.
Bags of Marbles: Contributed by pathologist Dick Plotz, of Providence RI.
Salaries and Raises: Idea from Rouse Ball [9].
Efficient Pizza-Cutting: Subject of a MoMath (National Museum of Mathematics)
event of 10/30/19, led by Paul Zeitz.
Attention Paraskevidekatriaphobes: As far as I can tell this remarkable fact was first
observed by Bancroft Brown (a Dartmouth math professor, like your author), who
published his calculation in the American Mathematical Monthly Vol. 40 (1933), p.
607. My present-day colleague Dana Williams is the one who brought all this to
my attention.
The origin of superstition concerning Friday the 13th is usually traced to the date of an
order given by King Philip IV of France (Philip the Fair), dismantling the Knights
Templar.
Meet the Williams Sisters: See also Hess [62].
Rating the Horses: Suggested by Saul Rosenthal of TwoSigma.
Shoelaces at the Airport: Told to me by Dick Hess at IPP35 (the 35th Annual Inter-
national Puzzle Party).
Rows and Columns: This is a classical theorem, simple and surprising; I was reminded
of it by Dan Romik, a math professor at the University of California, Davis. Don-
ald Knuth, in Vol. III of The Art of Computer Programming, traces the result to a
footnote in a 1955 book by Hermann Boerner. Bridget Tenner, a student of famed
combinatorialist Richard Stanley, wrote a paper called “A Non-Messing-Up Phe-
nomenon for Posets” generalizing this theorem.
Three-way Election: Dreamed up by Ehud Friedgut of the Weizmann Institute, Israel.
Sequencing the Digits: Remembered from the Putnam Exam, many years ago.
Faulty Combination Lock: Suggested to me by Amit Chakrabarti of Dartmouth; it
had been proposed for the International Mathematical Olympiad in 1988 by East
Germany. The optimality proof given (supplied by Amit) doesn’t quite work for 8
replaced by 10, and fails increasingly thereafter. Thus the general puzzle, when the
lock has n numbers per dial, is unsolved as far as I know.
Losing at Dice: I discovered this curious fact accidently, 40 or so years ago, while
constructing homework problems for an elementary probability course at Emory
University.
Splitting the Stacks: From Einar Steingrimsson, University of Strathclyde, Glasgow.
North by Northwest: Original.
Early Commuter: From the one and only Martin Gardner.
371
Mathematical Puzzles
2. Achieving Parity
Bacterial Reproduction: Based on Supplementary Problem C/4, [68], p. 14.
Fourth Corner: Brought to my attention by Paul Zeitz.
Unanimous Hats: My version of a classic.
Half-right Hats: My version of a classic.
Red and Blue Hats in a Line: Passed on to me by Girija Narlikar of Bell Labs, who
heard it at a party. Note that an analogue of the given solution works with any
number k of hat colors. The colors are assigned numbers from 0 to k−1, say, and
the last prisoner in line guesses the color corresponding to the sum, modulo k, of
the color-numbers of the hats in front of him. As before, all other prisoners are
saved, if they’re careful with their modular arithmetic.
Prisoners and Gloves: Suggested by game theorist Sergiu Hart of the Hebrew Univer-
sity.
Even-sum Billiards: Inspired by a problem from John Urschel’s column,
https://www.theplayerstribune.com/author/jurschel.
Chameleons: Boris Schein, an algebraist at the University of Arkansas, sent me this
puzzle; it may be quite old. On one occasion it was given to an 8th-grader in
Kharkov, on another to a young Harvard grad interviewing at a big finance firm;
both solved it.
Missing Digit: Lifted from Elwyn Berlekamp and Joe Buhler’s Puzzles Column
in Emissary, Spring/Fall 2006; they heard it from the number theorist Hendrik
Lenstra.
Subtracting Around the Corner: When I was in high school, a substitute math teacher
told my class that some WWII prisoner of war entertained himself by trying various
sequences of four numbers to see how long he could get them to survive under
the above operations. The process (with four numbers) is sometimes known as a
difference box or diffy box. Among real numbers, there is an (essentially) unique
quad that never terminates [12]. That quad is (0, 1, q(q − 1), q), where q is the
unique real root of q 3 − q 2 − q − 1 = 0, namely,
( √ √ )
1 3 √ 3 √
q= 1 + 19 + 3 33 + 19 − 3 33 ∼ 1.8393,
3
so q(q − 1) ∼ 1.5437. Remarkably, this number arises also in the solution to
another, seemingly unrelated, puzzle in this volume.
Uniting the Loops: This is one of a number of ingenious puzzles devised by
writer/mathematician Barry Cipra, of Northfield Minnesota.
theorem: Conjectured in [67] and proved at Danny Kleitman’s 65th Birthday conference
in August 1999 by Noga Alon, Tom Bohman, Ron Holzman and Danny himself
[2].
372
Notes and Sources
3. Intermediate Math
Squaring the Mountain State: My version of a classic.
Monk on a Mountain: Ancient.
Cutting the Necklace: Suggested by Pablo Soberón of Baruch College, City University
of New York. For more information see [4].
Three Sticks: Moscow Mathematical Olympiad 2000, Problem D4, contributed by A.
V. Shapovalov [40].
Hazards of Electronic Coinflipping: See also Fair Play
√√in Chapter 19, Hammer and
Tongs. The actual value of p works out to 12 ± 2
3
− 34 . But there’s no need
to limit yourself to three people; you can choose uniformly among n people, for
any positive integer n, in a bounded number of flips. Johan Wästlund suggests
the following method. Suppose you have enough power for f flips. You allot as
many of the 2f outcomes as can be divided into n−1 equivalent sets; left over are
at most n−2 of each level, that is, for each k at most n−2 outcomes involving
exactly k heads. Now the IVT can be applied as in the n = 3 case as long as the
total probability of the left-out outcomes, at p = 12 , is at most n 1
. The latter is
achieved when f is just over 2 log2 (n) flips—only a factor of two away from the
information-theoretic lower bound.
Bugs on a Pyramid: Devised by Dr. Kasra Alishahi, of Sharif University; sent to me
by Mahdi Saffari.
Skipping a Number: Based on the Putnam exam problem (#A1, from 2004) that in-
troduced the now-famous (in certain circles) Shanille O’Keal.
Splitting a Polygon: From a Moscow Mathematical Olympiad in the 1990’s.
Garnering Fruit: Sent to me by Arseniy Akopyan, author of the unique and delightful
book Geometry in Figures. The first of the two solutions to the two-fruit version came
from Pablo Soberón of Baruch College, City University of New York.
theorem: Known since ancient times.
4. Graphography
Air Routes in Aerostan: Moscow Mathematical Olympiad 2003, Problem A5, con-
tributed by R. M. Fedorov [40].
Spiders on a Cube: Passed to me by Matt Baker, Georgia Tech.
Handshakes at a Party: Classic.
Snake Game: From the 12th All Soviet Union Mathematical Competition, Tashkent,
1978.
Bracing the Grid: Passed to me by geometer Bob Connelly of Cornell, based on [29].
Competing for Programmers: Moscow Mathematical Olympiad 2011.
Wires under the Hudson: This is a variation of a puzzle publicized by Martin Gard-
ner, and sometimes called the Graham-Knowlton Problem. To electricians it is the
“WIP” (wire identification problem). In Gardner’s version, you can tie any num-
ber of wires together at either end, and test at either end, as well. Our solution,
found in [99, 57], satisfies our additional constraints and involves only two oper-
ations at each end (thus three river crossings, not counting additional crossings to
untie and perhaps actually use the wires). The solution is not unique, however, so
even if your three-crossing solution is different, it may be just as good.
Two Monks on a Mountain: Brought to my attention by Yuliy Baryshnikov of the
University of Illinois at Urbana-Champaign.
Worst Route: Adapted from a puzzle found in [84]. If the number of houses were
odd, distances would matter slightly: The postman would then begin or end at the
373
Mathematical Puzzles
middle house, zigzag between high-numbered and low-numbered houses, and end
or begin at the closest house to the middle house. Example: If the addresses were
1,2,4,8,16 one of the maximum-distance routes would be 4,8,1,16,2.
theorem: The idea of switching odd and even edges used in the proof is known as the
“alternating path method” and is an important tool in graph theory.
5. Algebra Too
Bat and Ball: An oldie, as you can see from the prices!
Two Runners: From [62].
Belt Around the Earth: Origin unknown, but Enrique Treviño of Lake Forest College
has informed me that a version appears in the notes to a 1702 translation of Euclid
by William Whiston.
Odd Run of Heads: A variation of this puzzle was suggested, but not used, for an IMO
in the early ’80s (see [68]).
Hopping and Skipping: Devised by mathematician James B. Shearer of IBM, this puz-
zle appeared in the April 2007 edition of IBM’s puzzle site “Ponder This,”
http://domino.research.ibm.com/Comm/wwwr\_ponder.nsf/challenges/
April2007.html.
Area–Perimeter Match: Problem 176, p. 71 of [75].
Three Negatives: Due to Mark Kantrowitz of Carnegie Mellon University.
Red and Black Sides: Moscow Mathematical Olympiad 1998, Problem C2 [39], con-
tributed by V. V. Proizvolov. A nice non-algebraic approach is instead to project
the red lines onto, say, the left edge of the square. If the projection covers the whole
left edge, we’re done; suppose it misses an interval I. Then every rectangle that in-
tersects the horizontal band through I has a red horizontal side, so projecting these
downward covers the bottom edge of the square.
Recovering the Polynomial: Sent to me by Joe Buhler of Reed College, who believes it
may be quite old (but, maybe not as old as Delphi). Note that without the restriction
that the Oracle must be fed integers, the polynomial can be determined in one step
with (say) x = π. Of course, the Oracle would have to find a way to convey p(π)
in a finite amount of time; if she gives a decimal expansion digit by digit, there’d
be no way to know when to cut her off.
Gaming the Quilt: Sent to me by Howard Karloff of Goldman Sachs.
Strength of Schedule: Moscow Mathematical Olympiad 1997, Problem C5 [39], con-
tributed by B. R. Frenkin.
Two Round-robins: Moscow Mathematical Olympiad 1997, Problem B5 [39], con-
tributed by B. R. Frenkin.
Alternative Dice: This problem is famous enough so that its solution has a name:
“Sicherman dice.” Martin Gardner wrote in Scientific American magazine, in 1978,
about their discovery by one Colonel George Sicherman, of Buffalo NY.
theorem: The model described, often now called the “Galton–Watson tree,” had already
been studied independently by I. J. Bienaymé.
6. Safety in Numbers
Broken ATM: Moscow Mathematical Olympiad 1999, Problem A4 [39]. Hidden in
this puzzle is a form of the Chinese Remainder Theorem.
Subsets with Constraints: The first part of the puzzle was presented by the late, long-
time puzzle maven Sol Golomb (University of Southern California) at the Seventh
374
Notes and Sources
Gathering for Gardner; the second part was suggested by Prasad Tetali of Georgia
Tech; the third, an obvious variation.
Cards from Their Sum: The trick is a version of Colm Mulcahy’s “Little Fibs.” The
two solutions are described in the Coda of Mulcahy’s book [87], and were supplied
by combinatorialist Neil Calkin of Clemson University.
Divisibility Game: Moscow Mathematical Olympiad 2003, Problem A6 [40], con-
tributed by A. S. Chebotarev.
Prime Test: Moscow Mathematical Olympiad 1998, Problem B1 [39], contributed by
A. K. Kovaldzhi.
Numbers on Foreheads: Sent to me by Noga Alon of Princeton University.
Rectangles Tall and Wide: There are other proofs; see, for example,
http://www-math.mit.edu/~rstan/transparencies/tilings3.pdf.
Locker Doors: Classic.
Factorial Coincidence: From [96], sent to me by Christof Schmalenbach of IBM.
Even Split: This puzzle, with n replaced by 100, appeared in the 4th All Soviet Union
Mathematical Competition, Simferopol, 1970. It is elegant enough to be called a
theorem and in fact it is a theorem in [37].
Factorials and Squares: Both the puzzle and the solution given are due to Jeremy Kun,
author of “A Programmer’s Introduction to Mathematics.” Passed to me by Diana
White of the National Association of Math Circles. (There are other equally valid
ways to get the answer.)
theorem: This probably goes back to ancient Greece, but proofs of this fundamental fact
are still of interest in the 21st century; see, for example, [15].
375
Mathematical Puzzles
376
Notes and Sources
Now, move the points continuously toward one another along the curve. When the
points merge their tetrahedron will no longer contain the origin, so somewhere
during the process, there was a time when the origin lay on a face of the tetrahedron.
The three points that determine that face lie on a great circle, and each pair has a
shortest route along that circle not containing the third point. Hence, the sum of
the pairwise distances of the three points is 2π, impossible since they all lie on C.
Soldiers in a Field: From the 6th All Soviet Union Mathematical Competition in
Voronezh, 1966.
Alternating Powers: Spotted in Emissary, Fall 2004; see [61]. The proof is from Noam
Elkies, Harvard mathematician and (musical) composer.
Halfway Points: Moscow Mathematical Olympiad 1998, Problem B6 [39], contributed
by V. V. Proizvolov.
theorem: The statement was originally conjectured by James Joseph Sylvester (arguably,
the first great mathematician to leave Europe for America) back in 1893. It was first
proved by the Hungarian mathematician Tibor Gallai, but the elegant proof given
was found by L. M. Kelly and published in 1948 [28].
377
Mathematical Puzzles
378
Notes and Sources
King’s Salary: This puzzle was devised by Johan Wästlund of Chalmers University,
(loosely!) inspired by historical events in Sweden.
Packing Slashes: Heard from Vladimir Chernov of Dartmouth. Lyle Ramshaw, a re-
searcher at Hewlett-Packard, has devised schemes for the general n × n case, but
as of this writing the optimal solutions for odd n are not known to me. See [18].
Unbroken Lines: Devised by mathematics writer Barry Cipra, this one is directly in-
spired by a work of the late Sol LeWitt.
Unbroken Curves: Again by Cipra, but with less direct connection to LeWitt.
Conway’s Immobilizer: I don’t know the composer of this puzzle but the name came
from the late John Horton Conway’s claim that it immobilized one solver in his
chair for six hours. The first solution given here was suggested by my former PhD
student Ewa Infeld; the second was devised by Takashi Chiba in response to a
puzzle column in Japan, and sent to me by Ko Sakai of the Graduate School of
Pure and Applied Sciences, University of Tsukuba. See [24] for yet more solutions.
Seven Cities of Gold: Adapted from a suggestion by Frank Morgan of Williams Col-
lege.
theorem: The given uniqueness proof is the author’s, but there are many others. The
Moser Spindle (discovered by brothers William and Leo Moser in 1961) cannot be
vertex-colored with three colors without having adjacent vertices of the same color.
As a consequence, the “unit-distance graph,” whose vertices are all points on the
plane with two adjacent when they are distance 1 apart, has chromatic number at
least 4. This lower bound stood until 2018 when computer scientist and biologist
Aubrey de Grey found a 1581-vertex graph that raised the lower bound to 5. The
upper bound remains at 7.
379
Mathematical Puzzles
Same Sum Dice: Brought to me by David Kempe of the University of Southern Cali-
fornia. Similar results can be found in a paper by the very notable mathematicians
Persi Diaconis, Ron Graham and Bernd Sturmfels [31]. Pointed out by Greg War-
rington of the University of Vermont: The puzzle (and proof) still works with m
n-sided dice versus n m-sided dice.
Zero-sum Vectors: Sent to me by Noga Alon of Princeton University. The problem
appeared as D6 in the 1996 Moscow Mathematical Olympiad [39]. The puzzle’s
statement is “tight” in at least two senses. First, if any of the 2n {−1, +1}-vectors
is left off the original list, the result fails—even if the others are represented ar-
bitrarily often! Suppose, for example, that n = 5 and that the missing vector is
y = ⟨+1, +1, +1, −1, −1⟩. In all other vectors, change all +1’s among the first
three coordinates to zeroes, and all −1’s among the last two coordinates to zero.
Since y is missing, the zero vector will not appear among the altered vectors; and
any sum of altered vectors will have a negative number among its first three coor-
dinates, or a positive number among its last two, or both.
Second, as noted by mathematician and hacker Bill Gosper, for any n there is a way
to alter the vectors in such a way that there is no way to get a zero sum short of
adding up the entire list. We leave it to the reader to verify this fact.
theorem: In fact the numbers {nr}, for r irrational, are not only dense but remarkably
(and usefully) evenly spaced: Roughly speaking, if you run n through the integers
from 1 to any large number, the fraction of the values {nr} that appear in some
subinterval of [0, 1) will be close to the length of that subinterval. This observation
is fundamental in a branch of mathematics sometimes called “discrepancy theory,”
for which a wonderful source is [11].
380
Notes and Sources
Bias Test: Original. The theorem mentioned in the text was proved by Gheorghe
Zbǎganu [22, 109].
Dot-Town Exodus: Classical. Steve Babbage, a manager and cryptographer with
Vodafone, points out that if the residents of Dot-town begin to worry that a
suicide was not caused by knowing one’s dot color—but perhaps because some
Dot-towner “has finally cracked under the strain of living in such a ludicrous
environment”—then under certain circumstances the rest of the town may yet sur-
vive the stranger’s incursion.
Conversation on a Bus: A creation of John H. Conway’s. Variations can be found in a
paper of Tanya Khovanova’s posted at https://arxiv.org/pdf/1210.5460.pdf.
Matching Coins: Brought to my attention by Oded Regev of the Courant Institute,
NYU. In [56] the authors show that with more sophisticated versions of this
scheme, Sonny and Cher can get as close as they want to a fraction x of success,
where x is the unique solution to the equation
−x log2 x − (1−x) log2 (1−x) + (1−x) log2 3 = 1,
about 0.8016, but they can do no better. Moreover, this applies whether the coin-
flips are random or adversarial.
Two Sheriffs: This puzzle was devised and presented in [10] to give a toy example of
how two parties that share information, but have no common secret, can establish
a common secret over an open channel, and then use it to communicate in secret.
theorem: Properly speaking, the study of secret codes is cryptology, which divides into de-
signing codes (cryptography) and breaking them (cryptanalysis). In practice “cryp-
tography” is often used to cover the whole subject. A particularly entertaining
source is [65].
381
Mathematical Puzzles
nearest number of cents to the fraction (b−r)/(b+r) of your current worth, you
could go bankrupt before half the deck is gone.
Serious Candidates: Devised by probabilist David Aldous of U.C. Berkeley, who was
inspired by the prediction market and the Republican party’s presidential nomina-
tion process in 2012.
Rolling a Six: Devised and told to me by MIT probabilist Elchanon Mossel, who
dreamed it up as an easy problem for his undergraduate probability students and
then realized the answer was not 3. The solution given is your author’s.
Napkins in a Random Setting: Posed on the spot by the late, great John Horton Con-
way at a math conference banquet where the circular table, coffee cups and napkins
were as described.
Roulette for Parking Money: Due to Dick Hess, who was inspired by a note written
by Bill Cutler. It’s called “Bus Ticket Roulette” in [63]. Here we have assumed that
the table has both a “0” and a “00” but the same scheme is optimal in Monte Carlo
where there’s only the single zero.
Buffon’s Needle: Ramaley’s paper [93].
Covering the Stains: Devised by Naoki Inaba and sent to me by Iwasawa Hirokazu,
known also as Iwahiro; both are prolific puzzle composers. The actual maximum
number of points in the plane that can always be covered by disjoint open disks
is not known (see [5]); embarrassingly, the best results currently are that 12 points
are always coverable and 42 are not. My guess? 25.
Colors and Distances: Sent by probabilist Ander Holroyd, who heard it from Russ
Lyons. My setting is a real town which, the last time I looked, was pretty evenly
split.
Painting the Fence: From the Spring ’17 Emissary Puzzles Column by Elwyn
Berlekamp and Joe P. Buhler, to which it was contributed by Paul Cuff who recalls
it from one of Tom Cover’s seminars at Stanford.
Filling the Cup: Classic.
theorem: For (much) more on the probabilistic method, the reader is enthusiastically
referred to [3].
382
Notes and Sources
big square) must contain a grid cell, the baby frog can be guided to a circle of area
A with only ⌈ 12 log2 (2π/A)⌉ croaks.
Guarding the Gallery: The question (with 11 replaced by n) was asked by the late
Victor Klee, a brilliant geometer who spent most of his career at the University of
Washington, and answered by combinatorialist Václav Chvátal. The lovely proof
in this volume was found by Steve Fisk [45].
Path Through the Cells: Moscow Mathematical Olympiad 1999, Problem D5 [39],
contributed by N. L. Chernyatyev. Notice that the fact that the cells of a telephone
network most likely constitute a planar graph is not needed for this result.
Profit and Loss: This puzzle is adapted from one which appeared on the 1977 Inter-
national Mathematical Olympiad, submitted by a Vietnamese composer. Thanks
to Titu Andreescu for telling me about it. The solution given is my own; the
industrious reader will not find it difficult to generalize it to the case where x
and y have a greatest common divisor gcd(x, y) other than 1. The result is that
f (x, y) = x + y − 1 − gcd(x, y).
Uniformity at the Bakery: This lovely puzzle is from a Russian competition and ap-
pears in [97]. The given argument also works if all the weights are rational num-
bers, since we can just change units so that the weights are integers. But what if
the weights are irrational? Regard the real numbers R as a vector space over the ra-
tionals Q, and let V be the (finite-dimensional) subspace generated by the weights
of the bagels. Let α be any member of a basis for V , and let qi be the rational co-
efficient of α when the weight of the ith bagel is expressed in this basis. Now the
same argument used in the rational case shows that all the qi ’s must be 0, but this
is a contradiction since then α was not in V to begin with.
Summing Fractions: From the 3rd All Soviet Union Mathematical Competition, Kiev,
1969.
Tiling with L’s: Told to me by Rick Kenyon of Yale University, an expert on random
tilings.
Traveling Salesmen: From the 11th All Soviet Union Mathematical Competition,
Tallinn, 1977; thanks to Barukh Ziv of Intel for sending me the intended solu-
tion. The solution given was devised by me and Bruce Shepherd of the University
of British Columbia; another nice solution was sent to me by Emmanuel Boussard
of Boussard & Gavaudan Asset Management.
Lame Rook: Composed by Rustam Sadykov and Alexander Shapovalov for a 1998
Olympics, and told to me by Rustam. I love that unexpected question at the end
of the puzzle statement! Two additional remarks: (1) there’s a non-inductive proof
using Pick’s Theorem, and (2) in fairy chess, the lame rook is called the “wazir.”
theorem: A good source on Ramsey theory is [58].
383
Mathematical Puzzles
Bugs on Four Lines: This puzzle was passed to me by Matt Baker, of Georgia Tech. It
is sometimes called “the four travellers’ problem” and appears on the website “In-
teractive Mathematics Miscellany and Puzzles” at http://www.cut-the-knot.
org/.
Circular Shadows II: From the 5th All Soviet Union Mathematical Competition, Riga,
1971.
Box in a Box: Told to me by Anthony Quas (University of Victoria) who heard it, and
the solution given, from Isaac Kornfeld, a professor at Northwestern University;
Kornfeld had heard the puzzle many years ago in Moscow. Additional very nice
solutions were sent to me by Mike Todd of Cornell University and by Marc Mas-
sar. Mike’s uses vectors and the triangle inequality, while Marc’s is based on the
observation that for an a × b × c box, (a + b + c)2 is equal to the area of the box
plus the square of its diagonal length.
Angles in Space: I was tested on this puzzle during a visit to MIT, and was stumped.
It turns out that the question was for some time (since the late 1940’s) an open
problem of Paul Erdős and Victor Klee, then was solved by George Danzig and
Branko Grünbaum in 1962.
The question of the maximum number of points in n-space that determine only angles
that are strictly acute remained open much longer, for a long time known only to
be between 2n−1 and 2n − 1. Only recently [54] has it been shown that you can
get halfway to the upper bound: There’s a set of 2n−1 + 1 points with all angles
strictly acute.
Curve and Three Shadows: The question was raised by number theorist Hendrik
Lenstra, after hearing about Oskar van Deventer’s puzzle “Oskar’s Cube” in which
three orthogonal sticks poke through the sides of a cube, each of which has a maze
cut out of it. Since the mazes can’t have loops without a piece falling out, it wasn’t
clear whether the puzzle could be designed so that the stick intersection can follow
a closed curve in space.
theorem: The Monge Circles theorem, with its famous sphere proof, was first brought
to my attention by computer theorist Dana Randall of Georgia Tech. The flaw
was pointed out to me by Jerome Lewis, Professor of Computer Science at the
University of South Carolina Upstate.
384
Notes and Sources
and are paid in cash, so that you can’t gamble with your winnings and perhaps get
addicted. The dynamic program maximizes your probability of coming out ahead
given that you bought 100 chips that can be bet at even odds on fair coinflips.
(Yes, you’d’ve been better off had you bought only 99 chips.) But one can some-
times do better in Majority Hats than in the responsible casino; with computer help,
Wästlund now has a protocol that has pushed the majority probability for 100 pris-
oners to 1156660500373338319469/1180591620717411303424, or approximately
97.9729552603863%.
Fifteen Bits and a Spy: Told to me by László Lovász, then of Microsoft Research, now
president of the Hungarian Academy of Sciences. Laci is uncertain of its origin.
theorem: A nice source for error-correcting codes is [91].
385
Mathematical Puzzles
386
Notes and Sources
Bulgarian Solitaire: See [1]. For non-triangular numbers of chips, you end up cycling
through triangular formations with extra chips shifting along the new diagonal.
theorem: See [85] for more on the infinite case.
387
Mathematical Puzzles
388
Notes and Sources
in Europe from someone he can’t trace named Felix Vardy. The puzzle then showed
up in the Spring/Fall 2003 issue of Emmissary. Dan Amir, a former Rector of Tel
Aviv University, read the puzzle in Emmissary and posed it to Noga Alon, who
brought it to the Institute for Advanced Study; I first heard it from Avi Wigderson
of the I.A.S., in late 2003.
Ants on the Circle: Elwyn Berlekamp and I came up with this one together (but of
course others may have thought of it as well—turning a line into a circle is, as we
have seen, often a useful thing to do).
Sphere and Quadrilateral: Told to me by Tanya Khovanova, who lists it among the
“coffin puzzles” on her blog. These are puzzles with simple solutions that are dif-
ficult to find, especially for someone taking a timed exam. According to Tanya
and others, such puzzles were used in the Soviet Union to keep “undesirables,”
for example, Jewish students, out of the best schools.
Two Balls and a Wall: Disseminated by Dick Hess and Gary Antonick at the Eleventh
Gathering for Gardner, based on a discovery [49] by Gregory Galperin.
theorem: Brought to my attention by Yuval Peres.
389
Mathematical Puzzles
shift registers, he has determined that the bulbs first return to all-on at time t =
181,080,508,308,501,851,221,811,810,889, much greater than the age of the uni-
verse in seconds. Check out his demo [102].
Emptying a Bucket: From the 5th All Soviet Union Mathematical Olympiad, Riga,
1971. The puzzle showed up again, minus the hardware, on the Putnam Exam
in 1993, and reached me via Christian Borgs, then at Microsoft Research. The
solution given is mine, but there is also an elegant number-theoretic solution found
independently by Svante Janson of Uppsala University, Sweden, and Garth Payne
of Penn State.
Ice Cream Cake: Told to me by French graduate student Thierry Mora, who heard it
from his prep-school teacher Thomas Lafforgue; Stan Wagon tells me that it comes
from a Moscow Mathematical Olympiad (which, if you’ve read this far in Notes &
Sources, should not be a surprise.) The puzzle originally involved a second angle
as well, indicating the amount of cake passed over between wedge-cuttings; it still
requires only finitely many operations to get all the icing back on top, as ambitious
readers will verify. But, the puzzle as stated here (where the second angle is 0) is
already surprising and challenging.
Moth’s Tour: Suggested to me by Richard Stanley. Thirty years ago, at a Chinese
restaurant in Atlanta, Laci Lovász and I [80] managed to prove that the cycle is
the only graph, apart from the complete graph, with this nice property (that the
last new vertex visited by a random walk is equally likely to be any vertex other
than the starting point).
Boardroom Reduction: Original. Many complex versions abound of a similar puzzle
involving pirates and gold coins, but it seemed to me that the essence of that puzzle
could be achieved without the coins.
theorem: This marvelous fact (in another context) was observed by Lord Rayleigh, and
probably many others since—and maybe before. A nice modern reference is [95].
Sometimes called “Beatty’s problem” (after Samuel Beatty 1881–1970), the puzzle
appeared as Problem 3117 in The American Mathematical Monthly 34 (1927), pp.
159–159, and again on the 20th Putnam Exam, November 21, 1959.
390
Notes and Sources
Gluing Pyramids: The argument given, sometimes called the “pup tent” solution, ap-
peared in a 1982 article by Steven Young [108]. After the PSAT debacle, the Educa-
tional Testing Service created a panel, on which your author served, for reviewing
the questions on their mathematics aptitude tests.
Precarious Picture: Contributed by Giulio Genovese, who heard it from more than
one source in Europe.
Finding the Rectangles: Sent by Yan Zhang.
Tiling a Polygon: Sent by Dana Randall.
Tiling with Crosses: Sent by Senya Schlosman.
Cube Magic: I was reminded of this puzzle, which appeared in a Martin Gardner col-
umn, by Gregory Galperin. A polytope has the “Rupert” property if a straight
tunnel can be made in it large enough to pass an identical polytope through (and,
therefore, can be enlarged to pass an even bigger copy through). The cube case was
originally proved, allegedly, by Prince Rupert of the Rhine in the late 17th century.
As of now nine of the Archimidean polytopes are known to have the Rupert prop-
erty, the last added recently in [77].
Circles in Space: Told to me by computer theorist Nick Pippenger of Harvey Mudd
College; the construction given is due to Andrzej Szulkin of Stockholm University
[100]. As pointed out to me by Johan Wästlund, this and some other tiling prob-
lems can also be solved using transfinite induction, as in Double Cover by Lines
from Chapter 23.
Invisible Corners: Moscow Mathematical Olympiad 1995, Problem D7 [39], con-
tributed by A. I. Galochkin.
theorem: This classic appears in [89] as “The Problem of the Calissons.”
391
Mathematical Puzzles
392
Bibliography
[1] Ethan Akin and Morton Davis, Bulgarian solitaire, Amer. Math. Monthly 92 #4
(1985), 310–330.
[2] Noga Alon, Tom Bohman, Ron Holzman, and Daniel J. Kleitman, On parti-
tions of discrete boxes, Discrete Math. 257 #2–3 (28 November 2002), 255–258.
[3] Noga Alon and Joel H. Spencer, The Probabilistic Method, Fourth Edition, Wiley
Series in Discrete Mathematics and Optimization, Hoboken, NJ, 2015.
[4] Noga Alon and D. B. West, The Borsuk-Ulam theorem and bisection of neck-
laces, Proc. Amer. Math. Soc. 98 #4 (December 1986), 623–628.
[5] Greg Aloupis, Robert A. Hearn, Hirokazu Iwasawa, and Ryuhei Uehara, Cov-
ering points with disjoint unit disks, 24th Canadian Conference on Computational
Geometry, Charlottetown, PEI (2012).
[6] D. André, Solution directe du problème résolu par M. Bertrand, Comptes Rendus
de l’Académie des Sciences Paris 105 (1887), 436–437.
[7] Titu Andreescu and Zuming Feng, eds., Mathematical Olympiads, MAA Press,
Washington DC, 2000.
[8] Frank Arntzenius, Some problems for conditionalization and reflection, J. Phi-
los. 100 #7 (2003), 356–370.
[9] W. W. Rouse Ball, Mathematical Recreations and Essays, Macmillan & Co., Lon-
don, 1892.
[10] D. Beaver, S. Haber, and P. Winkler, On the isolation of a common secret,
in The Mathematics of Paul Erd˝os Vol. II, R. L. Graham and J. Neˇ
setˇ
ril, eds.,
Springer-Verlag, Berlin, 1996, 121–135. (Reprinted and updated in 2013.)
[11] József Beck and William W. Chen, Irregularities of Distribution, Cambridge Uni-
versity Press, Cambridge, UK, 1987.
[12] Antonio Behn, Christopher Kribs-Zaleta, and Vadim Ponomarenko, The con-
vergence of difference boxes, Amer. Math. Monthly 112 #5 (May 2005), 426–
439.
[13] Elwyn R. Berlekamp, John H. Conway, and Richard K. Guy, Winning Ways
for Your Mathematical Plays, Volumes 1–4, Taylor & Francis, Abingdon-on-
Thames, UK, 2003.
[14] E. R. Berlekamp and T. Rodgers, eds., The Mathemagician and Pied Puzzler, AK
Peters, Natick, MA, 1999.
[15] Geoffrey C. Berresford, A simpler proof of a well-known fact, Amer. Math.
Monthly 115 #6 (June–July 2008), 524.
[16] J. Bertrand, Solution d’un problème, Comptes Rendus de l’Académie des Sciences,
Paris 105 (1887), 369.
393
Mathematical Puzzles
[37] P. Erdős, A. Ginzburg, and A. Ziv, Theorem in the additive number theory,
Bull. Res. Council of Israel 10F (1961), 41–43.
[38] P. Erdös and G. Szekeres, A combinatorial problem in geometry, Compos. Math.
2 (1935), 463–470.
[39] R. Fedorov, A. Belov, A. Kovaldzhi, and I. Yashchenko, eds., Moscow Mathe-
matical Olympiads, 1993–1999, MSRI/AMS 2011.
[40] R. Fedorov, A. Belov, A. Kovaldzhi, and I. Yashchenko, eds., Moscow Mathe-
matical Olympiads, 2000–2005, MSRI/AMS 2011.
[41] D. Felix, Optimal Penney Ante strategy via correlation polynomial identities,
Electron. J. Comb. 13 R35 (2006), 1–15.
[42] Thomas S. Ferguson, A Course in Game Theory, published by the author, 2020.
Online at https://www.math.ucla.edu/~tom/Game_Theory.
[43] M. J. Fischer, S. Moran, S. Rudich, and G. Taubenfeld, The wakeup problem,
Proc. 22nd Symp. on the Theory of Computing, Baltimore, MD, May 1990.
[44] M. J. Fischer and S. L. Salzberg, Finding a majority among n votes, J. Algo-
rithms 3 4 (December 1989), 362–380.
[45] Steve Fisk, A short proof of Chvátal’s watchman theorem, J. Comb. Theory B
24 (1978), 374.
[46] M. L. Fredman, D. J. Kleitman, and P. Winkler, Generalization of a puzzle
involving set partitions, Barrycades and Septoku; Papers in Honor of Martin Gard-
ner and Tom Rodgers, Thane Plambeck and Tomas Rokicki, eds., AMA/MAA
Spectrum Vol. 100, MAA Press, Providence, RI, 2020, pp. 125–129.
[47] Aaron Friedland, Puzzles in Math and Logic, Dover, Mineola, NY, 1971.
[48] Anna Gal and Peter Bro Miltersen, The cell probe complexity of succinct
data structures, International Colloquium on Automata, Languages and Program-
ming (ICALP), Eindhoven, The Netherlands. Jos C. M. Baeten, ed., Lecture
Notes in Computer Science 2719, Springer-Verlag, Berlin, 2003.
[49] G. A. Galperin, Playing pool with π: The number π from a billiard point of
view, Regul. Chaotic Dyn. 8 (2003), 375–394.
[50] G. A. Galperin and A. K. Tolpygo, Moscow Mathematical Olympiads, Moscow,
Prosveshchenie, 1986.
[51] Martin Gardner, The Colossal Book of Short Puzzles and Problems, W. W. Norton
& Co., New York, NY, 2006.
[52] Martin Gardner, On the paradoxical situations that arise from nontransitive
relations, Sci. Am. 231 4, (October 1974), 120–125.
[53] Martin Gardner, Time Travel and Other Mathematical Bewilderments, W. H. Free-
man and Company, New York, NY, 1988. ISBN 0-7167-1925-8.
[54] Balász Gerencsér and Viktor Harangi, Too acute to be true: The story of acute
sets, Amer. Math. Monthly 126 #10 (December 2019), 905–914.
[55] E. Goles and J. Olivos, Periodic behavior of generalized threshold functions,
Discrete Math. 30 (1980), 187–189.
[56] Olivier Gossner, Penélope Hernández, and Abraham Neyman, Optimal use of
communication resources, Econometrica 74 #6 (November 2006), 1603-1636.
[57] N. Goyal, S. Lodha, and S. Muthukrishnan, The Graham-Knowlton problem
revisited, Theory of Computing Systems 39 #3 (2006), 399–412.
Mathematical Puzzles
[58] Ronald L. Graham, Bruce L. Rothschild, and Joel H. Spencer, Ramsey The-
ory, Second Edition, Wiley Series in Discrete Mathematics and Optimization,
Hoboken, NJ, 2013.
[59] L. J. Guibas and A. M. Odlyzko, String overlaps, pattern matching, and non-
transitive games, J. Comb. Theory Ser. A. 30 (1981), 183–208.
[60] Christopher S. Hardin and Alan D. Taylor, A peculiar connection between the
axiom of choice and predicting the future, Amer. Math. Monthly 115 #2 (2008),
91–96.
[61] G. H. Hardy, On certain oscillating series, Q. J. Math. 38 (1907), 269–288.
[62] Dick Hess, Golf on the Moon, Dover, Mineola, NY, 2014.
[63] Dick Hess, The Population Explosion and Other Mathematical Puzzles, World Sci-
entific, Singapore, 2016. https://doi.org/10.1142/9886.
[64] Ross Honsberger, Ingenuity in Mathematics, New Mathematical Library Series
23, Mathematical Association of America, Providence, RI, 1970.
[65] David Kahn, The Codebreakers, Scribner & Sons, New York, 1967 and 1996.
[66] K. S. Kaminsky, E. M. Luks, and P. I. Nelson, Strategy, nontransitive dom-
inance and the exponential distribution, Austral. J. Statist. 26 #2 (1984), 111–
118.
[67] K. A. Kearns and E. W. Kiss, Finite algebras of finite complexity, Discrete Math.
207 (1999), 89–135.
[68] Murray Klamkin, International Mathematical Olympiads 1979–1985, Mathemati-
cal Association of America, Providence, RI, 1986.
[69] Michael Kleber, The best card trick, Math. Intell. 24 #1 (Winter 2002), 9–11.
[70] Anton Klyachko, A funny property of sphere and equations over groups, Com-
mun. Algebra 21 #7 (1993), 2555–2575.
[71] G. H. Knight, in Notes and Queries, Oxford Journals (Firm), Oxford U. Press, Ox-
ford, UK, 1872.
[72] K. Knauer, P. Micek, and T. Ueckerdt, How to eat 4/9 of a pizza, Discrete Math.
311 #16 (2011), 1635–1645.
[73] Joseph D. E. Konhauser, Dan Velleman, and Stan Wagon, Which Way Did the
Bicycle Go?, Cambridge University Press, 1996.
[74] Alan G. Konheim and Benjamin Weiss, An occupancy discipline and applica-
tions, SIAM J. Appl. Math. 14 #6 (November 1966), 1266–1274.
[75] Boris Kordemsky, The Moscow Puzzles, Charles Scribner’s Sons, New York,
1971.
[76] J.-F. Lafont and B. Schmidt, Blocking light in compact Riemannian manifolds,
Geom. Topol. 11 (2007), 867–887.
[77] Gerárd Lavau, The truncated tetrahedron is Rupert, Amer. Math. Monthly 126
#10 (2019), 929–932.
[78] Tamas Lengyel, A combinatorial identity and the world series, SIAM Rev. 35
#2 (June 1993), 294–297.
[79] László Lovász, Combinatorial Problems and Exercises, North Holland, Amster-
dam, 1979.
Bibliography
[80] L. Lovász and P. Winkler, A note on the last new vertex visited by a random
walk, J. Graph Theory 17 #5 (November 1993), 593–596.
[81] Anany Levitin and Maria Levitin, Algorithmic Puzzles, Oxford U. Press, Oxford,
UK, 2011.
[82] J. E. Littlewood, The dilemma of probability theory, Littlewood’s Miscellany,
Béla Bollobás, ed., Cambridge University Press, Cambridge, UK, 1986.
[83] A. Liu and B. Shawyer, eds., Problems from Murray Klamkin, The Canadian Col-
lection, MAA Problem Book Series, MAA Press, Providence, RI, 2009.
[84] Chris Maslanka and Steve Tribe, The Official Sherlock Puzzle Book, Woodland
Books, Salt Lake City, UT, 2018. ISBN 978-1-4521-7314-6.
[85] E. C. Milner and S. Shelah, Graphs with no unfriendly partitions, in A Tribute
to Paul Erdős, A. Baker et al., eds., Cambridge University Press, Cambridge,
UK, 1990, 373–384.
[86] Frederick Mosteller, Fifty Challenging Problems in Probability, Addison-Wesley,
Boston, MA, 1965.
[87] Colm Mulcahy, Mathematical Card Magic: Fifty-Two New Effects, CRC press,
Boca Raton, FL, 2013. ISBN: 978-14-6650-976-4.
[88] Serban Nacu and Yuval Peres, Fast simulation of new coins from old, Ann.
Appl. Probab. 15 #1A (2005), 93–115.
[89] Roger B. Nelsen, Proofs Without Words, Mathematical Association of America,
Providence, RI, 1993.
[90] W. Penney, Problem: Penney-ante, J. Recreat. Math. 2 (1969), 241.
[91] Vera Pless, Introduction to the Theory of Error-Correcting Codes, John Wiley &
Sons, Hoboken, NJ, 1982.
[92] H. Prüfer, Neuer Beweis eines Satzes über Permutationen, Arch. Math. Phys. 27
(1918), 742–744.
[93] T. F. Ramaley, Buffon’s noodle problem, Amer. Math. Monthly 76 #8 (October
1969), 916–918.
[94] M. Reiss, Über eine Steinersche combinatorische Aufgabe, welche im 45sten
Bande dieses Journals, Seite 181, gestellt worden ist, J. Reine Angew. Math. 56
(1859), 226–244.
[95] I. J. Schoenberg, Mathematical Time Exposures, Mathematical Association of
America, Providence, RI, 1982.
[96] Harold N. Shapiro, Introduction to the Theory of Numbers, Dover, Mineola, NY,
1982.
[97] D. O. Shklarsky, N. N. Chentov, and I. M. Yaglom, The USSR Problem Book, W.
H. Freeman and Co., San Francisco, 1962.
[98] R. P. Sprague, Über mathematische Kampfspiele, Tohoku Math. J. 41 (1935–
1936), 438–444.
[99] Roland Sprague, Recreation in Mathematics, Blackie & Son Ltd., London, 1963.
[100] Andrzej Szulkin, R3 is the union of disjoint circles, Amer. Math. Monthly 90 #9
(1983), 640–641.
[101] P. Vaderlind, R. Guy, and L. Larson, The Inquisitive Problem Solver, Mathemat-
ical Association of America, Providence, RI, 2002.
Bibliography
398
The Author
399
Index
A B
Adding, multiplying, and Baby frog, xlvi, xci, 210
grouping, xxxviii, xci, Bacterial reproduction, xxiv,
155 xcii, 17
Air routes in Aerostan, xxii, xci, Bacteria on the plane, li, xci,
42 256–257
Algebra, 55–65 Badly designed clock, lxxxi, xcii,
linear, 107, 236 283–284
topology, 39 Bags of marbles, xxiv, xcii, 2
Algorithm, lxxxi, 15, 146–148 Bat and ball, xvii, xcii, 55
Bob’s, 289 Belt around the earth, xxviii,
greedy, 51, 69 xcii, 56
All right or all wrong, xli, xci, Bertrand’s postulate, 74
343–344 Biased betting, xlix, xcii,
Alternate connection, lxv, xci, 12 118–119
Alternating powers, lxvii, xci, Bias test, xlv, xcii, 170–171
106–107 Bidding in the dark, xxiii, xcii,
Alternative dice, lxvi, xci, 62–65 182
An attractive game, lxiv, xci, Big pairs in a matrix, xxv, xcii,
189–190 102–103
Angles in space, lxxiii, xci, Bindweed and honeysuckle, lxv,
229–230 xcii, 12–16
Angry baseball, lxxiv, xci, 128 Birthday match, xx, xcii,
Ants on the circle, li, xci, 110–111
297–298 Bluffing with reals, lxxi, xcii,
Area–perimeter match, xlii, 58 314–315
Ascending and descending, l, Boarding the manhole, lv, xcii,
xlix, xci, 157–158 225–227
Attention paraskevidekatria- Boardroom reduction, lxxxvi,
phobes, xxxii, xci, xcii, 323–325
4–5 Borchardt, C. W., 14
Attic lamp, xxviii, xci, 166 Box in a box, lxix, xcii, 228–229
Average, 91 Boy born on tuesday, xxi, xcii,
Axiom of choice (AC), 341–352 113–114
401
Index
402
Index
403
Index
F xcvi, 261–262
Factorial(s) Functions
coincidence, lviii, xcv, 74 choice, 342
and squares, lxxii, xcv, generating, 63
75–76 parking, 367, 368
Fair play, xxiv, xcv, 275–276 potential, 255, 256, 260, 268
Falling ants, xliii, xcv, 297 Funny dice, lxxxiii, xcvi,
Faulty combination lock, xlvii, 285–286
xcv, 8–10
Fewest slopes, xxvi, xcv, 139 G
Fibonacci multiples, lxxxi, xcv, Galton, F., 64
318 Game/gaming
Fifteen bits and a spy, lxxx, xcv, attractive, lxiv, xci, 189–190
249–252 coin, lxxxv, xciii, 133–134
Figure eights in the plane, lxiv, of desperation, lx–lxi, xcvi,
xcv, 350 312
Filling dishwashing, lxxii–lxxiii,
a bucket, lx, xcvi, 279–280 xciv, 122–124
the cup, lxxxix, xcvi, divisibility, xxxvii, xciv, 70
202–204 snake, xliv, ciii, 45
Finding split, lxxiv, civ, 126–128
the counterfeit, xix, xcvi, quilt, xlvii, xcvi, 60
163–164 Garnering fruit, lxxxiv, xcvi,
a Jack, xxxv, xcvi, 96 37–40
the missing number, xxvii, Gasoline crisis, liv, xcvi, 83
xcvi, 276 Generating
the rectangles, lxiv, xcvi, functions, 63
335 the rationals, lxxxii, xcvi,
Find the robot, lxiii, xcvi, 285
349–350 Gladiators
First-grade division, lxii, xcvi, version I, lxxvi–lxxvii,
259 xcvii, 364–365
First odd number, xxxiii, xcvi, version II, lxxvii, xcvii,
140–141 365–366
Flipping the pentagon, lxxx, Gluing pyramids, lxi, xcvii,
xcvi, 265–267 333–334
Flying saucers, xlviii–xlix, xcvi, Graphography, 41–53
81–83 Greedy algorithm, 51
Fourth corner, xxviii, xcvi, Guarding the gallery, xlviii,
17–18 xcvii, 210–212
Frames on a chessboard, lxxiv,
404
Index
405
Index
406
Index
407
Index
Profit and loss, lv, ci, 213–215 all the numbers, xxvi, cii,
Protecting the statue, lvi–lvii, ci, 183
332–333 pencil, xxi, cii, 328
Pyramid a six, lxxvii, cii, 193–194
bugs on, xliv, xciii, 34 Rotating coin, xviii, cii, 295
gluing, lxi, xcvii, 333–334 Roulette
for parking money, lxxxv,
R cii, 196–197
Raising art value, xxxiii, ci, for the unwary, lix, cii,
94–95 188–189
Ramsey’s theorem, 202, 203, Rows and columns, xliv, cii, 7
220, 221
Random S
bias, lxxvi, ci, 131 Salaries and raises, xxv, cii, 2–3
chord, lxxvi, ci, 130–131 Same sum
intersection, lv, cii, 186–188 dice, lxviii, cii, 159–160
intervals, lxi, cii, 361–362 subsets, xxx, ciii, 154
judge, lxxiii, cii, 124 Second ace, xxvi, ciii, 114–115
variables, 181 Self-referential number, lxxxix,
Rating the horses, xxxv, cii, 5–6 ciii, 289–293
Rationals, generating, lxxxii, Sequencing the digits, xlvi, ciii, 8
xcvi, 285 Serious candidates, lxxv, ciii,
Recovering the polynomial, 192–193
xlvii, cii, 59 Service options, lxvii–lxviii, ciii,
Rectangles tall and wide, xlviii, 121
cii, 71–73 Set of non-transitive dice, 285
Red Seven cities of gold, lxxxvi, ciii,
and black sides, xlv–xlvi, 148–150
cii, 58–59 Sharing a pizza, lxxxiv, ciii,
and blue hats in a line, 286–287
xxxv–xxxvi, cii, 19–20 Shoelaces at the airport, xli, ciii,
points and blue, xxxix, cii, 6
255–256 Shoes, socks, and gloves, xviii,
Returning pool shot, xl, cii, ciii, 151–152
296–297 Signs in an array, xix, ciii,
Reverse conditional 253–254
probabilities, 112 Sinking 15, xx, ciii, 353
Reversibility theorem, 317 Skipping a number, xlv, ciii, 35
Righting the pancakes, xxxi, cii, Slabs in 3-space, lx, ciii, 227
254–255 Sleeping beauty, lxxxv–lxxxvi,
Rolling ciii, 134–135
408
Index
409
Index
410