+ All Categories

Quizzes

Date post: 31-Dec-2015
Category:
Upload: atkawa7
View: 33 times
Download: 1 times
Share this document with a friend
Description:
Mathematics Quizzes
Popular Tags:
31
Puzzles puzzles January 8, 2014 Abstract Here are some mathematical puzzles that I have enjoyed. Most of them are of the kind that you can discuss and solve at a dinner table, usually without pen and paper. So as not to spoil your fun, no solutions are given on this page, but for some problems I have provided some hints. Contents 1 Picking the larger of two card 1 2 Enclosing land by fence pieces 1 3 Planar configuration of straight connecting lines 2 4 Reducing nearby enemies 2 5 Transporting bananas 2 6 Car and key hide-and-seek 3 7 Handshakes at a dinner party 3 8 Rectifying a pill mistake 3 9 Chomp 4 10 Alternating T-shirt colors 4 11 Digit sums of multiples of 11 5 1
Transcript
Page 1: Quizzes

Puzzles puzzles

January 8, 2014

AbstractHere are some mathematical puzzles that I have enjoyed. Most

of them are of the kind that you can discuss and solve at a dinnertable, usually without pen and paper. So as not to spoil your fun,no solutions are given on this page, but for some problems I haveprovided some hints.

Contents1 Picking the larger of two card 1

2 Enclosing land by fence pieces 1

3 Planar configuration of straight connecting lines 2

4 Reducing nearby enemies 2

5 Transporting bananas 2

6 Car and key hide-and-seek 3

7 Handshakes at a dinner party 3

8 Rectifying a pill mistake 3

9 Chomp 4

10 Alternating T-shirt colors 4

11 Digit sums of multiples of 11 5

1

Page 2: Quizzes

12 Weighing piles of coins 5

13 Guessing each other’s coins 5

14 The duck and the fox 6

15 Dropping eggs 6

16 Age of children 6

17 Capturing a pirate ship 7

18 3-person duel 7

19 The genders of the neighboring family’s children 8

20 Finding a hermit 8

21 Witches at a coffee shop 9

22 Lemmings on a ledge 9

23 Poisoned wine 9

24 Dropping 9-terms from the harmonic series 10

25 Opening boxes in a prison courtyard 11

26 Frugal selection of weights to weigh a thing 11

27 Translation error in a cookbook 12

28 Making a square larger 12

29 Catching a spy 13

30 Average clan size 13

31 Colored balls in boxes 13

32 Mixed up airplane seats 14

33 Multiples in the Fibonacci series 14

2

Page 3: Quizzes

34 Coins in a line 14

35 Determining the number of one hat 15

36 Voting on how to distribute coins 15

37 Subsequence of coin tosses 16

38 Children and light switches 16

39 Finding a counterfeit coin 16

40 Cutting cheese 17

41 Fair soccer championship 17

42 Path on the surface of the Earth 17

43 Random point in a circle 18

44 Mixing vinegar and oil 18

45 Psycho killer 18

46 A special squarish age 19

47 Passing alternating numbers of coins around 19

48 The exact batting average 19

49 Summing pairs of numbers to primes 20

50 The worm and the rubber band 20

51 Placing coins on a table 21

52 Determining a hidden digit 21

53 Boris and Natasha 21

54 Burning ropes to measure time 22

55 Flipping cards 22

3

Page 4: Quizzes

56 Three hat colors 22

57 The line of persons with hats 24

58 The prisoners and the switch 24

59 Table with four coins 25

60 Stabilizing nodes from an anchor 25

61 Points on a circle 26

62 The electrician problem 26

63 The hidden card 27

1 Picking the larger of two card[Roger Wattenhofer told me this puzzle]

Someone picks, at their will, two cards from a deck of cards. The cardshave different numbers, so one is higher than the other. (In other words, theperson picks two distinct numbers in the inclusive range 1 through 13.) Thecards are placed face down on a table in front of you. You get to chooseone of the cards and turn it face up. Now, you will select one of the twocards (one of whose face you can see, the other one you can’t). If you selectthe highest card, you win. Design a card-selection strategy for which yourchance of winning is strictly greater than 50%.

2 Enclosing land by fence pieces[I got this puzzle from Serdar Tasiran.]

You are given one 44-meter piece of fence and 48 one-meter pieces offence. Assume each piece is a straight and unbendable. What is the largearea of (flat) land that you can enclose using these fence pieces?

4

Page 5: Quizzes

3 Planar configuration of straight connectinglines

[Radu Grigore told me this problem. I think may have heard it 20 yearsearlier from Jan van de Snepscheut.]

Given an even number of points in general positions on the plane (that is,no three points co-linear), can you partition the points into pairs and connectthe two points of each pair with a single straight line such that the straightlines do not overlap?

4 Reducing nearby enemies[I got this puzzle from Jason Koenig.]

You are given an irreflexive symmetric (but not necessarily transitive)"enemies" relation on a set of people. In other words, if person A is an enemyof a person B, then B is also an enemy of A. How can you divide up thepeople into two houses in such a way that every person has at least as manyenemies in the other house as in their own house?

[Hint: As Radu Grigore pointed out to me, solving the Planar configu-ration of straight connecting lines puzzle may provide a hint to solving thispuzzle.]

5 Transporting bananas[Rupak Majumdar told me this intriguing puzzle.]

You have 3000 bananas that you want to transport a distance of 1000 km.The transport will be done by a monkey. The monkey can carry as manyas 1000 bananas at any one time. With each kilometer traveled (forward orbackward), the monkey consumes 1 banana. How many bananas can you getacross to the other side?

6 Car and key hide-and-seek[A puzzle Aistis Simaitis gave me inspired this puzzle.]

In a room are three boxes that on the outside look identical. One of theboxes contains a car, one contains a key, and one contains nothing. You

5

Page 6: Quizzes

and a partner get to decide amongst yourselves to each point to two boxes.When you have made your decision, the boxes are opened and their contentsrevealed. If one of the boxes your partner is pointing to contains the car andone of the boxes you are pointing to contains the key, then you will bothwin. What strategy maximizes the probability of winning, and what is theprobability that you will win?

