Cabbages, Cheating Husbands, and a Zebra

LOGIC PROBLEMS

image

Logic. It’s a logical place to start: Logical deduction is the ground rule of all mathematical puzzles. Indeed, logic is the foundation of all mathematics. In the nomenclature of puzzledom, however, “logic problems” are brainteasers that employ deductive reasoning alone—shunning, for example, any type of arithmetical calculation, algebraic manipulation, or sketching of shapes on the backs of envelopes. They are the most accessible type of mathematical conundrum because they require no technical knowledge, and the questions easily lend themselves to humorous phrasing. But, as we shall see, they are not always the easiest to solve, since they twist our brains in unfamiliar ways.

Which they have been doing since at least the time of Charlemagne, King of the Franks.

In 799 CE, Charlemagne, who ruled over much of Western Europe, received a letter from his old teacher, Alcuin: “I have sent you,” it read, “some arithmetical curiosities to amuse you.”

Alcuin was the greatest scholar of his era. He grew up in York, attending and then running the city’s cathedral school, the best educational establishment in the country. The Englishman’s reputation reached Charlemagne. The king persuaded him to run his palace school in Aachen, where Alcuin founded a large library and went on to reform education across the Carolingian empire. Alcuin eventually left Charlemagne’s court to become Abbot of Tours, which is when he wrote the above letter to his former boss.

Alcuin is credited by some with inventing cursive writing so he and his many scribes could write faster. Some believe that he was also the first person to use a symbol—a diagonal squiggle—as punctuation for a question. It is wonderfully appropriate that the predominant early figure in the history of puzzles was also a progenitor of the question mark.

The physical document that Alcuin was referring to in his letter to Charlemagne no longer exists, but historians believe that it was a list of fifty or so problems called Propositiones ad Acuendos Juvenes, or Problems to Sharpen the Young, of which the earliest surviving manuscript dates from a century later. Who else, they argue, could have written it but Alcuin, the foremost teacher of his day?

Propositiones is a remarkable document. It is the largest cache of puzzles from medieval times, as well as the first Latin text that contains original mathematical material. (The Romans may have built roads, aqueducts, public baths, and sanitation systems, but they never did any mathematics.) It begins in thigh-slapping tone:

A swallow invites a snail for lunch a league away. If the snail travels an inch a day, how long will it take him?

The answer is 246 years and 210 days. He would have died more than two centuries before he got there.

Another one asks:

A certain man met some students and asked them: “How many of you are there in your school?” One of the students replied: “I don’t want to tell you directly but I’ll tell you how to work it out. You double the number of students, then triple that number, then divide that number into four parts. If you add me to one of the quarters, there will be 100.” How many students are there in the school?

Pesky kids! I’ll leave this one for you to solve on your own.

Alcuin’s whimsical phrasing was groundbreaking. It was the first time humor had been used to pique students’ interest in arithmetic. Yet Propositiones was important not just because of its stylistic innovations, but also because it included several new types of problem. Some of them required deductive reasoning but no calculation. The best known of Alcuin’s puzzles is arguably the most famous mathematical riddle of all time.

1

WOLF, GOAT, AND CABBAGES

A man arrives at a riverbank with a wolf, a goat, and a bunch of cabbages. He needs to cross the river, but the one boat available can carry only him and a single item at the same time. He cannot leave the wolf alone with the goat or the goat alone with the cabbages, since in both cases the former will eat the latter.

How does he cross the river in the shortest number of crossings?

It’s a blinder for two reasons. For a start, the scene is comical. You’ve spent all morning trudging down a dirt path, desperately trying to keep the wolf away from the goat, and the goat away from the cabbages. Now your day just got worse: You have to cross a river in a stupidly tiny boat. Yet what I find most amusing and interesting about the scenario is its solution, which forces our hero to behave in a way you would not intuitively expect.

Have a go. All five-year-old children can solve it, declared one thirteenth-century text. No pressure.

Or follow the reasoning with me.

Let’s place the traveler on the left bank. He begins with three items and can only take one of them in the boat. If he takes the wolf, the goat will be left with the cabbages and eat them. If he takes the cabbages, the wolf will eat the goat. By a process of elimination, the only item he can take on the first crossing is the goat, since wolves don’t eat cabbages. He delivers the goat to the right bank and returns for the next item.

image

Now he has a choice of wolf or cabbages. Let’s say he decides to take the cabbages. He crosses the river for the third time. When he reaches the right bank he cannot leave the cabbages with the goat, so what does he do? He makes no progress if he returns with the cabbages, since he only just arrived with them, so he must return with the goat. This step is the counter­intuitive one: In order for the traveler to get everything across he needs to take something across, back, and across again.

image

Back on the left bank, after four crossings, with the wolf and the goat, the traveler chains the goat and departs for his fifth traverse with the wolf. On the right bank the wolf remains uninterested in the cabbages. All that is left is one trip back to pick up the bearded bovid, and our chap is done, in seven crossings.

