Doubly Annoying Cheryl

Logic Level 4

Albert and Bernard just became friends with Cheryl, and they want to know when her birthday is. Cheryl gives them two unknowns: M M and D . D.

M M is the month of Cheryl's birthday (1-12)
D D is the day of Cheryl's birthday.

Cheryl then tells Albert the sum M + D M+D and she tells Bernard the product M × D M \times D .

Albert: "I don't know when Cheryl's birthday is, but I know that Bernard does not know too."
Bernard: "I could not figure out when Cheryl's birthday is, but I can now."
Albert: "Then I also figured out when Cheryl's birthday is."

What is the earliest Cheryl's birthday could be?

Input the month and day concatenated; e.g. September 14th is 914


The answer is 213.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Afkar Aulia
Jan 26, 2016

Consider prime numbers p E {17, 19, 23, 29, 31}. Albert's number cannot be p+1, because he will need to consider the possibility of Bertrand's number being p, which automatically causes him to know without clue that the date is p January. Albert's number cannot be p+k, with k E {2, 3, ..., 12}, because 12< p and 2p > 31. If Albert's number is p+k, he will need to consider the possibility of Bertrand's number being kp. p can only be a prime factor of the date, as p>12. And as 2p > 31, the only possibility is that Bertrand will know without clue that the birthday is date p month k. Now we only have number 2-17 for Albert's number. However, since they both eventually know the number, Albert's number cannot be odd number less than 14. If Albert's number is odd and less than 14, they will have no mean to differentiate which one is the date and which one is the month, since both the date and month are different and are at most 12. Albert's number cannot be 14, as he will need to consider possibility of Bertrand's number being 13, which lets him know the birthday without a clue. Albert's number cannot be 16, as he will need to consider possibility of Bertrand's number being 39, which lets bertrand know without a clue that the birthday is March 13th.

Now Albert's number can only be 2, 4, 6, 8, 10, 12, 15, 17. If Albert's number is less than 13, the only way both can tell the number is if date=month
Albert's number cannot be 2, as he will know right away the birthday

Albert's number cannot be 4, as the birthday will cause Bertrand's number to become 4, which will leave him confused between 2.2 and 4.1 even with Albert telling him that he doesn't know the number and he knows Bertrand doesn't know the number.