7 Handshakes at a dinner party[Pamela Zave shared this problem with me.]

Hilary and Jocelyn are throwing a dinner party at their house and haveinvited four other couples. After the guests arrive, people greet each other byshaking hands. As you would expect, a couple do not shake hands with eachother and no two people shake each other’s hands more than once. At somepoint during the handshaking process, Jocelyn gets up on a table and tellseveryone to stop shaking hands. She also asks each person how many handsthey have shaken and learns that no two people on the floor have shaken thesame number of hands. How many hands has Hilary shaken?

8 Rectifying a pill mistake[This is a slight rewording of a problem I got from Phil Wadler, who said heread the problem on xkcd.]

A man has a medical condition that requires him to take two kinds ofpills, call them A and B. The man must take exactly one A pill and exactlyone B pill each day, or he will die. The pills are taken by first dissolvingthem in water.

The man has a jar of A pills and a jar of B pills. One day, as he is aboutto take his pills, he takes out one A pill from the A jar and puts it in a glassof water. Then he accidentally takes out two B pills from the B jar and putsthem in the water. Now, he is in the situation of having a glass of water withthree dissolved pills, one A pill and two B pills. Unfortunately, the pills arevery expensive, so the thought of throwing out the water with the 3 pills andstarting over is out of the question. How should the man proceed in order toget the right quantity of A and B while not wasting any pills?

6

Page 7: Quizzes

9 Chomp[Clark Barrett told me this problem.]

Given is a (possibly enormous) rectangular chocolate bar, divided intosmall squares in the usual way. The chocolate holds a high quality standard,except for the square in the lower left-hand corner, which is poisonous. Twoplayers take turns eating from the chocolate in the following manner: Theplayer whose turn it is points to any one of the remaining squares, and theneats the selected square and all squares positioned above the selected square,to the right of the selected square, or both above and to the right of theselected square. Note, although the board starts off rectangular, it may takeon non-rectangular shapes during game play. The object of the game is toavoid the poisonous square. Assuming the initial chocolate bar is larger than1x1, prove that the player who starts has a winning strategy.

Hint: To my knowledge, no efficient strategy for winning the game isknown. That is, to decide on the best next move, a player may need toconsider all possible continuations of the game. Thus, you probably want tofind a non-constructive proof. That is, to prove that the player who starts hasa winning strategy, prove just the existence of such a strategy; in particular,steer away from proofs that would construct a winning strategy for the initialplayer.

10 Alternating T-shirt colors[I received this puzzle from Vladislav Shcherbina, but I changed gloves intoT-shirts to emphasize the people rather than the spaces between them.]

Ten friends walk into a room where each one of them receives a hat. Oneach hat is written a real number; no two hats have the same number. Eachperson can see the numbers written on his friends’ hats, but cannot see hisown. The friends then go into individual rooms where they are each given thechoice between a white T-shirt and a black T-shirt. Wearing the respectiveT-shirts they selected, the friends gather again and are lined up in the orderof their hat numbers. The desired property is that the T-shirts colors nowalternate.

The friends are allowed to decide on a strategy before walking into theroom with the hats, but they are not otherwise allowed to communicate witheach other (except that they can see each other’s hat numbers). Design a

7

Page 8: Quizzes

strategy that lets the friends always end up with alternating T-shirt colors.

11 Digit sums of multiples of 11[I got this one from Madan Musuvathi.]

Some multiples of 11 have an even digit sum. For example, 7*11 = 77and 7+7 = 14, which is even; 11*11 = 121 and 1+2+1 = 4, which is even.Do all multiples of 11 have an even digit sum? (Prove that they do or findthe smallest that does not.)

12 Weighing piles of coins[I got this puzzle from Dave Detlefs, who read it in an MIT Alumni magazine.This puzzle is a bit more involved than most puzzles on my page, so you maywant a paper and pen (and some tenacity) for this one. Once you get intoit, though, it’s a hard puzzle to put aside until you’ve solved it.]

There are two kinds of coins, genuine and counterfeit. A genuine coinweighs X grams and a counterfeit coin weighs X+delta grams, where X isa positive integer and delta is a non-zero real number strictly between -5and +5. You are presented with 13 piles of 4 coins each. All of the coins aregenuine, except for one pile, in which all 4 coins are counterfeit. You are givena precise scale (say, a digital scale capable of displaying any real number).You are to determine three things: X, delta, and which pile contains thecounterfeit coins. But you’re only allowed to use the scale twice!

13 Guessing each other’s coins[I got this puzzle from Raphael Reischuk, who also has a little puzzle collec-tion.]

You and a friend each has a fair coin. You can decide on a strategy andthen play the following game, without any further communication with eachother. You flip your coin and then write down a guess as to what your friend’scoin will say. Meanwhile, your friend flips her coin and writes down a guessas to what your coin says. There’s a third person involved: The third personcollects your guesses and inspects your coins. If both you and your friendcorrectly guessed each other’s coins, then your team (you and your friend)

8

Page 9: Quizzes

receive 2 Euros from the third person. But if either you or your friend (orboth) gets the guess wrong, then your team has to pay 1 Euro to the thirdperson. This procedure is repeated all day. Assuming your object is to winmoney, are you happy to be on your team or would you rather trade placeswith the third person?

14 The duck and the fox[I got this problem from Koen Claessen.]

A duck is in circular pond. The duck wants to swim ashore, because itwants to fly off and this particular duck is not able to start flying from thewater. There is also a fox, on the shore. The fox wants to eat the duck, butthis particular fox cannot swim, so it can only hope to catch the duck whenthe duck reaches the shore. The fox can run 4 times faster than the duck canswim. Is there always a way for the duck to escape?

15 Dropping eggs[I think I’ve heard some version of this problem before, but heard this onefrom Sophia Drossopoulou and Alex Summers.]