image

(There’s a second, equivalent, solution: If he took the wolf on the second crossing, the same logic follows and he also finishes the job in seven trips.)

Propositiones also contains other river-crossing puzzles, such as this one, which sounds like the plot of a bedroom farce.

2

THREE FRIENDS AND THEIR SISTERS

So there were three of us men who each had a sister, and we all had to get across a river. But each of us lusted after one of the others’ sisters. On coming to the river all we found was a little ferry boat that could only carry two people at a time. Say if you can how we crossed the river so that none of our sisters was dishonored by being alone in a boat with a man who was not her brother.

You can interpret this problem in two ways, since Alcuin’s phrasing is ambiguous. What’s not in dispute is that there are three pairs, each consisting of a brother and a sister, who must all cross the river, and all that they have at their disposal is a two-person boat. But there could be either of two restrictions: [1] That a boat can never contain a woman and a man who are not related. In this case the entire party can reach the other side in nine crossings. [2] That a woman is forbidden from being in the boat unaccompanied by her brother when the boat is dropping off or collecting passengers at a bank where there are other men. The second scenario, I think, is more in the spirit of the question, and the mission requires eleven crossings. Try to find both solutions.

River-crossing puzzles have delighted children and adults for more than a thousand years. As they have spread across the world, they have changed to reflect local concerns. In Algeria, the wolf, goat, and cabbages are a jackal, a goat, and a bundle of hay; in Liberia they are a cheetah, a fowl, and some rice; and in Zanzibar they are a leopard, a goat, and some leaves. The puzzle of the three friends and their sisters has also evolved throughout the ages: The lecherous men soon became jealous husbands forbidding their wives to travel in the boat with another man. In one thirteenth-century retelling the couples have names: Bertoldus and Berta, Gherardus and Greta, and Rolandus and Rosa. The solution is presented as two hexameters. If you can read Latin, look away now:

Binae, sola, duae, mulier, duo, vir mulierque,
Bini, sola, duae, solus, vir cum muliere.

By the seventeenth century the couples were masters and valets. Each master forbade his valet to travel with another master in case that master murdered him. The social warfare was reversed in the nineteenth century: The couples became masters and servants, and servants were forbidden to outnumber masters on any one side in case they were tempted to rob their bosses. Then xenophobia replaced the sexism and class war: The classic version became a traveling party of three missionaries and three hungry cannibals. You learn as much about the evolution of social stereotypes from this puzzle as you do about mathematics.

The following river-crossing puzzle emerged in the 1980s. By the turn of the century it was being used by Microsoft as one of its notoriously tricky interview questions to test the problem-solving skills of prospective employees. The key here is to let your logical brain overrule your gut instinct.

3

CROSSING THE BRIDGE
(WITH A LITTLE HELP FROM MY FRIENDS)

Four people—John, Paul, George, and Ringo—are at one side of a gorge connected to the other by a rickety bridge that can only carry two people at a time. It is night time, and the structure is precarious, so whoever is crossing must use a flashlight. The group has a single flashlight, and the gorge is too wide for them to be able to throw it from one side to the other, so the flashlight must be walked back and forth over the bridge as the people cross. John can cross the bridge in 1 minute, Paul in 2, George in 5, and Ringo in 10. If two people cross together, they walk at the speed of the slowest of the two.

How does the foursome get over in the quickest possible time?

The obvious way to solve this problem is for John to accompany each friend one by one, since he can return fastest to pick up the next person. This strategy gets everyone over in 2 + 1 + 5 + 1 + 10 = 19 minutes. But is there a faster way?

Back to Alcuin, and a question from Propositiones:

How many footprints are left in the last furrow by an ox that has been plowing all day?

None, of course! The plow will have destroyed them all. It’s the earliest trick question in puzzle literature.

Among the other types of puzzle that debuted in Propositiones is the “kinship riddle,” in which you have to find the relationships in unconventional families. It’s my final pick from the old Yorker, before we fast-forward a thousand years.

4

THE DOUBLE DATE

If two men each take the other’s mother in marriage, what would be the relationship between their sons?

I find kinship riddles hugely entertaining. No matter how straight-faced and logical I try to remain when solving them, I cannot help but speculate about the bizarro-weird backstories.

This type of puzzle has been a staple since medieval times and was much enjoyed by the Victorians, who perhaps found the suggestion of subversion in traditional family structures especially titillating.

Lewis Carroll was a fan. The next problem is taken from one of the chapters—or “knots,” as he called them—of his 1885 book A Tangled Tale. I consider it the apogee of the genre.

5

THE DINNER PARTY image

The Governor of—Whatchamacallit—wants to give a very small dinner party, and he means to ask his father’s brother-in-law, his brother’s father-in-law, his father-in-law’s brother, and his brother-in-law’s father: and we’re to guess how many guests there will be.

How many guests are there, if the dinner party is to be as small as possible?

