# Logic Problem Goes Viral (updated)

Perhaps you saw this logic problem, purported to have been given to fifth graders in Singapore, flying around social media yesterday:

That’s right: a logic problem has gone viral.

It turns out that the problem was from a math olympiad test for high-school students, but perhaps the “are you smarter than a fifth grader from Singapore” framing helped propel this puzzle around the world.

The *New York Times* rephrases the puzzle like so:

**Albert and Bernard just met Cheryl. “When’s your birthday?” Albert asked Cheryl.**

**Cheryl thought a second and said, “I’m not going to tell you, but I’ll give you some clues.” She wrote down a list of 10 dates:**

**May 15 — May 16 — May 19**

**June 17 — June 18**

**July 14 — July 16**

**August 14 — August 15 — August 17**

**“My birthday is one of these,” she said.**

**Then Cheryl whispered in Albert’s ear the month — and only the month — of her birthday. To Bernard, she whispered the day, and only the day.
**

**“Can you figure it out now?” she asked Albert.**

**Albert: I don’t know when your birthday is, but I know Bernard doesn’t know, either.**

**Bernard: I didn’t know originally, but now I do.**

**Albert: Well, now I know, too!**

**When is Cheryl’s birthday?**

So when is it?

(The *NYT *analysis is linked to from here. Don’t cheat.)

And, as I asked here, “Is there a lesson here for those concerned with outreach and public philosophy? Are there other such problems that could gain such traction so quickly in social media?”

**UPDATE **(4/16/15): Check out the helpful diagrams by Audrey Yap (UVic) and video by Barteld Kooi (Groningen) at Richard Zach’s Logic Blog.

**UPDATE 2 **(4/16/15): From mathematician Timothy Gowers: An attempt to devise a transfinite version of the Cheryl birthday puzzle.

I wonder if the thing that is going viral here is the fact that Singapore 5th graders are being challenged by the puzzle — rather than the puzzle itself, which is cute but not difficult.

There is something fun about a race to solve a puzzle, though… I always give my students a logic puzzle as a bonus question on in-class exams. At the beginning of the semester it’s usually a variant of the Zebra Puzzle — which did the 1960s equivalent of going viral in NYC social circles when Life International published first the puzzle, then the names of people who managed to solve it. On the 2nd exam I typically choose one of Raymond Smullyan’s inimitable problems — and then on the 3rd exam a variant of the so-called Impossible Puzzle.

The interesting thing is that I actually have students every year who manage to solve each of the three types of puzzles — under exam conditions, without any advance notification of what the type of puzzle will be. It gives me hope for the future to think that our collective global capacity for this kind of analytic reasoning might be increasing very significantly.

The Impossible Puzzle, for those who want a better morning coffee challenge, is harder than the Singapore 5th graders’ puzzle:

X and Y are two different integers, greater than 1, with sum less than 100. S and P are two logicians. S knows the sum X+Y, P knows the product X*Y, and both know the information in these two sentences. The following conversation occurs.

P says “I cannot find these numbers.”

S says “I was sure that you could not find them. I cannot find them either.”

P says “Then, I found these numbers.”

S says “If you could find them, then I also found them.”

What are X and Y?

(For an even more interesting challenge: can you come up with variants of this? And then can you come up with a technique or calculus for producing variants?)Report

I initially missed “respectively” and thought that part of the problem was figuring out which of Albert or Barnard has the month and which has the day. It turns out that there’s also a unique solution if you reverse the two, but it’s different, and it doesn’t make use of Albert’s knowledge of Barnard’s knowledge.Report

I had actually just come across this puzzle elsewhere, worked through it, and sent an email to a colleague who’s smarter than I am to get his insight before I saw it posted here. I was able to arrive at the correct answer, and apparently I did it in the right way (according to published solutions), but it seems to me that there is something wrong with the design of the question. Given that Albert knows the answer by the end of the story, I know it, too. But my question is how he knows. It seems to me that at the last step Albert doesn’t actually have enough information to deduce the answer. Am I missing something here?Report

Never mind… now I see what I missed. 🙂Report

“Are there other such problems that could gain such traction so quickly in social media?”

This puzzle seemed to get a lot of public attention:

http://io9.com/can-you-solve-the-worlds-other-hardest-logic-puzzle-1645422530Report

I’m stuck at the same point Dale Miller? What if Cheryl told Bernard 15 or 17?Report

Here’s the chart I made:

“When’s your birthday?” Albert asked Cheryl. She wrote down a list of 10 dates:

May 15 — May 16 — May 19

June 17 — June 18

July 14 — July 16

August 14 — August 15 — August 17