There’s a certain kind of egg about which you wonder: What is thehighest floor of a 36-story building from which you can drop an egg without itbreaking? All eggs of this kind are identical, so you can conduct experiments.Unfortunately, you only have 2 eggs. Fortunately, if an egg survives a dropwithout breaking, it is as good as new–that is, you can then conduct anotherdropping experiment with it. What is the smallest number of drops that issure to determine the answer to your wonderings?

16 Age of children[I got this problem from the book In code: a mathematical journey by SarahFlannery and David Flannery.]

A (presumed smart) insurance agent knocks on a door and a (presumedsmart) woman opens. He introduces himself and asks if she has any children.She answers: 3. When he then asks their ages (which for this problemwe abstract to integers), she hesitates. Then she decides to give him some

9

Page 10: Quizzes

information about their ages, saying "the product of their ages is 36". Heasks for more information and she gives in, saying "the sum of their agesis equal to our neighbors’ house number". The man jumps over the fence,inspects the house number, and the returns. "You need to give me anotherhint", he begs. "Alright", she says, "my oldest child plays the piano". Whatare the ages of the children?

17 Capturing a pirate ship[Howard Lederer sent me this problem.]

You’re on a government ship, looking for a pirate ship. You know thatthe pirate ship travels at a constant speed, and you know what that speedis. Your ship can travel twice as fast as the pirate ship. Moreover, you knowthat the pirate ship travels along a straight line, but you don’t know whatthat line is. It’s very foggy, so foggy that you see nothing. But then! All ofa sudden, and for just an instant, the fog clears enough to let you determinethe exact position of the pirate ship. Then, the fog closes in again and youremain (forever) in the thick fog. Although you were able to determine theposition of the pirate ship during that fog-free moment, you were not able todetermine its direction. How will you navigate your government ship so thatyou will capture the pirate ship?

18 3-person duel[I got this problem from Johannes Kinder, who said he heard it from hisbrother. I reformulated the setting.]

A particular basketball shootout game consists of a number of duels. Ineach duel, one player is the challenger. The challenger chooses another playerto challenge, and then gets one chance to shoot the hoop. If the player makesthe shot, the playing being challenged is out. If the player does not makethe shot, or if the player chooses to skip his turn, then the game continueswith the next duel. A player wins when only that player remains.

One day, this game is played by three players: A, B, and C. Their skilllevels vary considerably: player A makes every shot, player B has a 50%chance of making a shot, and player C has a 30% chance of making a shot.Because of the difference in skill levels, they decide to let C begin, then B,

10

Page 11: Quizzes

then A, and so on (skipping any player who is out of the game) until there isa winner. If everyone plays to win, what strategy should each player follow?

[For this follow-up question, it will be helpful to have a paper and pen–not because the calculations are hard, but because it helps in rememberingthe numbers.]

If A, B, and C follow their winning strategies (as determined above),which player has the highest chance of winning the game?

19 The genders of the neighboring family’schildren

[This problem was inspired by some basic probability questions mentionedin a lecture by Eric Hehner (and that can be formalized and solved by calcu-lation using this Probability Perspective), and some subsequent discussionswith him, Itay Neeman, Jim Woodcook, Ana Cavalcanti, and Leo Freitas.]

The house next door has some new neighbors. They have two children,but you don’t know what mix of boys and girls they are. One day, your wifetells you "At least one of the children is a girl". What is the probability thatboth are girls?

Your wife then tells you "The way I found out that at least one of thechildren is a girl is that I saw one of the children playing outside, and it wasa girl". Now, what is the probability that both are girls?

20 Finding a hermit[Claude Marché told me this puzzle. At first, it seems quite similar to "Catch-ing a spy" (below), but the solution is entirely unrelated.]

There are five holes arranged in a line. A hermit hides in one of them.Each night, the hermit moves to a different hole, either the neighboring holeon the left or the neighboring hole on the right. Once a day, you get toinspect one hole of your choice. How do you make sure you eventually findthe hermit?

11

Page 12: Quizzes

21 Witches at a coffee shop[I got this puzzle from Alex Pintilie.]

Two witches each makes a nightly visit to an all-night coffee shop. Eacharrives at a random time between 0:00 and 1:00. Each one of them stays forexactly 15 minutes. On any one given night, what is the probability that thewitches will meet at the coffee shop?

22 Lemmings on a ledge[Vladislav Shcherbina told me this problem.]

A ledge is 1 meter long. On it are N lemmings. Each lemming travelsalong the ledge at a constant speed of 1 meter/minute. A lemming continuesin the same direction until it either falls off the ledge or it collides withanother lemming. If two lemmings collide, they both immediately changetheir directions. Initially, the lemmings have arbitrary starting positionsand starting directions. What is the longest time that may elapse before alllemmings have fallen off the ledge?

[Michael Jackson suggested the following variation of the problem: Sup-pose the ledge is not horizontal, but is leaning. A lemming now travels upthe ledge at a speed of 1 meter/minute and travels down the ledge at a speedof 2 meters/minute. What is the longest time before all lemmings have fallenoff?]

23 Poisoned wine[I got this problem from Vladislav Shcherbina.]

You have 240 barrels of wine, one of which has been poisoned. Afterdrinking the poisoned wine, one dies within 24 hours. You have 5 slaveswhom you are willing to sacrifice in order to determine which barrel containsthe poisoned wine. How do you achieve this in 48 hours?

24 Dropping 9-terms from the harmonic se-ries

[Rajeev Joshi told me this problem.]

12

Page 13: Quizzes

The harmonic series–that is, 1/1 + 1/2 + 1/3 + 1/4 + ...–diverges. Thatis, the sum is not finite. This is in difference to, for example, a geometricseries–like ½0 + ½1 + ½2 + ½3 + ...–which converges, that is, has a finitesum.

Consider the harmonic series, but drop all terms whose denominator rep-resented in decimal contains a 9. For example, you’d drop terms like 1/9,1/19, 1/90, 1/992, 1/529110. Does the resulting series converge or diverge?

[More generally, you may consider representing the denominator in thebase of your choice and dropping terms that contain a certain digit of yourchoice.]

[Here is a follow-up question suggested by Gary Leavens.]Consider again the harmonic series, but drop a term only if the denomina-