Through his novels Alice’s Adventures in Wonderland and Through the Looking-Glass, Carroll is probably the writer who has done most to popularize the fun to be had with logic. Both stories are full of paradoxes, games, and philosophical riddles. Carroll, the pen name of Charles Lutwidge Dodgson, a math professor at Oxford, also wrote three books of mathematical puzzles. None had anything like the success of the Alice books, partly because the math was too difficult.

Carroll was, however, one of the first to devise puzzles based on truth-tellers and liars, a type of logical conundrum that would later become popular. He noticed that if different people are accusing each other of being liars then it may be possible to deduce who is telling the truth. “I have worked out in the last few days some curious problems on the plan of ‘lying’ dilemma,” he wrote in his diary in 1894, mentioning the following puzzle, rephrased here with familiar characters. The puzzle was printed as an anonymous pamphlet later that year.

6

LIARS, LIARS

Berta says that Greta tells lies.

Greta says that Rosa tells lies.

Rosa says that both Berta and Greta tell lies.

Who is telling the truth?

We’ll return to truth-tellers and liars shortly.

But before we get there, can you solve the logic puzzle that went viral in the early 1930s?

7

SMITH, JONES, AND ROBINSON

Smith, Jones, and Robinson are the driver, fireman, and guard on a train, but not necessarily in that order. The train carries three passengers, coincidentally with the same surnames, but identified with a “Mr.”: Mr. Jones, Mr. Smith, and Mr. Robinson.

Mr. Robinson lives in Leeds.

The guard lives halfway between Leeds and Sheffield.

Mr. Jones’s salary is £1,000 2s. 1d. per year.

Smith can beat the fireman at billiards.

The guard’s nearest neighbor (one of the passengers) earns exactly three times as much as the guard.

The guard’s namesake lives in Sheffield.

What is the name of the engine driver?

(I have kept the original phrasing of the puzzle, which uses the old British currency. The importance of the value £1,000 2s. 1d., or one thousand pounds, two shillings, and one pence, is that you cannot divide it by three to produce an exact amount.)

I love this puzzle. It invites you to become a detective. On first reading it looks like there is far too little information to find the answer. But slowly, piecing together the clues, you will uncover the correct identities.

Not long after Smith, Jones, and Robinson appeared in The Strand Magazine, a London literary journal, in April 1930, it became a British craze, reprinted in newspapers up and down the country. It spread around the world, and by 1932 the New York Times was reporting on the puzzle’s popularity, presenting an Americanized version, with Leeds and Sheffield swapped for Detroit and Chicago.

The most straightforward way to solve the puzzle is to draw two grids. I’ll start you off. We need to find which of Smith, Jones, and Robinson are the driver, fireman, and guard, so draw one grid, as shown below left, that contains the names of the workers and the professions. The question also involves three passengers and three locations. So draw a second grid, shown below right, that has Mr. Smith, Mr. Jones, and Mr. Robinson, against Leeds, Sheffield, and halfway between.

image

Our first piece of solid information is that Mr. Robinson lives in Leeds, so we can tick the Mr. Robinson/Leeds box, and put crosses in the boxes that have Mr. Robinson living somewhere else, or anyone else living in Leeds. We need to take other clues together to fill in more squares. For example, the guard’s nearest neighbor, who is a passenger, earns exactly three times as much as the guard does. So we can eliminate Mr. Jones as the guard’s nearest neighbor, because his salary is indivisible by three. I’ll leave the final sleuthing to you.

The creator of Smith, Jones, and Robinson died the month it appeared. Henry Ernest Dudeney was seventy-three and had been writing puzzles for Strand for more than twenty years. He was the most brilliant mathematical puzzle designer of his age, and yet it was only posthumously, with Smith, Jones, and Robinson, that he had arguably his greatest success. When the New Statesman republished the puzzle, “the result was astonishing,” wrote Hubert Phillips, editor of the magazine’s bridge column and crossword. “A flood of solutions (though none had been asked for) showed how wide and interested a public there is for inferential puzzles.”

Phillips himself was a former economics lecturer and adviser to the Liberal Party; in his early forties at the time of the puzzle, he had recently moved into journalism. Unprecedented interest in the puzzle caused Phillips to abandon his bridge column and replace it with a regular logic problem. Through the 1930s Phillips became a prolific and innovative creator of mathematical (and other) puzzles, turning the decade into a golden age for the genre.

I really like these two next problems of his. The first is a whodunnit. Or maybe a shedunnit. The second is a witty nod to the tradition of kinship riddles.

8

ST. DUNDERHEAD’S

St. Dunderhead’s School at Fogwell has a high reputation for hockey—but not so high a reputation for veracity. The First XI played a match at Diddleham recently, after which the girls were allowed to go to a concert. Miss Pry, the mistress in charge, collected the team afterward; she saw ten girls emerge from the concert hall and one from the movie theater next door. When she asked who had been to the theater, the members of the team replied as follows:

Joan Juggins: “It was Joan Twigg.”

Gertie Gass: “It was I.”

Bessie Blunt: “Gertie Gass is a liar.”

Sally Sharp: “Gertie Gass is a liar, and so is Joan Juggins.”

Mary Smith: “It was Bessie Blunt.”

Dorothy Smith: “It was neither Bessie nor I.”

Kitty Smith: “It wasn’t any of us Smith girls.”

Joan Twigg: “It was either Bessie Blunt or Sally Sharp.”

Joan Forsyte: “Both of the other Joans are telling lies.”

Laura Lamb: “Only one of the Smith girls is telling the truth.”

Flora Flummery: “No, two of the Smith girls are telling the truth.”

Given that, of these eleven assertions, at least seven are untrue, who went to the movies?

9

A CASE OF KINSHIP

There must have been a dearth of eligible young ladies in Kinsleydale, for each of five men there has married the widowed mother of one of the others. Jenkins’s stepson, Tomkins, is the stepfather of Perkins. Jenkins’s mother is a friend of Mrs. Watkins, whose husband’s mother is a cousin of Mrs. Perkins.

What is the name of the stepson of Simkins?

Logic problems like the ones above are now commonly known as “grid” puzzles, because the best way to solve them is to draw a grid showing all possible options. The most famous of the genre, The Zebra Puzzle, dates from the 1960s and is of unknown authorship.

The puzzle first appeared in Life International magazine in 1962. Often it is called Einstein’s Riddle, since apparently he wrote it, although that would be pretty impressive given that he died in 1955. Another claim frequently made about the puzzle is that only 2 percent of the population can solve it. This is probably untrue, but it is a brilliant tease.

10

THE ZEBRA PUZZLE

  1. There are five houses.

  2. The Scot lives in the red house.

  3. The Greek owns the dog.

  4. Coffee is drunk in the green house.

  5. The Bolivian drinks tea.

  6. The green house is immediately to the right of the ivory house.

  7. The loafer wearer owns snails.

  8. Sneakers are worn in the yellow house.

  9. Milk is drunk in the middle house.

10. The Dane lives in the first house.

11. The person who wears Birkenstocks lives in the house next to the person with the fox.

12. Sneakers are worn in the house next to the house where the horse is kept.

13. The slipper wearer drinks orange juice.

14. The Japanese wears flip-flops.

15. The Dane lives next to the blue house.

Now, who drinks water? Who owns the zebra?

For clarification, each of the five houses is painted a different color, and their inhabitants are of different national extractions, own different pets, drink different beverages, and wear different shoes. In Life’s version, the neighbors smoked different brands of cigarettes. I have replaced this category with footwear since Einstein was famous for never wearing socks.

The response from Life’s readers was overwhelming. “The magazine had barely gone on sale when the letters began to flood our mail room,” the editor wrote in a following edition, which featured the puzzle on the cover. “They came from lawyers, diplomats, doctors, engineers, teachers, physicists, mathematicians, colonels, privates, priests, and housewives—and from some astonishingly learned and logical children. The writers lived thousands of miles apart—in the provincial villages of England, in the Faroe Islands, in the Libyan Desert, in New Zealand—but they enjoyed one gift in common, an extraordinarily high level of intelligence.” Reader, don’t let me down.

If you enjoyed that, you will appreciate the brain-mangling brilliance of the next puzzle. Devised by Max Newman, a young Cambridge logician, it appeared in Hubert Phillips’s New Statesman column in 1933. Phillips used the pseudonym Caliban for his New Statesman puzzles, after the enslaved demi-devil of Shakespeare’s The Tempest. Many of his Caliban puzzles were collaborations with professional mathematicians, and this one was by far the most wicked.

The puzzle is a work of genius. The information presented in the question seems comically insufficient for a solution but, of course, it contains just what you need. The Mathematical Gazette said Newman’s puzzle was a “gem” and “must be solved to be believed.” I struggled with this one too, but that didn’t stop me marveling at its sparseness, and whimpering at the brutal elegance of its solution.

11

CALIBAN’S WILL image

When Caliban’s will was opened it was found to contain the following clause:

“I leave ten of my books to each of Low, Y.Y. and ‘Critic,’ who are to choose in a certain order:

[1] No person who has seen me in a green tie is to choose before Low.

[2] If Y.Y. was not in Oxford in 1920 the first chooser never lent me an umbrella.

[3] If Y.Y. or ‘Critic’ has second choice, ‘Critic’ comes before the one who first fell in love.”

Unfortunately, Low, Y.Y. and “Critic” could not remember any of the relevant facts; but the family lawyer pointed out that, assuming the problem to be properly constructed (i.e., assuming it to contain no statement superfluous to its solution) the order could be inferred.

What was the prescribed order of choosing?

