A coworker of mine posted a problem in our local communication software that seems to be a simpler variation of the Zebra Puzzle/Einstein's Riddle. I know how to solve it intuitively, by using elimination. But is it possible to solve these kinds of problems using pure math?
Here is the problem he posted:
Albert and Bernard just become friends with Cheryl, and they want to know when her birthday is. Cheryl gives them a list of 10 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 does not 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?
Can I model this problem mathematically in some way, and then solve it using a deterministic approach? I assume that if it is possible with this one, it would also be possible with the Einstein's one.
I'm on a brief break so forgive any mistakes or any lack of utility, but here is an attempt to apply some formalization to the problem.
Let $X$ and $Y$ be two sets. In this case let $X = \{ x | x \text{ is a possible month} \}$ and $Y = \{ y|y \text{ is a possible day} \}$. Then the choices Cheryl gives is $Z \subset X \times Y$. Lets also say an answer to the problem is exactly one $(a,b) \in Z$. A solution exists if at most Two Parties A and B can figure out the answer.
We can say something about a solution existing by looking at a function $S_y: Y \to 2^Z$ where $S_y(a) :=\{(x,y)| y=a \text{ where } (x,y) \in Z\} $. A similar function $S_x: X \to 2^Z$ where $S_x(a) :=\{(x,y)| x=a \text{ where } (x,y) \in Z\}$. Basically the set of all pairs in $Z$ that share the element $y$ or $x$.
We can look at the cardinality of a these sets to determine if a solution even exists.
Let
$\phi_y: Y \to \mathbb{N}$ where $\phi_y(y) = |S_y(y)|$.
$\phi_x: X \to \mathbb{N}$ where $\phi_x(x) = |S_x(x)|$
Now lets say we construct a $Z$ for our riddle.
A trivial solution $(a,b) \in Z$ exists if either $\phi_x(a) = 1$ or $\phi_y(b) = 1$. Trivial in that Party A or Party B will know it is the birthday since either $S_x(a)$ or $S_y(b)$ contains one element, the solution.
To guarantee a solution
This is more of a verification that a solution exists for a riddle of this form. It may be interesting to generalize to any amount of parties and set of values $\prod_{i \in I} X_i$.
Gotta cut out for now, but i'll check back to see if anyone notices anything foolish.