The question was part of a mathematics quiz in Singapore, originally (and incorrectly) thought to be aimed at 5-6 year old students. Later, it transpired the quiz was part of the 2015 Singapore and Asian Schools Math Olympiad (SASMO), meant for 15-16 year old students. According to SASMO's organisers, the quiz was aimed at the top 40% of the contestants and aimed to "sift out the better students." SASMO's executive director told the BBC that "there was a place for some kind of logical and analytical thinking in the workplace and in our daily lives."
The question was posted online by Singapore journalist Kenneth Kong. The posting drew thousands of comments, including several humorous ones - especially aimed at Cheryl, who apparently didn't want to disclose her birthday straightaway.
"Albert and Bernard just become friends with Cheryl, and they want to know when her birthday is. Cheryl gives them a list of ten 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 and Bernard separately the month and the day of her birthday respectively.
Albert: I don't know when Cheryl's birthday is, but I know that Bernard doesn't know too.
Bernard: At first, I don'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?"
Out of the 10 dates, the day ranges from 14 to 19, with only 18 and 19 each occurring once. If the day of Cheryl's birthday is 18 or 19, then Bernard would have known when Cheryl's birthday is since Cheryl has told him the day of her birthday. But why does Albert know that Bernard does not know? If Cheryl has told Albert that her birth month is May or June, then it is possible that her birthday may be May 19 or June 18. This means that Bernard may know when Cheryl's birthday is. The fact that Albert knows that Bernard does not know means that Cheryl has told Albert that her birth month is either July or August.
Initially, Bernard does not know when Cheryl's birthday is, but how did he know after Albert has first spoken? Out of the 5 remaining dates in July and August, the day ranges from 15 to 17, with only 14 occurring twice. If Cheryl has told Bernard the day of her birthday is 14, then Bernard would not have known. The fact that Bernard knows means the day of her birthday is not 14. So now we are left with 3 possible dates: July 16, August 15 and August 17.
After Bernard has spoken, Albert now knows when Cheryl's birthday is. If Cheryl has told Albert her birth month is August, then Albert would not have known because there are two possible dates in August. Therefore, Cheryl's birthday is on July 16.