Low, Y.Y., and “Critic” were colleagues of Phillips on the New Statesman, but that hardly helps. The crucial idea is that every piece of information is relevant, so you must exclude all solutions in which any part of any statement is superfluous. Newman’s puzzle-setting brain would later be put to more serious use puzzle-solving. During the Second World War, he ran a section of codebreakers—the Newmanry—at Bletchley Park, which led to the construction of Colossus, the world’s first programmable electronic computer. Newman was a colleague and close friend of Alan Turing, the father of theoretical computer science. In fact, Turing’s landmark paper On Computable Numbers was inspired by Newman’s lectures at Cambridge. When Newman set up the Royal Society Computing Machine Laboratory in Manchester after the war, he persuaded Turing to join him there.

Hubert Phillips is the earliest source for this next amazing puzzle: the three-way duel, or “truel,” which I have rephrased in homage to a film that ends in one.

12

TRIANGULAR GUNFIGHT

Good, Bad, and Ugly are about to take part in a three-way gunfight. Each is positioned on one of the three points of a triangle. The rules are that Ugly will shoot first, then Bad, then Good, before returning to Ugly and continuing in the same order until only one person is left. Ugly is the worst shot and can hit a target only one time in three. Bad is better, hitting a target two times in three, while Good is the best, never ever missing.

You can assume that everyone adopts the best strategy and no one is hit by a bullet that wasn’t meant for them.

Who should Ugly aim at to have the best chance of survival?

Here are three more logic puzzles of the kind that Hubert Phillips pioneered, although they were not written by him. They read like one-act plays, and they are just tricky enough to be deliciously satisfying to solve.

13

APPLES AND ORANGES

In front of you are three boxes, the first labeled “apples,” the second “oranges,” and the third “apples and oranges.” One box contains apples, one contains oranges, and the other contains apples and oranges. Each label, however, is on the wrong box. Your job is to correctly reassign the labels. You can’t see (or smell) what’s in any of the boxes. But you are allowed to stick your hand in one of them and remove a single piece of fruit.

Which box do you choose, and once you see that piece of fruit how do you deduce the correct contents of all the boxes?

14

SALT, PEPPER, AND RELISH

Sid Salt, Phil Pepper, and Reese Relish are all having lunch together when the man among them notices that one of them has picked up the salt, another the pepper, and the third the relish.

The person with the salt replies: “What gives our situation some spice is that no one is holding the condiment that matches their surname!”

“Pass the relish!” adds Reese.

If the man doesn’t have the relish, what does Phil have?

15

ROCK, PAPER, SCISSORS

Adam and Eve play Rock, Paper, Scissors ten times. It’s known that:

• Adam uses three rocks, six scissors, and one paper.

• Eve uses two rocks, four scissors, and four papers.

• There is never a tie.

• The order that Adam and Eve play their hands is not known.

Who wins and by how much?

When Hubert Phillips died in 1964, his obituary in The Times said that “It may be claimed for him that he provided more amusement for a wet day than any other writer of his time.” As well as publishing puzzles, he compiled thousands of crosswords and wrote extensively on bridge, a game in which he captained England. He also wrote light verse, more than 200 detective stories, and an academic treatise on the football pools, and was a much-loved wit on BBC Radio’s Round Britain Quiz. Yet even though he spread himself across so many fields, his contributions to puzzle culture were as deep as they were extensive.

Phillips was the first person to publish a puzzle involving shared knowledge between participants, which, as we will see, makes him the granddaddy of the Cheryl’s Birthday problem that went round the world in 2015.

The earliest of these puzzles involved smudges on faces. The simplest version involves only two people.

16

MUD CLUB

Alberta and Bernadette are mucking about in the garden. They come inside. The sisters can see each other’s faces, but not their own. Their father, who can see both girls, tells them that at least one of them has a muddy face.

He asks them to stand with their backs to the wall.

“Please step forward if you have a muddy face,” he says.

Nothing happens.

“Please step forward if you have a muddy face,” he repeats.

What happens and why?

When solving this type of puzzle we need to assume that all protagonists, even naughty children, behave honestly and have the analytical skills of a professional logician.

I’ll take you through it. We know that at least one girl has mud on her face, so there are three possible scenarios: Either Alberta is muddy and Bernadette isn’t, or vice versa, or both of them have mud on their faces.

Case 1. Alberta is muddy, Bernadette is clean. (Note that this is information known to us as outsiders, not to the sisters. All they know is what they can see and what they can deduce.)

Let’s enter the mind of Alberta. She looks at Bernadette and sees a clean face. Since she knows that at least one of them has mud on her face, she deduces that it must be her. Her father then asks the person with a muddy face to step forward, but Alberta does not do so. We can therefore deduce that this scenario must be incorrect, since if Alberta was behaving honestly she would have stepped forward.

Case 2. Bernadette is muddy, Alberta is clean.

The same logical argument, but with the names swapped, eliminates this scenario too.

Case 3. Both girls are muddy.