tor represented in decimal contains two consecutive 9’s. For example, you’ddrop 1/99, 1/992, 1/299, but not 1/9 or 1/909. Does this series converge ordiverge? Finding a restaurant in a park

[Michael Jackson told me this problem, as a variation of a problem he gotfrom Koen Claessen.]

A park contains paths that intersect at various places. The intersectionsall have the properties that they are 3-way intersections and that, with oneexception, they are indistinguishable from each other. The one exception isan intersection where there is a restaurant. The restaurant is reachable fromeverywhere in the park. Your task is to find your way to the restaurant.

The park has strict littering regulations, so you are not allowed to modifythe paths or intersections (for example, you are not allowed to leave a notean intersection saying you have been there). However, you are allowed to dosome bookkeeping on a pad of paper that you bring with you at all times (inthe computer-science parlance, you are allowed some state). How can youfind the restaurant?

You may assume that once you enter an intersection, you can continue tothe left, continue to the right, or return to where you just came from.

[As an alternative puzzle, suppose you must continue through an inter-section, turning either left or right, but not turning around to exit the inter-section the way you just entered it.]

25 Opening boxes in a prison courtyard[I got this problem from Clark Barrett, who got it from Robert Nieuwenhuis.

13

Page 14: Quizzes

Just when you thought you had heard all variations of prisoners and boxes...]100 prisoners agree on a strategy before playing the following game: One

at a time (in some unspecified order), each of the prisoners is taken to acourtyard where there is a line of 100 boxes. The prisoner gets to makechoices to open 50 of the boxes. When a box is opened, it reveals the nameof a prisoner (the prisoners have distinct names). The names written in theboxes are in 1-to-1 correspondence with the prisoners; that is, each name isfound in exactly one box. If after opening 50 boxes, the prisoner has notfound his own name, the game is over and all the prisoners lose. But if theprisoner does find the box that contains his name among the 50 boxes heopens, then the prisoner is taken to the other side of the courtyard where hecannot communicate with the others, the boxes are once again closed, andthe next prisoner is brought out into the courtyard. If all prisoners make itto the other side of the courtyard, they win.

One possible strategy is for each prisoner to randomly select 50 boxesand open them. This gives the prisoners 1 chance out of 2100 to win–a slimchance, indeed. But the prisoners can do better, using a strategy that for arandom configuration of the boxes will give them a larger chance of winning.How good a strategy can you develop?

26 Frugal selection of weights to weigh a thing[Matthew Parkinson told me this problem, or a slight variation thereof.]

You are given a balance (that is, a weighing machine with two trays)and a positive integer N. You are then to request a number of weights. Youpick which denominations of weights you want and how many of each youwant. After you receive the weights you requested, you are given a thingwhose weight is an integer between 1 and N, inclusive. Using the balanceand the weights you requested, you must now determine the exact weight ofthe thing.

As a function of N, how few weights can you get by requesting? Initializingan array in constant time

[Unlike most problems on this page, this problem requires some computerscience knowledge. Many years ago, I read a solution to this problem in oneof Donald Knuth’s books (I think). The algorithm intrigued me and stuckin my mind.]

Consider the following array operations. Init(N,d) initializes an array of

14

Page 15: Quizzes

N elements so that each element has value d. Once Init has been called,the following two operations can be applied: For any i such that 0 <= i <N, Get(i) returns the array element at position i and Set(i,v) sets the arrayelement at position i to the value v.

Given any amount of memory you want, implement the three operationsso that each operation has an O(1) time complexity.

27 Translation error in a cookbook[This problem is a bit fuzzier than most on this page, just because I don’tknow for sure that the cookbook publisher made a translation error. But Ihope you’ll still enjoy the problem.]

Recently, I received a wonderful cookbook. In an appendix, it shows atable that converts oven temperatures between Celsius and Fahrenheit. (Sideremark: Approximate oven temperatures are actually really simple to convertin your head–just double the number of degrees Celsius to get the number ofdegrees Fahrenheit. For oven temperatures, this will be within 10 F of theexact answer.)

The table has a footnote that says "If your oven has a fan, reduce therecipe temperature by 68 F". I have a strong hunch that this footnote suffersfrom a translation error. How many degrees Fahrenheit should it have saidto reduce the temperature by? (No knowledge of convection ovens required.)

28 Making a square larger[I got this problem from Radu Grigore.]

You are given four points (on a Euclidian plane) that make up the cornersof a square. You may change the positions of the points by a sequence ofmoves. Each move changes the position of one point, say p, to a new location,say p’, by "skipping over" one of the other 3 points. More precisely, p skipsover a point q if it is moved to the diametrically opposed side of q. In otherwords, a move from p to p’ is allowed if there exists a point q such that q =(p + p’) / 2.

Find a sequence of moves that results in a larger square. Or, if no suchsequence is possible, give a proof of why it isn’t possible. (The new squareneed not be oriented the same way as the original square. For example, the

15

Page 16: Quizzes

larger square may be turned 45 degrees from the original, and the largersquare may have the points in a different order from in the original square.)

29 Catching a spy[I got this problem from Radu Grigore.]

A spy is located on a one-dimensional line. At time 0, the spy is atlocation A. With each time interval, the spy moves B units to the right (ifB is negative, the spy is moving left). A and B are fixed integers, but theyare unknown to you. You are to catch the spy. The means by which youcan attempt to do that is: at each time interval (starting at time 0), you canchoose a location on the line and ask whether or not the spy is currently atthat location. That is, you will ask a question like "Is the spy currently atlocation 27?" and you will get a yes/no answer. Devise an algorithm thatwill eventually find the spy.

30 Average clan size[I got this problem from Ernie Cohen, who I think had made it up. ItayNeeman suggested the use of "clans" instead of Ernie’s original "families",because "clans" has a stronger connotation of the groups being disjoint.]

The people in a country are partitioned into clans. In order to estimatethe average size of a clan, a survey is conducted where 1000 randomly selectedpeople are asked to state the size of the clan to which they belong. How doesone compute an estimate average clan size from the data collected?

