In this post, we will solve our third Knights and Knaves puzzle, both informally and formally.
For our third example, we will use the seventh puzzle in Chapter 3 (or the \(32^{nd}\) puzzle overall) of Raymond Smullyan's 1978 book entitled "What Is the Name of This Book?: The Riddle of Dracula and Other Logical Puzzles". As stated on page 22 of the 2011, paperback Dover Recreational Math edition [ISBN: 9780486481982], the puzzle reads:
[Again we have three people, A, B, C] Suppose [...] A and B say the following:
A: All of us are knaves.
B: Exactly one of us is a knave.
Can it be determined what B is? Can it be determined what C is?As was the case for our first two puzzles, we will first solve this one informally.
In the second part of this post, we will check our solution with two different, automatically generated proofs.
Informal solution
Next, if B is a knight, then C must also be a knight. This is because B's statement is true and we already know that A is the knave.
Finally, if B is knave, then her statement is false, which means that there must be either two or three knaves (recall, A is definitely a knave). Since A and B are knaves, C can be either a knight or a knave, according to B's statement. But if C were a knave, all three would be knaves, which contradicts A's statement's being false.
In conclusion, there are two possible solutions to this puzzle:
- A is a knave, whereas B and C are knights.
- A and B are knaves, whereas C is a knight.
-
Can it be determined what B is?
- No, B can be either a knave or a knight.
-
Can it be determined what C is?
- Yes, C must be a knight.
Since the first step in formalizing a puzzle is to translate its statement into propositional logic, we do this first.
Using the representation scheme described earlier in this series, A's statement becomes the formula:
\(A \leftrightarrow (-A\ \&\ {-B}\ \&\ {-C})\)
\(B \leftrightarrow (({-A}\ \&\ {B}\ \&\ {C})\ |\ ({A}\ \&\ {-B}\ \&\ {C})\ |\ ({A}\ \&\ {B}\ \&\ {-C}))\)
Now we can use this logical formulation of the puzzle in two different ways.
In this first formal approach, we will feed the puzzle statement to Mace4 and compare its output to our solution.
Given the input:
Mace4's output above gives us the two solutions we found by reasoning informally, thereby formally proving the correctness of our reasoning.
Alternatively, we could have manually built a truth table for the conjunction of the two puzzle formulas; however, that would have been much more tedious than running Mace4!
Formal solution #2
In this second formal approach, we will feed the puzzle statement and its solution to Prover9 to let it find a contradiction.
Since there are two possible solutions, at least one of them must hold, which yields the following disjunction:
\( (-A\ \&\ {-B}\ \&\ C )\ |\ (-A\ \&\ {B}\ \&\ C)\)
which simplifies to:
\( -A\ \&\ C \)
since the truth value of \(B\) does not matter, but \(A\) and \(C\) must be False and True, respectively.
We are now ready to feed both the puzzle statement and this solution formula to Prover9.
Now, given the input:
Again, we were able to use Prover9 to confirm, using a proof by contradiction, the correctness of our solution to the puzzle.
No comments:
Post a Comment