Again let’s be Alberta. She looks at Bernadette and sees a muddy face. She knows that at least one of them has a muddy face. She cannot deduce anything about the muddiness of her face because in both cases—her having a muddy face or a clean one—the statement that “at least one of the sisters has a muddy face” is true. So when her father asks the person with the muddy face to step forward, she doesn’t. The important point is that Alberta refrains from stepping forward because she is ignorant of the state of her own face—not because she knows her face is clean.

Likewise, Bernadette sees a muddy face, and therefore deduces that she cannot know for sure the state of her own face. When her father asks those with muddy faces to step forward she will also refrain.

We can be sure that this scenario is the correct one, because neither girl moves when questioned by their father for the first time. What happens next?

Alberta either has mud on her face or she doesn’t. However, she can eliminate the possibility that she has a clean face because if it was clean, Bernadette, on seeing it, would have already deduced that she had a muddy face, and would have stepped forward the first time their father asked. So Alberta deduces that she has mud on her face. For exactly the same reasons, Bernadette deduces that she has mud on her face, and when their father asks who has a muddy face for the second time both sisters step forward together.

To summarize, this is what happens: Each sister sees mud on the other, and therefore cannot deduce information about her own face. But when she realizes that the other sister cannot deduce the state of her own face, she gains new information that allows her to deduce that they both have muddy faces. Neat!

Hubert Phillips published the earliest “smudge on face” puzzle in 1932, although the logic of face-smudging is more ancient. In the French parlor game I Pinch You Without Laughing, which dates at least as far back as the sixteenth century, a person whose fingers are covered in soot makes smudges on the faces of other members of the group. The aim is to be the last to laugh. I Pinch You Without Laughing is mentioned in Gargantua and Pantagruel, French author François Rabelais’s comic masterpiece. An early nineteenth-century German translation of the book describes a novel twist to the game in which everyone pinches their right neighbor on the chin. Two players have their fingers blackened by a charred piece of chalk, so two people end up with smudges on their faces. “These [players] make a fool of themselves,” notes the translator, “since they both think that everybody is laughing about the other one.”

Soon after Phillips published his “smudge on face” problem, variations were soon featuring in puzzle books and attracting the interest of academics. The Russian-American cosmologist George Gamow, one of the earliest advocates of the Big Bang theory of the origin of the universe, was also the author of wonderful science popularization books. These included One Two Three . . . Infinity (published in 1947), which is still one of my favorites, and which is especially charming because he illustrated it himself. In 1956 Gamow was consulting for the airline Convair, where the mathematician Marvin Stern had a full-time job. The men worked on different floors and noticed that whenever they went to each other’s offices the elevator was almost always coming in the wrong direction. They became friends chatting about the math behind this apparent conundrum, and as a result decided to collaborate on the book Puzzle-Math, which contains the following three-person smudge-on-face problem.

17

SOOT’S YOU

Three passengers are sitting in a train, minding their own business, when smoke from a passing locomotive suddenly blows through the window, covering all their faces in soot. One of the passengers, Miss Atkinson, looks up from the book she is reading and chuckles. She notices the other two passengers chuckling too. Miss Atkinson, just like her carriage companions, assumes that her face is clean, and that the other two passengers are laughing at the sight of each other’s mucky faces. Then she catches on. She takes out a handkerchief and wipes her face.

We can assume that all three passengers are behaving logically, but that Miss Atkinson is quicker on the uptake. How did she work out that her face was also smeared with soot?

Puzzle-Math is not as well remembered as Gamow’s other books, but even so it includes one of the most magnificent logic puzzles ever devised. (Gamow credits the puzzle to the great Soviet astrophysicist Victor Ambartsumian.) I have paraphrased and modified it a little, basically by inverting the sexism. It’s a hard puzzle, but if you have followed the logic of the previous two problems you will be well equipped to solve it. Even if you don’t work it out, you’ll be able to follow—and marvel at—the solution.

18

FORTY UNFAITHFUL HUSBANDS image

In a provincial town 40 husbands are cheating on their wives. Each woman is aware that every man apart from her own husband is having an affair. In other words, each wife assumes her husband is faithful while knowing that all 39 other husbands aren’t. On hearing about the moral degeneracy in the town the monarch in the capital issues a decree to punish the husbands for their wickedness. It stipulates that the day after a woman discovers her husband has been unfaithful, she must kill him at noon in the town square.

He then says: “I know that at least one husband has been unfaithful and I urge you to do something about it.”

What happens next?

image

The puzzle seems impossible at first, since the wives already know of 39 cheating husbands. What difference does it make that the monarch reveals that “at least one” is a cheat? Yet make a difference it most certainly does!

In a similar vein, this next puzzle involves three people who make deductions based on private and shared knowledge.

19

BOX OF HATS

