I read a post today about the now famous Cheryl's birthday problem here: http://www.bbc.co.uk/news/world-asia-32297367

I thought I would have a go and immediately was stumped by the question. I then watched the video on the BBC page which supposedly explained how to solve it but was still confused. It sounded mostly correct but there seemed to be gaps in the logic and I still didn't understand.

It was only after going over it a few times and reading a few comments that I finally understood both the solution and more importantly, why I hadn't been able to understand it. The reason? The ambiguity of language mixed with various assumptions that we make when reading things. A lesson that most of us have learned when we have incorrectly implemented some software.

I won't recreate the question here but I will explain, hopefully more clearly, the solution and where the problem lies.

Many logic problems set a scene and then make a set of statements. There are some assumptions that must be made in logic problems generally and they include a) Everything you need to know is in the statements (perhaps that is obvious) and b) Every statement has some logical value. In other words, if you think there is some other assumed context, you are probably wrong and if you think a statement is superfluous, you are also presumably wrong. c) Every statement is fundamentally correct - it would be really hard to solve a problem containing fallacious arguments!

Albert: I don't know when Cheryl's birthday is, but I know that Bernard does not know too.

Excusing the slightly poor grammar. This statement immediately felt like it was superfluous. Obviously Albert cannot know the date because he only has the month. Likewise, my assumption is that Bernard cannot know, otherwise it would be a rubbish question! Part of the problem is that in this case, we are using a real-world example and that brings in all kinds of assumptions or questions: What did Cheryl tell each of them about the other? Does Albert know that Bernard was only told the day? Did Bernard tell Albert that he didn't know the date?

I had fallen into the logical trap, both of thinking I was missing information (in which case the question is unanswerable - probably not what was intended) or otherwise the first statement was superfluous, which would mean it was poorly written - but since I could not solve it without the first statement, it probably wasn't intended to be superfluous.

The key here is not the fact that Bernard does not know the date but that Albert knows that Bernard doesn't know the date. Assuming there is nothing outside of the statements that is needed to solve the question, the only way Albert can know that Bernard does not know is if Albert has a month that does NOT include a unique day (18 or 19) - if he did, Bernard might know what the date was because he held that unique day but even if he didn't, Albert would not be able to say for certain that Bernard does not know the date. The conclusion from Albert's first statement is that Albert holds July or August as a month.

We are not told that Albert tells Bernard anything, we have to assume that Bernard has worked out what we have worked out using Albert's first statement. In other words, Bernard now knows that Albert is holding July or August in order for Albert's statement to be true.

It is now Bernard's turn to give a clue in his statement:

Bernard: At first I don't know when Cheryl's birthday is, but I know now.

Knowing that Bernard now knows the month is July or August, there is only one way this second statement can be true - that is if the day that Bernard knows is unique amongst July and August. If Bernard had 14, he still wouldn't know. If he does, he must have 15, 16 or 17 then he knows the exact date.

Why don't we stop here? Because it is not the point that Albert or Bernard has worked out the answer but that we know the answer and we are still left with 3 possibilities: 16th July, 15th August and 17th August.

Again, we assume that Albert has deduced the same 3 possibilities that Bernard did (and Bernard also knows the day - so he knows the actual date) so for the 3rd statement to have value:

Albert: Then I also know Cheryl's birthday

That means the month that Albert started with must uniquely identify one of these 3 dates. Since 2 of them have the same month, if the date was one of those, Albert would not be able to deduce it and the 3rd statement would be false. In other words, only if it is July 16th, would Albert now know what the date is.

I thought the whole experience was another useful reminder about assumptions, ambiguity and making sure we really understand something before we attempt to solve it.