Corner of Berkshire & Fairfax Message Board

General Category => General Discussion => Topic started by: 50centdollars on April 15, 2015, 10:28:37 AM

Title: Math problem that went viral.
Post by: 50centdollars on April 15, 2015, 10:28:37 AM
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.

http://www.nytimes.com/2015/04/15/science/a-math-problem-from-singapore-goes-viral-when-is-cheryls-birthday.html


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?
Title: Re: Math problem that went viral.
Post by: tombgrt on April 15, 2015, 10:36:42 AM
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! :)
Title: Re: Math problem that went viral.
Post by: wawallace on April 15, 2015, 10:39:28 AM
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.
Title: Re: Math problem that went viral.
Post by: Jurgis on April 15, 2015, 10:40:56 AM
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.
Title: Re: Math problem that went viral.
Post by: snow pea on April 15, 2015, 11:01:05 AM
Hanabi is an excellent, elegant card game which scratches a similar itch to this sort of problem.
Title: Re: Math problem that went viral.
Post by: leeway on April 16, 2015, 08:22:46 AM
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?
Title: Re: Math problem that went viral.
Post by: constructive on April 16, 2015, 08:32:34 AM
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.
Title: Re: Math problem that went viral.
Post by: leeway on April 16, 2015, 08:48:34 AM
P's statement (P knows Q does not know) is based on the info P has, ie the sum of the two integers.
Title: Re: Math problem that went viral.
Post by: rkbabang on April 16, 2015, 10:08:51 AM
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.
Title: Re: Math problem that went viral.
Post by: Jurgis on April 16, 2015, 11:31:14 AM
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)
Title: Re: Math problem that went viral.
Post by: leeway on April 16, 2015, 12:57:23 PM
nice python script. and also good collection of the math puzzles
Title: Re: Math problem that went viral.
Post by: rkbabang on April 16, 2015, 01:16:40 PM
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.
Title: Re: Math problem that went viral.
Post by: matjone on April 16, 2015, 04:44:29 PM
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?
Title: Re: Math problem that went viral.
Post by: Jurgis on April 16, 2015, 10:14:51 PM
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.

The answer to your second question is "yes".


Title: Re: Math problem that went viral.
Post by: matjone on April 18, 2015, 12:18:24 PM
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.
Title: Re: Math problem that went viral.
Post by: Jurgis on April 18, 2015, 03:19:15 PM
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
Title: Re: Math problem that went viral.
Post by: Lowlight on April 19, 2015, 10:01:24 AM
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?
Title: Re: Math problem that went viral.
Post by: Pretium on April 19, 2015, 12:29:44 PM
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?

http://mashable.com/2015/04/13/math-is-hard/