Algernon, Balthazar, and Caractacus have a box that contains three red hats and two green hats. They each close their eyes, take a hat from the box and put it on. They close the box and open their eyes, so that each of them can see the color of the hat worn by the other two. They do not know the color of their own hat, nor which hats are left in the box.

Algernon says: “I don’t know the color of my hat.”

Balthazar says: “I don’t know the color of my hat.”

Caractacus, seeing that the other two both have red hats, says: “I know the color of my hat!”

What color is it?

The Box of Hats puzzle dates from 1940 at the latest, although then it was phrased differently and described disks on the foreheads of Chinese mandarins. More importantly, no mandarin declares his ignorance out loud. One has to deduce what they don’t know from their silences.

The comedic dialogue in which each protagonist declares that they don’t know something until they do is a winning enhancement that was introduced in the 1960s. The repartee makes it much clearer who knows what and adds to the sense of slapstick.

The following puzzle appears in British mathematician J. E. Littlewood’s A Mathematician’s Miscellany from 1953. Littlewood was one of Britain’s three greatest mathematicians in the first half of the twentieth century, along with G. H. Hardy and, so the joke went, “Hardy-Littlewood,” in reference to the incredibly rich and long-standing collaboration between both men. During the First World War Littlewood worked for the army improving the formulae that calculated the direction, time, and range of missile trajectories. So valuable was his military work that he was given special allowances, such as permission to carry an umbrella while in uniform.

Back to the puzzle, which is rebooted from Littlewood’s original with the now de rigueur back-and-forth slapstick. It’s challenging because you have to hold in your head the rebounding possibilities as the common knowledge accumulates. The pleasure comes from eliminating what cannot be the case, step by step, to reveal the answer. Logic puzzles compel a clarity of thought that is simultaneously thrilling and pain inflicting—which is always part of the fun.

20

CONSECUTIVE NUMBERS

Zebedee has secretly written down two numbers on a piece of paper. He tells both Xanthe and Yvette that these numbers are whole numbers—i.e., they are taken from the numbers starting 1, 2, 3, 4, 5 . . . He also tells them that the two numbers are consecutive—i.e., that they are a number and the next one along, so they are of the form 1 and 2, or 2 and 3, or 3 and 4, and so on. Zebedee then whispers one of the numbers to Xanthe, and the other number to Yvette.

The following conversation ensues:

Xanthe: “I don’t know your number.”

Yvette: “I don’t know your number.”

Xanthe: “Now I know your number!”

Yvette: “Now I know your number!”

Can you deduce at least one of Zebedee’s numbers?

Rather than whispering a number to Xanthe, Zebedee could have smudged it on Yvette’s face, or written it on Yvette’s hat. And rather than whispering a number to Yvette, he could have smudged it on Xanthe’s face, or written it on Xanthe’s hat. What’s important to these puzzles is that Xanthe knows something that Yvette doesn’t, and vice versa.

This structure underlies the next problem, which I posted on my Guardian blog in 2015 after I spotted it on a Singaporean website. It caught my attention because it was described as being for primary schoolers, reinforcing the stereotype of dauntingly brilliant standards in Asian math education. If Singaporean primary school kids were expected to solve a problem like this one, no wonder they were the best young mathematicians in the world.

21

CHERYL’S BIRTHDAY

Albert and Bernard just became friends with Cheryl, and they want to know when her birthday is. Cheryl gives them a list of 10 possible dates.

May 15
May 16
May 19
June 17
June 18
July 14
July 16
August 14
August 15
August 17

Cheryl then tells Albert the month and Bernard the day of her birthday.

The following conversation ensues.

Albert: “I don’t know when Cheryl’s birthday is, but I know that Bernard does not know too.”

Bernard: “At first I didn’t know when Cheryl’s birthday is, but I know now.”

Albert: “Then I also know when Cheryl’s birthday is.”

So when is Cheryl’s birthday?

Within a few hours my post on Cheryl’s Birthday was the most viewed story on the Guardian’s website. My cheeky clickbait headline—“Are you smarter than a Singaporean ten-year-old?”—probably helped. Soon after, however, it transpired that the question was taken from a regional math competition aimed at the top 40 percent of fifteen-year-olds, and it was the penultimate question in a paper of twenty-five questions of increasing difficulty. So only the very top students would have been expected to get it right. I changed the title to accurately reflect the level of the problem, but interest did not wane. Quite the opposite: The Cheryl’s Birthday problem was spreading across the web like a global pandemic. In the following days the logic puzzle was the number one story on many news sites, including BBC and the New York Times. The puzzle got more than five million hits that week on the Guardian site alone and, when the newspaper came to tally the most viewed stories of the year, the post where I set the problem was in ninth place, and the post with the solution was in sixth. I doubt a math problem has ever spread so quickly to so many people around the world.