Then Cheryl whispered in Albert’s ear the month — and only the month — of her birthday. Month:

May 15 —16 —19

June 17 — 18

July 14 — 16

August 14 — 15 — 17

To Bernard, she whispered the day, and only the day.

14 – July August

15 — May August

16 — May July

17 — June August

18 – June

19 – May

“Can you figure it out now?” she asked Albert.

Albert: I don’t know when your birthday is, but I know Bernard doesn’t know, either.

July 14 — 16

August 14 — 15 — 17

Bernard: I didn’t know originally, but now I do.

15 — August

16 — July

17 — August

Albert: Well, now I know, too!

July 16

August 15 — 17

When is Cheryl’s birthday?

July 16

It might help.Report

ahh another “nevermind” 😀Report

Dynamic epistemic logic to the rescue! Logicians Audrey Yap and Barteld Kooi both have solutions to the puzzle:

http://richardzach.org/2015/04/15/logicians-yap-kooi-explain-viral-birthday-logic-puzzle/

http://m-phi.blogspot.nl/2015/04/dynamic-epistemic-logic-solves-birthday.htmlReport

Logician Barteld Kooi explains the solution with actual dynamic epistemic logic, that is by updating a Kripke model. 🙂 https://www.youtube.com/watch?v=doYD1e9k_Ts

By the way, I made the same error as Kenny did: read it too quickly and missed the “respectively”. Additional puzzle: make a new problem such that it still has a unique solution when it is unknown who knows month or date. 😉Report

I follow the logic all the way to Bernard figuring out the date. But it’s unclear to me how Albert knows the date? If Bernard now knows the date, then it must be July 16, August 15, or August 17. The reason Bernard knows is because it must be July or August AND he has been given the actual date, so if that’s right, then he eliminates the 14th dates and selects one of the three remaining answers ‘in virtue of knowing the number already.’

Albert doesn’t have that number, though. So from his perspective, he cannot determine between the three remaining dates because he is not an epistemic peer with respect to Bernard regarding the number. The ONLY way Bernard selects the date is by Cheryl telling him the date. Albert has not been told that, so how can he know that it is the 16th?

Bernard does not arrive at the answer by reasoning that there is only one month with a single date remaining. So how can Albert arrive at the answer that way?Report

Jemimah, Albert knows that that’s the only way Bernard can have arrived at the date *and month,* and so Albert knows it’s *not* the 14th. That eliminates July 14, so Albert knows it’s July 16.Report

Right, I see how the 14th dates are eliminated, but how (from Albert’s perspective) does he know it’s not August 15 or August 17? If Bernard had been told 15 or 17 as the number, then all the previous logic would still lead him to know Cheryl’s birthday. Regardless of whether Bernard had been told 15, 16, or 17, he would still know the date of the birthday given Albert’s elimination of May and June as possibilities. So Albert, at the end, knows that Bernard was told one of those three numbers, because otherwise Bernard would not know the answer. But Albert has no way of knowing WHICH of those three Bernard was told. So how can he be confident the birthday is in July? Nothing Bernard or Cheryl has said (that Albert is also aware of) indicates July 16 over against the August dates.

Now, if we assume that Albert KNOWS the date, then it has to be July 16 because that’s the only unique possibility left (i.e., both the August dates are not unique because they are both in August). So the only way he could know is if he’s learned something that eliminates August. Since we know that’s the only way he could know, we can confidently say that the date is July 16. But here’s my question: HOW does Albert know that? Not how do WE know that, but how does HE know that? What did he learn that eliminated the August dates?

FYI: All CAPS are for emphasis only.Report

Jemimah, Albert has been told that it’s July–it’s part of the setup that he’s been told the correct month it is.

Wehaven’t been told that Albert knows it’s July–we deduce that from the fact that, given his knowledge of what month it is, he can deduce the correct date at that stage of the dialogue. But Albert has been told a month, and that month (it turns out) must be “July.”ReportAH! Yes! Thank you, guys! I suspected there was something fairly obvious that I was overlooking, and now you’ve shown me what it was! Much obliged.Report

I love it when logic puzzles go viral. This is one of my favorites from a few months back, especially for TNG fans.

http://io9.com/can-you-solve-this-extremely-difficult-star-trek-puzzle-1667991339Report

The world has gone mad for epistemic logic! I issued my own transfinite epistemic logic puzzle challenge at http://jdh.hamkins.org/transfinite-epistemic-logic-puzzle-challenge/. Can you solve it? Please post your solution there.Report

Doesn’t the solution require Bernard and Albert to know the category (month or day) that was the only thing whispered to the other?Report

NoReport