Three hats problem
There are three agents each wearing a red or blue hat, each agent can see the other hats but not his own. There is an announcement: "there are at most two blue hats" Does any agent now know the color of his own hat?
In general the answer is of course no. But what if there are indeed two blue hats, for example for agents 1 and 2?
If after the announcement none of the agents step forward we know that there were not two blue hats, so at most one hat is blue. This has become common knowledge
As the model shows if all agents have a red hat they will still not know the color of their hats. So, if after the second announcement no agent steps forward all agents wear a red hat. Since this has become common knowledge, of course the agents will know the colors of their hats.
Test cases
Here are some examples of both true and false formulas. These are used as test cases for the program. Click on a formula to input it into the prover.
- K1 M1 M3 K3 K2 K1 a → a
- ¬(K1(a ∨ ¬b) ∧ M1 ¬a ∧ M1(¬a ∧ b))
- ¬M1(¬a ∧ a)
- K1 M1 M3 K3 K2 K3 a → M1 M3 a
- ¬(K1(a ∨ b) ∧ M1 ¬a ∧ M1 K1 M3 ¬b ∧ (M1 K2 M1(¬a ∧ ¬b) ∨ M1(¬a ∧ ¬b) ∨ K1 a))
- ¬(K1 M1 M3 K3 K2 K3 a ∧ K1 M3 M2 K3 M2 ¬a)
- ¬(K1 M1 M3 K3 K2 K3 a ∧ K1 M3 K3 K2 (¬a ∨ x) ∧ K1 ¬x)
- K1 (a → b) → ( K1 a → K1 b)
- K1 a → a
- K1 a → K1 K1 a
- M1 a → K1 M1 a
- M1 (K1 p ∨ M2 K2 K1 q) → K1 (¬q → p)
- ((p ∧ ¬K1 p) → ¬p) ∨ ((p ∧ ¬K1 p) → ¬((p ∧ ¬K1 p) → ¬K1((p ∧ ¬K1 p) → p )))
- (K1 (a ∨ b) ∧ (c → K1 ¬b) ∧ (K1 a → d)) → (c → d)
- (K1(g = K1 p) ∧ M1 g) → (g ∧ p)
- (K1(g = K1 p) ∧ M1 ¬g) → ¬g
- (K1 p ∧ K1((a ∧ p) → b)) → K1 (a → b)
And here are some false formulas from the same source:
- (K1 p ∧ K1 ((a ∧ p) → b)) → (M1 ¬b ∧ K1 (a → b))
- K1 M1 M3 K3 K2 K3 a → b
- ¬(K1 (a ∨ ¬b) ∧ M1 ¬a ∧ M1 b)
- K1 M1 M3 K3 K2 M3 a → K1 K3 a
- ¬(K1 (a ∨ b) ∧ M1 ¬a ∧ (M1 (¬a ∧ ¬b) ∨ M1 a))
- ¬(K1 M1 M3 K3 K2 K3 a ∧ K1 M3 K3 K2 (¬a ∨ x) ∧ ¬x)
- ((p ∧ ¬K1 p) → p) ∧ ((p ∧ ¬K1 p) → ¬((p ∧ ¬K1 p) → K1((p ∧ ¬K1 p) → p )))
- ¬(K1 M3 (M1 a ∨ K4 b) ∧ K3 (K1 K3 ¬a ∧ M3 K4 K3 M6 ¬b))