31 Colored balls in boxes[I got this little problem from Leonardo de Moura.]

There are three boxes, one containing two black balls, another containingtwo white balls, and another containing one black and one white ball. Youselect a random ball from a random box and you find you selected a whiteball. What is the probability that the other ball in the same box is alsowhite?

16

Page 17: Quizzes

32 Mixed up airplane seats[I got this problem from Rajeev Joshi, who I think said he heard it from JayMisra.]

An airplane has 50 seats, and its 50 passengers have their own assignedseats. The first person to enter the plane ignores his seat assignment andinstead picks a seat on random. Each subsequent person to enter the planetakes her assigned seat, if available, and otherwise chooses a seat on random.What is the probability that the last passenger gets to sit in her assignedseat?

33 Multiples in the Fibonacci series[Carroll Morgan told me this puzzle.]

Prove that for any positive K, every Kth number in the Fibonacci se-quence is a multiple of the Kth number in the Fibonacci sequence.

More formally, for any natural number n, let F(n) denote Fibonacci num-ber n. That is, F(0) = 0, F(1) = 1, and F(n+2) = F(n+1) + F(n). Provethat for any positive K and natural n, F(n*K) is a multiple of F(K).

34 Coins in a line[Rajeev Joshi told me this problem. He got it from Jay Misra.]

Consider a game that you play against an opponent. In front of you arean even number of coins of possibly different denominations. The coins arearranged in a line. You and your opponent take turns selecting coins. Eachplayer takes one coin per turn and must take it from an end of the line,that is, the current leftmost coin or the current rightmost coin. When allcoins have been removed, add the value of the coins collected by each player.It is possible that you and your opponent end up with the same value (forexample, if all coins have the same denomination). Develop a strategy whereyou take the first turn and where your final value is at least that of youropponent (that is, don’t let your opponent end up with coins worth morethan your coins).

17

Page 18: Quizzes

35 Determining the number of one hat[This problem was told to me by Clark Barrett, who got it from his father.It may sound reminiscent of the Three hat colors problem, but it’s differentin many ways.]

N people team up and decide on a strategy for playing this game. Thenthey walk into a room. On entry to the room, each person is given a hat onwhich one of the first N natural numbers is written. There may be duplicatehat numbers. For example, for N=3, the 3 team members may get hatslabeled 2, 0, 2. Each person can see the numbers written on the others’ hats,but does not know the number written on his own hat. Every person thensimultaneously guesses the number of his own hat. What strategy can theteam follow to make sure that at least one person on the team guesses hishat number correctly?

36 Voting on how to distribute coins[This problem was communicated to me by Sophia Drossopoulou.]

100 coins are to be distributed among some number of persons, referred toby the labels A, B, C, D, .... The distribution works as follows. The personwith the alphabetically highest label (for example, among 5 people, E) iscalled the chief. The chief gets to propose a distribution of the coins amongthe persons (for example, chief E may propose that everyone get 20 coins, orhe may propose that he get 100 coins and the others get 0 coins). Everyone(including the chief) gets to vote yes/no on the proposed distribution. If themajority vote is yes, then that’s the final distribution. If there’s a tie (whichthere could be if the number of persons is even), then the chief gets to breakthe tie. If the majority vote is no, then the chief gets 0 coins and has to leavethe game, the person with the alphabetically next-highest name becomes thenew chief, and the process to distribute the 100 coins is repeated among thepersons that remain. Suppose there are 5 persons and that every personwants to maximize the number of coins that are distributed to them. Then,what distribution should chief E propose?

[This problem and its solution caused my niece Sarah Brown to send methe following article from The Economist, which considers a human aspectof situations like these.]

18

Page 19: Quizzes

37 Subsequence of coin tosses[I got this problem from Joe Morris, who created it.]

Each of two players picks a different sequence of two coin tosses. That is,each player gets to pick among HH, HT, TH, and TT. Then, a coin is flippedrepeatedly and the first player to see his sequence appear wins. For example,if one player picks HH, the other picks TT, and the coin produces a sequencethat starts H, T, H, T, T, then the player who picked TT wins. The coin isbiased, with H having a 2/3 probability and T having a 1/3 probability. Ifyou played this game, would you want to pick your sequence first or second?

38 Children and light switches[I got this problem from Mariela Pavlova.]

A room has 100 light switches, numbered by the positive integers 1through 100. There are also 100 children, numbered by the positive inte-gers 1 through 100. Initially, the switches are all off. Each child k enters theroom and changes the position of every light switch n such that n is a mul-tiple of k. That is, child 1 changes all the switches, child 2 changes switches2, 4, 6, 8, . . . , child 3 changes switches 3, 6, 9, 12, . . . , etc., and child 100changes only light switch 100. When all the children have gone through theroom, how many of the light switches are on?

39 Finding a counterfeit coin[Ernie Cohen sent me this puzzle, and I also heard it from a student who gotit from Ernie at Marktoberdorf.]

You have 12 coins, 11 of which are the same weight and one counterfeitcoin which has a different weight from the others. You have a balance that ineach weighing tells you whether the two sides are of equal weight, or whichside weighs more. How many weighings do you need to determine: which isthe counterfeit coin, and whether it weighs more or less than the other coins.How?

19

Page 20: Quizzes

40 Cutting cheese[I got this problem many years ago, likely from Jan van de Snepscheut.]

You’re given a 3x3x3 cube of cheese and a knife. How many straight cutswith the knife do you need in order to divide the cheese up into 27 1x1x1cubes?

41 Fair soccer championship[I got this question from Sergei Vorobyov.]

The games played in the soccer world championship form a binary tree,where only the winner of each game moves up the tree (ignoring the initialgames, where the teams are placed into groups of 4, 2 of which of which goonto play in the tree of games I just described). Assuming that the teamscan be totally ordered in terms of how good they are, the winner of thechampionship will indeed be the best of all of the teams. However, the secondbest team does not necessarily get a second place in the championship. Howmany additional games need to be played in order to determine the secondbest team?