I got in touch with Joseph Yeo Boon Wooi, the Singaporean math educator who wrote the problem. He only discovered that the puzzle had gone viral when he was surfing Facebook and saw a photograph of the exam paper. “Hey, this looks familiar,” he exclaimed. “Wait a minute, I’m the one who set this!” Dr. Yeo, of Singapore’s National Institute of Education, is the lead author on the math textbooks used by more than half of secondary school students in Singapore. He told me that the idea for the Cheryl puzzle came from someone else. He had read a similar version of the puzzle online and decided to adapt it, choosing new names for the characters, tightening the dialogue and changing the dates, mischievously making his own birthday the solution. Both he and I have failed to find the original author. We have only been able to trace it to a 2006 post on the “Ask Dr. Math” pages run by Drexel University. The post was submitted by someone called “Eddie,” who was asking for the solution.

One of the lessons of Cheryl’s Birthday is that writing a great puzzle is usually a collective enterprise. Like jokes and fables, puzzles change and evolve. Each time a question is rephrased it gains something new, and the best ones can endure for decades, centuries, and even millennia.

Joseph Yeo, however, did devise this sequel.

22

DENISE’S BIRTHDAY

Albert, Bernard, and Cheryl become friends with Denise, and they want to know her birthday. Denise gives them a list of 20 possible dates.

February 17, 2001
March 13, 2001
April 13, 2001
May 15, 2001
June 17, 2001
March 16, 2002
April 15, 2002
May 14, 2002
June 12, 2002
August 16, 2002
January 13, 2003
February 16, 2003
March 14, 2003
April 11, 2003
July 16, 2003
January 19, 2004
February 18, 2004
May 19, 2004
July 14, 2004
August 18, 2004

Denise then tells Albert the month of her birthday, Bernard the day, and Cheryl the year.

The following conversation ensues:

Albert: “I don’t know when Denise’s birthday is, but I know that Bernard does not know.”

Bernard: “I still don’t know when Denise’s birthday is, but I know that Cheryl still does not know.”

Cheryl: “I still don’t know when Denise’s birthday is, but I know that Albert still does not know.”

Albert: “Now I know when Denise’s birthday is.”

Bernard: “Now I know too.”

Cheryl: “Me too.”

So, when is Denise’s birthday?

Another significant ancestor in Cheryl’s family history is Dutch mathematician Hans Freudenthal’s “impossible puzzle,” from 1969, the first to include the “I-don’t-know-now-I-know”conversation used in the previous problems. Almost true to its name, it is unlikely to be solved with just pen and paper, so I haven’t included it here. (But do go online if you’re feeling brave.) The impossible puzzle also belongs to another puzzle tradition, which dates back to at least the first half of the last century. In these puzzles we have to deduce a set of numbers from knowing what they add up to (their sum) and what they multiply to (their product). Usually, these problems are phrased in terms of ages. And quite often in terms of men of the cloth.

23

THE AGES OF THE CHILDREN

The vicar asked the sexton, “How old are your three children?”

The sexton replied, “If you add their ages you get the number on my door. If you multiply their ages together you get 36.”

The vicar went away for a while but then came back and said he could not solve the problem.

The sexton told the vicar: “Your son is older than any of my children,” and added that the vicar would now be able to solve the problem.

Find the ages of the children.

Which leads us to the penultimate puzzle of the chapter, devised by the British mathematician John Horton Conway, who is emeritus professor at Princeton University. The last time I met Conway, at an interdisciplinary math, puzzle, and magic conference, he told an audience of 300 that people like him needed some kind of empowering salute, and he suggested a gesture in which one points at oneself while whimpering “nerd” as feebly as possible. He then led the room in a mass nerd salute. Conway’s playfulness has influenced his entire academic career: He has invented many games and puzzles, most famously the Game of Life. This mathematical simulation of how things evolve is used by scientists such as Stephen Hawking as a model of how simple rules can produce complex behavior.

His problem below is a masterpiece. It simultaneously mocks the “common knowledge” genre while at the same time being a brilliant example of it. Like all the best logic puzzles since Alcuin it presents an amusing story and appears at first glance to give you far too little information to solve it.

24

WIZARDS ON A BUS image

Last night I sat behind two wizards on a bus, and overheard the following:

A: “I have a number of children, whose ages are positive whole numbers, the sum of which is the number of this bus, while the product is my own age.”

B: “How interesting! Perhaps if you told me your age and the number of your children, I could work out their individual ages?”

A: “No.”

B: “Aha! AT LAST I know how old you are!”

What was the number of the bus?

When the wizard says no, he is being neither grumpy nor dismissive. He is saying that if he provided his age and number of children then B does not have enough information to deduce the individual ages.

I can confirm that the wizard has more than one child. There is only one possible number for the bus.

All aboard!

To finish, a visual logic puzzle to get you in the swing for geometry, up next.

Would it help if I mentioned that most people get this puzzle wrong?

25

VOWEL PLAY

The following four cards each have a letter on one side and a number on the other.

image

To verify the following rule:

All cards with a vowel on one side have an odd number on the other side.

which cards do you need to turn over?