If you properly understand those rules and convert them to code (as in the OP) then searching the possible answers for a match is trivial.
If you dont initially grasp the above then Albert's initial declaration "I don't know when Cheryl's birthday is" just seems to be a redundant statement that doesn't offer any information. And thats just the first hurdle of the puzzle.
A lot of people hate maths-questions-stated-as-stories, even simple ones ("There are several chickens and rabbits in a cage (with no other types of animals). There are 72 heads and 200 feet inside the cage. How many chickens are there, and how many rabbits?" etc etc) so to people like that, this Cheryl-birthday problem initialy presents as hopelessly cryptic.
Incidentally, I get a similar feeling from these puzzles that I get from code questions or examples where every variable or function is named 'a' or 'b' or 'foo' or 'bar'.
(aaand I just had a mini-epiphany of sorts that when I see those types of programming puzzles I should probably write them out and substitute the variable names as I go....)
Which is probably intended, as otherwise I would have thought he meant to say "before Cheryl had told me, I didn't know".
In the context of Albert's statement though, it couldn't mean that - Albert's statement is saying that Bernard does not have enough information to determine the date just based on what Cheryl told him, so in saying "at first I did not know, but now I know", the only difference between "at first" and "now" is Albert speaking.
So Bernard's comment could only mean, "Based on what Cheryl told me, I did not know what the birthday was, but given the extra information I have as a result of Albert's statement, now I know"
People might very well be able to solve even fairly complex logic problems without having been exposed to this tradition of encoding such problems.
The problem is stated as three persons having an odd, but casual conversation. To outsider that's all they're doing and to those the problem is impenetrable. Insiders, however, immediately recognise the informal protocol of logic quizzes that this is not a random casual conversation, it is carefully written to encode just enough information to be solvable as a logic problem. These insiders know to carefully extract (decode) this information. Only then do they solve the logic problem.
The "dishonesty" of the problem, which is confusing to people expecting the problem to be stated honestly, is that the conversation in the problem is entirely contrived, there is no way is would ever happened as part of a real world exchange about birthdays. This is fine for the intendeded reader, school kids trained in this protocol, but in "going viral" it went to a lot of unintended recipients.
When Albert says I don't know when Cheryl's birthday is, but I know that Bernard does not know too, consider There are no unique days in the month I was told.
Informally, note the difference of order. If Albert said "I was told the Birthday is in July", that would be, say, first order. The plain version I provide is a logical statement about the months and dates, a second order statement. But the cryptic version is a statement about what (second-order) statements Bernard can make, so third order. Hence, cryptic.
The Singaporean government doesn't think Singapore English is a valid thing and wants everyone to learn "good" English. The Singaporean upper class is, as usual, on the government's side, and will complain about the poor English education in their country. That's fine for them, but please be aware that when you say "this is bad English" you are making a cultural and class-based judgment. What you really mean is the math question uses a way of expressing time that is familiar to them but not familiar to you.
def statement3(date):
possible_dates = tell(Month(date))
return (not know(possible_dates)
and not know(filter(lambda x : not know(x),
[tell(Day(d)) for d in possible_dates])))Because of this, solutions are often not logical.