42 Path on the surface of the Earth[I must have heard this problem ages ago, but as I remembered it, one wasalways satisfied after finding just one solution. It was a math professor atthe Kaiserslautern Technical University who brought asking for all solutionsto my attention.]

Initially, you’re somewhere on the surface of the Earth. You travel onekilometer South, then one kilometer East, then one kilometer North. Youthen find yourself back at the initial position. Describe all initial locationsfrom which this is possible.

43 Random point in a circle[I heard this nice problem from Sumit Gulwani.]

You’re given a procedure that with a uniform probability distributionoutputs random numbers between 0 and 1 (to some sufficiently high degree

20

Page 21: Quizzes

of precision, with which we need not concern ourselves in this puzzle). Usinga bounded number of calls to this procedure, construct a procedure that witha uniform probability distribution outputs a random point within the unitcircle.

44 Mixing vinegar and oil[I read this problem in a puzzle book I have.]

You have two jars. One contains vinegar, the other oil. The two jarscontain the same amount of their respective fluid.

Take a spoonful of the vinegar and transfer it to the jar of oil. Then,take a spoonful of liquid from the oil jar and transfer it to the vinegar jar.Stir. Now, how does the dilution of vinegar in the vinegar jar compare tothe dilution of oil in the oil jar?

45 Psycho killer[I got this problem from Carroll Morgan.]

A building has 16 rooms, arranged in a 4x4 grid. There is a door betweenevery pair of adjacent rooms ("adjacent" meaning north, south, west, andeast, but no diagonals). Only the room in the northeast corner has a doorthat leads out of the building.

In the initial configuration, there is one person in each room. The personin the southwest corner is a psycho killer. The psycho killer has the followingtraits: If he enters a room where there is another person, he immediatelykills that person . But he also cannot stand the site of blood, so he will notenter any room where there is a dead person.

As it happened, from that initial configuration, the psycho killer managedto get out of the building after killing all the other 15 people. What pathdid he take?

46 A special squarish age[Chuck Chan created this little puzzle. Greg Nelson suggested introducingthe name "squarish" in order to simplify the problem statement.]

21

Page 22: Quizzes

Let’s say that a number is squarish if it is the product of two consecutivenumbers. For example, 6 is squarish, because it is 2*3.

A friend of mine at Microsoft recently had a birthday. He said his ageis now squarish. Moreover, since the previous time his age was a squarishnumber, a squarish number of years has passed. How many years would hehave to wait until his age would have this property again?

47 Passing alternating numbers of coins around[This problem appears as a sample question on the web page for the Putnamexam.]

A game is played as follows. N people are sitting around a table, eachwith one penny. One person begins the game, takes one of his pennies (atthis time, he happens to have exactly one penny) and passes it to the personto his left. That second person then takes two pennies and passes them tothe next person on the left. The third person passes one penny, the fourthpasses two, and so on, alternating passing one and two pennies to the nextperson. Whenever a person runs out of pennies, he is out of the game andhas to leave the table. The game then continues with the remaining people.

A game is terminating if and only if it ends with just one person sittingat the table (holding all N pennies). Show that there exists an infinite set ofnumbers for which the game is terminating.

48 The exact batting average[I heard this problem from Bertrand Meyer, who had heard it was once givenon the Putnam exam.]

At some point during a baseball season, a player has a batting averageof less than 80%. Later during the season, his average exceeds 80%. Provethat at some point, his batting average was exactly 80%.

Also, for which numbers other than 80% does this property hold?

49 Summing pairs of numbers to primes[I got this problem from Jay Misra, who got it from Gerard Huet.]

22

Page 23: Quizzes

For any even number N, partition the integers from 1 to N into pairs suchthat the sum of the two numbers in each pair is a prime number.

Hint: Chebyshev proved that the following property (Bertrand’s Postu-late) holds: for any k > 1, there exists a prime number p in the range k < p< 2*k.

Right triangle with a 23[Madan Musuvathi asked me this question.]

Find two positive integers that together with 23 are the lengths of a righttriangle.

[Madan first told me 17, which I could solve right away, because I hadjust finished reading Mark Haddon’s novel The curious incident of the dogin the night-time, which toward the end mentions that a triangle with sidesn2+1, n2-1, and 2*n, where n>1, is a right triangle. Madan then asked meabout 23.]

[A follow-up question.]There’s a simple technique that, given any odd positive integer, allows

you to figure out the other two integer sides of a right triangle in your head(or with pen and paper if the numbers get too large). Find this technique.

Hint: Think of every number as a multiset of prime factors, so thatmultiplying the prime factors gives you the number. Move one of the addendsof the Pythagorean Theorem to the other side and factor it (a technique Irecently learned from Raymond Boute).

50 The worm and the rubber band[Jay Misra told me this problem.]

A rubber band (well, a rubber string, really) is 10 meters long. There’s aworm that starts at one end and crawls toward the other end, at a speed of1 meter per hour. After each hour that passes, the rubber string is stretchedso as to become 1 meter longer than it just was. Will the worm ever reachthe other end of the string?

23

Page 24: Quizzes

51 Placing coins on a table[I got this problem from Amit Rao.]

Two players are playing a game. The game board is a circular table. Theplayers have access to an ample supply of equal-sized circular coins. Theplayers alternate turns, with each turn adding a single coin to the table. Thecoins are not allowed to overlap. Once a coin is placed on the table, it isnot allowed to be moved. The player who has no place to put his next coinloses. Develop a winning strategy for the player who starts. (The table islarge enough to accommodate at least one coin.)

52 Determining a hidden digit[I got this problem from Olean Brown, who had pointed me to the followingweb page that claims to read your mind.]

Think of a positive integer, call it X. Shuffle the decimal digits of X, callthe resulting number Y. Subtract the smaller of X,Y from the larger, call thedifference D. D has the following property: Any non-zero decimal digit of Dcan be determined from the remaining digits. That is, if you ask someone tohide any one of the non-zero digits in the decimal representation of D, thenyou can try to impress the other person by figuring out the hidden digit fromthe remaining digits. How is this done? Why does it work?

