First a quick comment about dynamic epistemic logic. The purpose of the discipline is to model the knowledge and information states of different agents. That's standard epistemic logic. By making it dynamic essentially means that we are actively changing the models in our logic as new information comes into play. The focus is typically based on communication, the fact that a person comes to know information directly impacts the entire model.
The main idea is this: We have different states of the world, or rather what the agent thinks could be the case. We also have relations between states, which basically says that the agent is unable to distinguish between which world it will be. Now the actual state is in fact one of the states. We say that an agent knows that $p$ in state $s$ if in all worlds related (including itself), $p$ is the case. Otherwise they do not know that $p$. The idea is simple, we're in a certain state, but we intuitively it could be another state. Yet if in all states we deem it could be instead, $p$ is still true, then we know for sure that $p$ is true. We might not know perse which state we're in, but we can say the proposition is correct.
Now Chery's birthday problem is as follows (https://www.theguardian.com/science/alexs-adventures-in-numberland/2015/apr/13/how-to-solve-albert-bernard-and-cheryls-birthday-maths-problem):
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?
We can model this using the following diagram:
Here we have the different days, as states of the world. For example M15 is the state where Cheryl's birthday is May 15th. The relations between states concern distinguishability. If Albert is unable to tell two dates apart (e.g. M15, M16 then we have a linking arrow $a$. The same for Bernard. I have connected the related arrows for us. Clearly, Albert can't tell the months apart and Bernard can't tell the dates apart. This is because Albert is told which month her birthday, but not which of the days of the month. Thus all states of the same month are linked. Bernard is told the date, and so all dates are linked.
Now we process the information we're given.
Albert says that he doesn't know which day it is, but that he knows that Bertrand also doesn't know which day it is. Now, albert not knowing which it is means that the real state is $a$ connected. In fact, just looking at the graph makes this obvious since each state is $a$ connected to another. However the fact that he knows bertrand doesn't know means that the real state lies in an $a$ connected set that are each $b$ connected. The reason for this is that if the actual state had no $b$ connections, then Bertrand would know. For albert to know (i.e be certain of) Bertrand's ignorance means that every state connected to the actual state must have $b$ connections.
This gives us the far simpler diagram. Here every state was once b connected to another state. Now we can also remove all the arrows that connect to states that we have already ruled out.
Now we are told that Bertrand now knows Cheryl's birthday. This obviously means that the real state is one in which there are no b connections. And so we get the even simpler diagram:
Finally we're told that now, Albert suddenly knows. Which means that the actual state has no $a$ connections. And so we're done, Chery's birthday is July 16th.
The impressive thing about dynamic epistemic logic is that the statement of additional epistemic propositions massively changes the model. In this sense, we get what quite surprisingly the fact that agents repeatedly say what they do or do not know, actually resolves our model and gets us these solutions.
If one is further interested, they can feel free to try the same methodology onto: https://www.theguardian.com/science/2015/may/25/can-you-solve-it-cheryls-birthday-logic-puzzle-part-2-denises-revenge.
Once one is familiar with these strategies and the theory behind dynamic epistemic logic, this is very straightforward (if rather tedious to be honest). One thing to note, with more basic puzzles like these you can easily do them without having a particularly formal method. However by formalising, it not only simplifies things for you in the long run, but also makes it possible for computers to do this, by following a very exactly algorithm.