Albert's number cannot be 6, as the birthdate will left Bertrand confused between possibility of 3.3 and 9.1,even with Albert telling him that he doesn't know the number and he knows Bertrand doesn't know the number. Albert's number cannot be 8, as Bertrand will be confused between 1.16, 2.8, or 4.4 even with Albert telling him that he doesn't know the number and he knows Bertrand doesn't know the number. Albert's number can be 10. Bertrand will at first be confused between 25.1 and 5.5, but he will find out the birthday after Albert tells him that he knows Bertrand doesn't know (which signifies that Albert's number is less than 18), and Albert finds out soon that the date equals the month (by knowing that Bertrand can determine the date after getting information).

Albert's number cannot be 12, as 6 june as the date will make Bertrand still confused with choices of 12.3, 4.9, and 6.6 even with Albert telling him that he doesn't know the number and he knows Bertrand doesn't know the number.

If Albert's number is 15, Bertrand's number can be 56 (Bertrand needs to choose between 2.28, 4.14 or 8.7), 54 (Bertrand's choice: 2.27, 6.9, 18.3), 50 (2.25, 5.10), 44 (2.22, 4.11), 36 (2.18, 3.12, 4.9, 6.6), 26 (1.26, 2.13), or 14 (1.14, 2.7). Among them, the only possibility that lets Bertrand know the exact birthday after being told that Albert's number is less than 18, while still able to differentiate date and month is if Bertrand's number is 26, which gives answer of 13 february.

If Albert's number is 17, Bertrand's number can be 16 (1.16 or 4.4), 30 (1.30, 2.15, 3.10, 5.6), 42 (2.21, 3.14, 6.7), 52 (2.26, 4.13), 60 (2.30, 3.20, 4.15, 5.12, 6.10), 66 (6.11, 22.3). Among them, the only possibility that lets Bertrand know the exact birthday after being told that Albert's number is less than 18, while still able to differentiate date and month is if Bertrand's number is 52, which gives answer of April 13th

Answer: 13 february, 13 april, 5 May

Why isn't 15 January an answer?

Shaun Leong - 5 years, 4 months ago

Log in to reply

15 January requires Albert to have 16 as his number. However, in this case, he needs to consider the possibility of March 13 as a possible answer. Note that in such possibility, Bertrand's number is 39, which is 1x39 or 3x13. In such case, Bertrand will know Cheryl's birthday right away, as 13 march is the only possibility deductable from number 39. Thus, if Albert's number is 16, he can't say "I know Bertrand doesn't know either", as his number allows possibility in which Bertrand knows the birth date right away.

Afkar Aulia - 5 years, 4 months ago

Log in to reply

Thanks! Nice solution btw. I can't imagine having to consider so many cases for one problem.

Shaun Leong - 5 years, 4 months ago

If we assume Albert's number is 16, wouldn't there be other possibilities besides March 13th? What about April 12th (4+12=16)? In this case, Bertrand's number is 4x12=48, which leaves him the options of 1x48, 2x24, 3x16, 4x12, 6x8, etc. Many of those options represent possible dates, so if Albert's number is 16, wouldn't Bertrand be unable to know the date for certain?

Bob K - 5 years, 2 months ago

Was this a solution?or a novel writing,u seem to be a author I think?plzz there will be a short solution for this question!discuss that becoz this types of question by ur way would days to figure out!!!

Yash Joshi - 5 years, 4 months ago

Dear Afkar, I find strange to mix the order of deductions about A and B sentences. I mean that only when we know exactly what was A saying, we can go to B comment.

You wrote: "Now we only have number 2-17 for Albert's number. However, since they both eventually know the number , Albert's number cannot be odd number less than 14"

And I think you are using information you have not at that moment.

Antonio Torrecillas - 5 years, 3 months ago

What a answer!

bhanu pratap - 5 years, 4 months ago

- Albert says with his 1st comment: Muy sum is not 2, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43. In all those cases there is a possibility for B to know the numbers, for ex: 27=17+10 as sum for A, mean B can have 17x10=170 and being 17 a prime number the only possibility for that product is october 17th
Other possibilities for that forbidden sums 2=1+1, 14=13+1, 16=13+3, 18=17+1, 19=17+2, 20=17+2, 21=17+4, 22=17+5, 23=17+6, 24=17+7, 25=17+8, 26=17+9, 27=17+10, 28=17+11, 29=17+12, 30=29+3, 31=29+2, 32=29+3, 33=29+4, 34=29+5, 35=29+6, 36=29+7, 37=29+8, 38=29+9, 39=29+10, 40=29+11, 41=29+12, 42=31+9.

As a result we (and also B) know that A can have 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 17. In none of those cases A can be sure of B not knowing the birthday.

- Bernard says with his second coment: My product is in only one of those concrete sums and have a only possibility of being a birthday in the option of those sums.

That mean that the product cannot be expressed as axb being a,b<12 and a<>b (there will be a dual being a the day or the month), and other cases. That eliminate the sums 3, 5, 7, 9, 11, 13, (in all those sums there are only pairs of that first kind) and that eliminate also the sums 4, 6, 8, 12 (because the products 2x2, 3x3, 4x4, 6x6 appear in other reamining sums and there is no more options for that sums)

The remaining options are:

sum=10 prod=5x5=25

sum=15 prod=13x2=26

sum=17 prod=13x4=52 (product 42 appear two times in sum=13=7+6 and sum=17=14+3)

- The last sentence of A gives no information (in my opinion) and the earliest option is feb 13th

Dennis Yi
Jun 22, 2018

Using Python, because I hate casework by hand:

days = [31,28,31,30,31,30,31,31,30,31,30,31] #days in month

# Using comprehensions instead of loops
import collections
dates = [(month,day) for month in range(1,13) for day in range(1,days[month-1]+1)]
# Count how many times each M*D shows up 
# (number of possible dates for each Bernard's number)
MD_multiplicities = collections.Counter([date[0]*date[1] for date in dates])

# Sort all dates into classes by M+D and M*D
Aclasses = {}
Bclasses = {}
for date in dates:
    A=date[0]+date[1]
    if A not in Aclasses:
        Aclasses[A]=set()
    Aclasses[A].add(date)

    B=date[0]*date[1]
    if B not in Bclasses:
        Bclasses[B]=set()
    Bclasses[B].add(date)

# Albert doesn't know, so strike out any dates with unique M+D
Aclasses2 = {}
for A in Aclasses.keys():
    if len(Aclasses[A])!=1:
        Aclasses2[A]=Aclasses[A]
# Albert knows Bernard doesn't know
Aclasses3 = {}
for A in Aclasses2.keys():
    # Remove the Aclass if any of its constituents have unique M*D.
    # (Keep the Aclass if none of its constituents have unique M*D.)
    if all(MD_multiplicities[date[0]*date[1]]>1 for date in Aclasses2[A]):
        Aclasses3[A]= Aclasses2[A]
# Bernard didn't know
Bclasses2 = {}
for B,Bclass in Bclasses.items():
    # Remove the Bclass if any set has one element
    if len(Bclass)!=1:
        Bclasses2[B] = Bclasses[B]

# Bernard now knows, since he knows Albert doesn't know and Albert knows he doesn't know.
# What's the intersection of what's left in Aclasses and Bclasses?
# For Bernard to know, he has knowledge of B defining a Bclass
# with only one intersection with the union of remaining Aclasses.
Aunion = set.union(*iter(Aclasses3.values()))
for B, Bclass in Bclasses2.items():
    if len(Bclass.intersection(Aunion))==1:
        date = Bclass.intersection(Aunion).pop()
        print(date,date[0]+date[1],date[0]*date[1])

# Albert now knows. Knowing that Bernard could figure it out,
# he knows that it had to be one of those 3 dates, which have unique M+D.
# Therefore, he knows from M+D which date it must be.
# Resultant dates:
# (5, 5) A=10 B=25
# (2, 13) A=15 B=26
# (4, 13) A=17 B=52
# 2/13 is the answer, as the earliest possible date.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...