53 Boris and Natasha[I got this problem from Todd Proebsting.]

Boris and Natasha live in different cities in a country with a corrupt postalservice. Every box sent by mail is opened by the postal service, the contentsstolen, and the box never delivered. Except: if the box is locked, then thepostal service won’t bother trying to open it (since there are so many otherboxes whose contents are so much easier to steal) and the box is deliveredunharmed.

Boris and Natasha each has a large supply of boxes of different sizes,each capable of being locked by padlocks. Also, Boris and Natasha each hasa large supply of padlocks with matching keys. The padlocks have uniquekeys. Finally, Boris has a ring that he would like to send to Natasha. How

24

Page 25: Quizzes

can Boris send the ring to Natasha so that she can wear it (without eitherof them destroying any locks or boxes)?

54 Burning ropes to measure time[I first got this problem from Ernie Cohen. Apparently, it has appeared as aCar Talk Puzzler, but I’ve been unable to find it on their web site.]

Warm-up: You are given a box of matches and a piece of rope. The ropeburns at the rate of one rope per hour, but it may not burn uniformly. Forexample, if you light the rope at one end, it will take exactly 60 minutesbefore the entire rope has burnt up, but it may be that the first 1/10 ofthe rope takes 50 minutes to burn and that the remaining 9/10 of the ropetakes only 10 minutes to burn. How can you measure a period of exactly30 minutes? You can choose the starting time. More precisely, given thematches and the rope, you are to say the words "start" and "done" exactly30 minutes apart.

The actual problem: Given a box of matches and two such ropes, notnecessarily identical, measure a period of 15 minutes.

55 Flipping cards[I have heard several versions of this problem. I first heard it from BertrandMeyer, who got the problem from Yuri Gurevich.]

You’re given a regular deck of 52 playing cards. In the pile you’re given,13 cards face up and the rest face down. You are to separate the given cardsinto two piles, such that the number of face-up cards in each pile is the same.In separating the cards, you’re allowed to flip cards over. The catch: youhave to do this in a dark room where you cannot determine whether a cardis face up or face down.

56 Three hat colors[I think I got this puzzle from Lyle Ramshaw, who I think got it from somecollection of problems or maybe the American Mathematical Monthly.]

A team of three people decide on a strategy for playing the followinggame. Each player walks into a room. On the way in, a fair coin is tossed

25

Page 26: Quizzes

for each player, deciding that player’s hat color, either red or blue. Eachplayer can see the hat colors of the other two players, but cannot see herown hat color. After inspecting each other’s hat colors, each player decideson a response, one of: "I have a red hat", "I had a blue hat", or "I pass". Theresponses are recorded, but the responses are not shared until every playerhas recorded her response. The team wins if at least one player respondswith a color and every color response correctly describes the hat color of theplayer making the response. In other words, the team loses if either everyoneresponds with "I pass" or someone responds with a color that is different fromher hat color.

What strategy should one use to maximize the team’s expected chanceof winning?

For example, one possible strategy is to single out one of the three players.This player will respond "I have a red hat" and the others will respond "Ipass". The expected chance of winning with this strategy is 50%. Can youdo better? Provide a better strategy or prove that no better strategy exists.

[Here’s a related problem, which I got from Jim Saxe.]In this variation, the responses are different. Instead of "red", "blue",

"pass", a response is now an integer, indicating a bet on having the hat colorred. Once the responses have been collected, the team’s score is calculatedas follows: Add the integer responses for those players wearing red hats,and subtract from that the integers of those players wearing blue hats. Forexample, if the three players respond with 12, -2, -100 while wearing blue,red, blue, respectively, then the team’s score is (-2) - (12) - (-100) = 90. Theteam wins if and only if its score is strictly positive.

For example, any strategy used in the first game can be used with thissecond game by replacing "I have a red hat" with 1, "I have a blue hat" with-1, and "I pass with 0". Such a strategy wins anytime the strategy wouldhave produced a win in the first game; plus, this strategy may win in somecases where the strategy would not produce a win in the first game. Forexample, for hat colors red, red, red, the strategy "red", "red", "blue" loses inthe first game, whereas 1, 1, -1 still wins in the second game. Hence, playingthis second game can only increase the team’s expected chance of winning.

[Further generalizations.]Of course, you can generalize these two problems from 3 players to N

players. The solution to the first problem with N players may require moremathematical sophistication than the solution to the second problem with Nplayers.

26

Page 27: Quizzes

57 The line of persons with hats[Ernie Cohen told me this problem.]

100 persons are standing in line, each facing the same way. Each personis wearing a hat, either red or blue, but the hat color is not known to theperson wearing the hat. In fact, a person knows the hat color only of thosepersons standing ahead of him in line.

Starting from the back of the line (that is, with the person who can seethe hat colors of all of other 99 persons), in order, and ending with the personat the head of the line (that is, with the person who can see the hat colorof no one), each person exclaims either "red" or "blue". These exclamationscan be heard by all. Once everyone has spoken, a score is calculated, equalto the number of persons whose exclamation accurately describes their ownhat color.

What strategy should the 100 persons use in order to get as high a scoreas possible, regardless of how the hat colors are assigned? (That is, whatstrategy achieves the best worst-case score?)

For example, if everyone exclaims "red", the worst-case score is 0. If thefirst 99 persons exclaim the color of the hat of the person at the head of theline and the person at the head of the line then exclaims the color he hasheard, the worst-case score is 1. If every other person exclaims the hat colorof the person immediate in front and that person then repeats the color hehas just heard, then the worst-case score is 50. Can you do better?

[Here’s a generalization of the problem.]Instead of using just red and blue as the possible hat colors and exclama-

tions, use N different colors.

58 The prisoners and the switch[Tom Ball told me (a close variation of) this problem. The problem has beenfeatured as a Car Talk Puzzler under the name Prison Switcharoo (beware:the Car Talk problem page also contains an answer).]

