# Math problem that went viral.

## Recommended Posts

Apparently, it's all the rage online the last few days. It started with a posting on Facebook, by Kenneth Kong, a television host in Singapore.

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?

##### Share on other sites

Yes, fun riddle. Embarrassed to say that I needed quite some time to solve it completely. Don't think it will be too hard for many here, especially if they have done things like this before.

I remember someone here posting Einstein's five-houses riddle once and a lot of us solved that one and this one is easier. Still a lot of fun and a challenge! :)

##### Share on other sites

The trick is to remember that all of the participants have information that you don't. If you try to solve from their perspective you'll not be able to answer, because this is a second level problem.

##### Share on other sites

I know that you know that I know the answer. But that does not help anyone else solving the riddle.  :P

Yeah, it kinda similar to "what color hat is on your head" problems.

##### Share on other sites

Hanabi is an excellent, elegant card game which scratches a similar itch to this sort of problem.

##### Share on other sites

this one is relatively straight forward with this type of problems. I just spent an evening and more to solve a similar but much more complicated problem:

2 numbers a and b, a >=b, both integers between 2 and 99. Mr. P knows the sum S=a+b, and Mr. Q knows the product M=a*b. Here is the conversation:

Q: I don't know what are a and b.

P: I know you don't know, and I don't know either.

Q: I know now.

P: I also know now.

What are a and b?

##### Share on other sites

this one is relatively straight forward with this type of problems. I just spent an evening and more to solve a similar but much more complicated problem:

2 numbers a and b, a >=b, both integers between 2 and 99. Mr. P knows the sum S=a+b, and Mr. Q knows the product M=a*b. Here is the conversation:

Q: I don't know what are a and b.

P: I know you don't know, and I don't know either.

Q: I know now.

P: I also know now.

What are a and b?

Does this statement mean P knows that Q doesn't know based on what Q has just said, or independently? If he knows because Q said it 2 seconds ago that is kind of a useless comment.

##### Share on other sites

P's statement (P knows Q does not know) is based on the info P has, ie the sum of the two integers.

##### Share on other sites

this one is relatively straight forward with this type of problems. I just spent an evening and more to solve a similar but much more complicated problem:

2 numbers a and b, a >=b, both integers between 2 and 99. Mr. P knows the sum S=a+b, and Mr. Q knows the product M=a*b. Here is the conversation:

Q: I don't know what are a and b.

P: I know you don't know, and I don't know either.

Q: I know now.

P: I also know now.

What are a and b?

That's a tough one. I'll take your word for it that there is a solution.  I tried to brute force it by writing a simple python script to output every possible answer of S and M (pun not intended) leaving out only the obvious ones such as a=b=2 or M being a prime number.  I looked at the results and I think I see many values that could meet the conversation without either figuring out the answer.  Such as:

S=10:

P would know that (a,b) = (5, 5) or (6, 4) or (7, 3) or (8, 2)

P would also know that M = 25 or 24 or 21 or 16

All of those values for M have more than one possible value of (a,b).

This is the same of you start with S = 11 or S=12.

I don't get how Q knows the answer just by knowing that P doesn't know and knows he doesn't know.  It seems like that leaves a ton of possibilities.

I have to think about it more.

By the way this is the python script:

import os, sys, math

def is_prime(num):

if num > 2 and num % 2 == 0:

return False

for n in range(3, int(math.sqrt(num)) + 1, 2):

if num % n == 0:

return False

return True

results = "";

for a in range(2,100,1):

for b in range(2,100,1):

if b <= a and (a+b) > 5 and (a*b) > 8 and not is_prime(a*b):

results += "a={}, b={}, S={}, M={}\n".format(a, b, a+b, a*b);

f = open("s_and_m.txt","w");

f.write(results)

f.close()

EDIT:  I just realized that 25 doesn't have more than one a,b pair.  I'm going to figure this out.

##### Share on other sites

Edit: yes, there is a single solution that follows from the inferences of conversation between P & Q.

I wrote a Python script and got the answer. It would be somewhat hard, but possible to do it by hand.

If anyone wants spoilers the answer is also at http://www.mathpropress.com/archive/iams/vol14.ascii

Now back to wasting my workday on other non-productive endeavors like value investing  8)

##### Share on other sites

nice python script. and also good collection of the math puzzles

##### Share on other sites

Edit: yes, there is a single solution that follows from the inferences of conversation between P & Q.

I wrote a Python script and got the answer. It would be somewhat hard, but possible to do it by hand.

If anyone wants spoilers the answer is also at http://www.mathpropress.com/archive/iams/vol14.ascii

Now back to wasting my workday on other non-productive endeavors like value investing  8)

duh,  I see where I messed up.  For some reason I was thinking M couldn't be prime, but it is S that can't be the sum of primes.

Thanks for the solution.

##### Share on other sites

this one is relatively straight forward with this type of problems. I just spent an evening and more to solve a similar but much more complicated problem:

2 numbers a and b, a >=b, both integers between 2 and 99. Mr. P knows the sum S=a+b, and Mr. Q knows the product M=a*b. Here is the conversation:

Q: I don't know what are a and b.

P: I know you don't know, and I don't know either.

Q: I know now.

P: I also know now.

What are a and b?

are we supposed to be able to do this in our head?

when p said "i know you don't know" I am guessing that meant he knew q didn't know it before q said anything, right?

##### Share on other sites

this one is relatively straight forward with this type of problems. I just spent an evening and more to solve a similar but much more complicated problem:

2 numbers a and b, a >=b, both integers between 2 and 99. Mr. P knows the sum S=a+b, and Mr. Q knows the product M=a*b. Here is the conversation:

Q: I don't know what are a and b.

P: I know you don't know, and I don't know either.

Q: I know now.

P: I also know now.

What are a and b?

are we supposed to be able to do this in our head?

when p said "i know you don't know" I am guessing that meant he knew q didn't know it before q said anything, right?

If you can do it in your head, you're pretty genius level.

I'd suggest pen and paper at least, programming makes this easier though. I got almost to the end with pen and paper, but programming script makes last step easier to verify and doublecheck.

##### Share on other sites

i am not a programmer.  I was trying to do it with excel but I am not sure it is up to the task

Does the order matter? If it is 6 then you know your numbers are 2 and 3, but you don't know whether it's a=2, b=3, or the other way around.

##### Share on other sites

i am not a programmer.  I was trying to do it with excel but I am not sure it is up to the task

Does the order matter? If it is 6 then you know your numbers are 2 and 3, but you don't know whether it's a=2, b=3, or the other way around.

From the problem:

2 numbers a and b, a >=b,

Good luck

##### Share on other sites

Am I the only one who doesn't see the answer in the link?  I would like to check what I came up with.  Someone message me the answer?  Or should I simply post my guess?

##### Share on other sites

Am I the only one who doesn't see the answer in the link?  I would like to check what I came up with.  Someone message me the answer?  Or should I simply post my guess?

## Create an account

Register a new account