N prisoners get together to decide on a strategy. Then, each prisoner istaken to his own isolated cell. A prison guard goes to a cell and takes itsprisoner to a room where there is a switch. The switch can either be up ordown. The prisoner is allowed to inspect the state of the switch and thenhas the option of flicking the switch. The prisoner is then taken back to

27

Page 28: Quizzes

his cell. The prison guard repeats this process infinitely often, each timechoosing fairly among the prisoners. That is, the prison guard will chooseeach prisoner infinitely often.

At any time, any prisoner can exclaim "Now, every prisoner has beenin the room with the switch". If, at that time, the statement is correct,all prisoners are set free; if the statement is not correct, all prisoners areimmediately executed. What strategy should the prisoners use to ensuretheir eventual freedom?

(Just in case there’s any confusion: The initial state of the switch isunknown to the prisoners. The state of the switch is changed only by theprisoners.)

As a warm-up, you may consider the same problem but with a knowninitial state of the switch.

59 Table with four coins[This problem has crossed the desk of Jan van de Snepscheut, but it mayhave been due to someone else.]

A square table has a coin at each corner. Design an execution sequence,each of whose steps consists of one of the following operations:

ONE: The operation chooses a coin (possibly a different one with eachexecution of the operation) and flips it. SIDE: The operation chooses a sideof the table and flips the two coins along that side. DIAG: The operationchooses a diagonal of the table and flips the two coins along that diagonal.

such that at some point during the execution (not necessarily at the end),a state where all coins are turned the same way (all heads or all tails) obtains.

60 Stabilizing nodes from an anchor[I got this problem from Jay Misra, who had received it from Edsger Dijkstra.This particular description of the problem borrows from a description givenby Michael Jackson.]

In a finite, undirected, connected graph, an integer variable v(n) is as-sociated with each node n. One node is distinguished as the anchor. Anoperation OP(n) is defined on nodes:

28

Page 29: Quizzes

OP(n): if node n is the anchor, then do nothing, else set v(n) to the value1 + min{v(m)}, where m ranges over all neighbors of n that are distinct fromn.

An infinite sequence of operations <OP(n),OP(m), ...> is executed, thenode arguments n, m, ... for the operations being chosen arbitrarily and notnecessarily fairly. Show that eventually all v(n) stabilize. That is, that aftersome finite prefix of the infinite sequence of operations, no further operationchanges v(n) for any node n.

61 Points on a circle[This problem was told to me by Dave Detlefs, who got it from the followingimpressive collection of math problems.]

Given N points randomly distributed around the circumference of a circle,what is the probability that all N points lie on the same semi-circle?

62 The electrician problem[I learned about this problem from Greg Nelson, who phrased the problemin terms of a tall building and elevator rides. Here, I instead say a mountainand helicopter rides, which is the way Lyle Ramshaw had heard the problemand which more forcefully emphasizes the price of each ride. As a computerscientist, I like this problem a lot, because of the variety of solutions ofdifferent computational complexities.]

You’re an electrician working at a mountain. There are N wires runningfrom one side of the mountain to the other. The problem is that the wiresare not labeled, so you just see N wire ends on each side of the mountain.Your job is to match these ends (say, by labeling the two ends of each wirein the same way).

In order to figure out the matching, you can twist together wire ends,thus electrically connecting the wires. You can twist as many wire ends asyou want, into as many clusters as you want, at the side of the mountainwhere you happen to be at the time. You can also untwist the wire ends atthe side of the mountain where you’re at. You are equipped with an Ohmmeter, which lets you test the connectivity of any pair of wires. (Actually, it’san abstract Ohm meter, in that it only tells you whether or not two things

29

Page 30: Quizzes

are connected, not the exact resistance.)You are not charged [no pun intended] for twisting, untwisting, and using

the Ohm meter. You are only charged for each helicopter ride you make fromone side of the mountain to the other. What is the best way to match thewires? (Oh, N>2, for there is no solution when N=2.)

63 The hidden card[I learned about this problem from Lyle Ramshaw. See also puzzles 19 and20 on the following large collection of mathematical puzzles.]

In this problem, you and a partner are to come up with a scheme forcommunicating the value of a hidden card. The game is played as follows:

Your partner is sent out of the room. A dealer hands you 5 cards from astandard 52 card deck. You look at the cards, and hand them back to thedealer, one by one, in whatever order you choose. The dealer takes the firstcard that you hand her and places it, face up, in a spot labeled "0"’. The nextthree cards that you hand her, she places, similarly, in spots labeled "1", "2",and "3". The last card that you hand her goes, face down, in a spot labeled"hidden". (While you control the order of the cards, you have no controlover their orientations, sitting in their spots; so you can’t use orientation totransmit information to your partner.) Your partner enters the room, looksat the four face-up cards and the spots in which they lie and, from thatinformation (and your previously-agreed-upon game plan), determines thesuit and value of the hidden card.

Question: What is the foolproof scheme that you and your partner settledon ahead of time?

As a follow-up question, consider the same problem but with a 124-carddeck. Knight, knave, commoner

[Communicated to me by Carroll Morgan.]A king has a daughter and wants to choose the man she will marry. There

are three suitors from whom to choose, a Knight, a Knave, and a Commoner.The king wants to avoid choosing the Commoner as the bridegroom, but hedoes not know which man is which. All the king knows is that the Knightalways speaks the truth, the Knave always lies, and the Commoner can doeither. The king will ask each man one yes/no question, and will then choosewho gets to marry the princess. What question should the king ask and howshould he choose the bridegroom?

30

Page 31: Quizzes

[A follow-up question posed by Lyle Ramshaw.]Suppose the three suitors know each other (an assumption that’s not

needed in the original problem). Then find a new strategy for the king wherethe king only needs to ask a question of any two of the three suitors in orderto pick the bridegroom.

[Another variation of the problem.]Find a strategy for the king where the king can ask questions of only one

suitor, but can ask two questions of that suitor.[And another (at first sight incredible) follow-up question communicated

to me by both Jim Saxe and Pierre Nallet.]Find a strategy for the king where the king can ask only one yes/no

question and only of one suitor. Back to the homepage of Rustan Leino.

31


Recommended