b == B is a knight.
If B says a statement `X', this gives rise to the expression b == X,
since if b, then B is a knight and tells the truth, and if 枴, B is a
knave and lies.
Someone asks B `are you a knight?' to which he replies, `If I am a
knight, I'll eat my hat.' Prove that B has to eat his hat.
E.
Op 10-12-07 18:06, Eric schreef:
That's simple, Eric:
B says, "If I am a knight, I'll eat my hat"
== { formalization, h stands for hat-eating }
b == (b => h)
== { expand => }
b == !b \/ h
== { simplify using logic }
b /\ h
...and this hat-eater turns out to be a knight.
Or am I missing something?
Groetjes,
<><
Marnix
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHXaBejn9v+6JsL6sRAkATAJ9CHJm+aCW9fn2z7KnJG+yNhEMTMwCgqSYX
AidPQ2MnDx285NPkSV/bRFQ=
=5dC8
-----END PGP SIGNATURE-----
I first learned of this "Fundamental Theorem of Truth-Tellers/Liars" from Roland Backhouse, in his book "Program Construction" . It is a wonderful, simple application of predicate calculus. Please submit more problems like this to the thread!
While writing ARM3/JAW53: "The problem of the 21 students" , Apurva and I convinced ourselves of this in the following way, where x and y range over (boolean translations) of statements B makes:
b
== { definition of b }
"B is a truth-teller"
== { definition of truth-teller }
(Ax :: x)
== { B is "categorical" : (Ax,y :: x == y) }
y .
I think this nicely shows how each piece of information fits together. Notice the nice little lemma in the last step:
(Ax,y :: x == y) => ((Ax :: x) == y) .
I can prove this as follows:
(Ax :: x)
=> { instantiation: x and y have the same type }
y ,
and:
(Ax :: x) <= y
== { (<= y) over A }
(Ax :: x <= y)
<= { antisymmetry of <= }
(Ax :: x == y) .
On to Eric's problem.
> Someone asks B `are you a knight?' to which he replies, `If I am a
> knight, I'll eat my hat.' Prove that B has to eat his hat.
As Marnix said, the problem statement implies:
b == b => h ,
where h == "B will eat his hat" . However, I calculate in one step:
b == b => h
== { predicate calculus }
b /\ h .
Recall one of the theorems of implication:
b => h == b == b /\ h .
Let's not hinder ourselves by thinking that we can only use this theorem to rewrite b => h . We should exploit the symmetry and associativity of == to the fullest, meaning that with a theorem like:
W == X == Y == Z ,
we can rewrite the equivalence of any of W , X , Y , Z as the equivalence of the rest!
+j
B says of C, `If C is a knight then I am a knave.' What are B and C?
E.
Let b and c stand for the knighthood of B and C , respectively. The problem statement implies:
b == c => ¬b
== { contrapositive }
b == b => ¬c
== { implication and conjunction }
b /\ ¬c ,
ie that B is a knight and C is a knave.
+j
Let:
b == "B is a knight"
g == "There is gold on the island" .
Formalizing B's statement, and by the Fundamental Theorem of Truth
tellers and Liars we have:
b == (b == g)
== { Predicate Calculus }
g .
So we may conclude that there is gold on the island. However, we
cannot conclude anything about whether B is a knight or knave.
(I am somewhat disconcerted by this result. But I can't see
anything wrong with it.)
Apurva
If your calculation had not been an equivalence, then it would have been disconcerting. You would have concluded that there was gold on the island, but you would not know whether there was more to conclude. This is why weakenings and strengthenings have to be undertaken with care!
However, you have calculated that the information contained in the problem equivales g , and is thus independent of the value of b .
+j
Let a , b , c , d stand for the knighthood of A , B , C , D respectively. The problem statement gives:
(0) c == (b == ¬b)
(1) d == ¬c .
Given (0) equivales ¬c , whence by (1) , we have d . So C is a knave and D is a knight. (Actually, it is somewhat well known in these problems that neither knave nor knight can claim knavehood; both will claim knighthood. This is why one cannot deduce the status of an inhabitant by asking "Are you a knight (knave)?" .
+j
This is precisely what I find disconcerting: Does our
formalization accurately capture all the relevant information about
the problem?
Intuitively, I feel that if I can conclude g , then I should be
able to conclude b as well. The fact that we cannot conclude the
latter prompts me to question whether our calculational theory for
dealing with such problems is incomplete in some way.
Of course, my intuition might be flawed as usual, but then I am not
able to convince myself of this at the moment.
This is the root cause of my disconcertion. Any illuminating words
would be most appreciated!
Apurva
PS : My colleague and friend Dhruv Matani is equally disconcerted
about this state of affairs. Perhaps the two of us are not alone in
this!
But if our only given is b == (b == g) , if that fully captured all the givens, would you agree that the value of b cannot be determined? If so, then you can ask yourself what might be missing from the formalization.
Separate your concerns!
> Intuitively, I feel that if I can conclude g , then I should be
> able to conclude b as well. The fact that we cannot conclude the
> latter prompts me to question whether our calculational theory for
> dealing with such problems is incomplete in some way.
>
> Of course, my intuition might be flawed as usual, but then I am not
> able to convince myself of this at the moment.
Of course your intuition is flawed. You can straightforwardly check that ¬b is consistent with the problem statement.
The real question is: What made you think that you could conclude b ? (What mistaken analogy did you draw? Etc.) That would be a good question to follow up on.
+j
Well, let's check.
> It si rumoured that gold is buried on the island.
Does this statement provide any information?
> You ask B whether there is gold on the island.
Does this?
> He replies, "There is gold on the island if and only if I am a knight."
Call this statement S . Then we have:
S
=> { Fundamental Theorem }
b == (b == g)
== { predicate calculus }
g .
Ah, so the Fundamental Theorem does not show equivalence in the first step! And it cannot, as we do not have:
"B utters X" <= (b == x) .
It would however suffice to show that b == x is the strongest solution to:
(*) q: "B utters X" => q .
We already know that b == x is a solution; that is the Fundamental Theorem. Now we need to show:
("B utters X" => q) => ((b == x) => q) .
I don't know how to prove this (or whether it can be), but it would clearly involve reasoning in English.
Does this satisfy you? "B utters statement X. We know that B is a knight or a knave. If he is a knight, then X is true, and in this case, there is gold on the island. If he is a knave, then X is false, and in this case, there is gold on the island." . Or does that still seem incomplete in some way?
+j
It satisfies me. In fact, I convinced myself of the correctness
along similar lines earlier today.
What originally made me think that I should be able to conclude
that B is a knight is B's statement: "There is gold on the
island if and only if I am a knight". Since we have proven that there
is gold on the island, then we should be able to prove that he is a
knight as well, right?
But that line of thinking already assumes the the truth of his
statement, and hence we would have assumed that B is a knight to
prove he is a knight. It is a subtle logical trap.
Apurva
E.
Hi,
I'll try this one. But I've not really done this before, so excuse me if this
is very wrong :-)
We have:
d == "You're (C is) lying"
== { formalize }
d == non c
We also have:
c == "There is one knight among us"
== { formalize }
c == b \/ c \/ d
== { insert d }
c == b \/ c \/ non c
== { calculus }
c == b \/ true
==
c == b
Thus, C is a knight if and only if B is a knight. The knighthood/knavehood of
D is indeterminable. This makes sense; if D is a knight, then C and B are
knaves. Otherwise, C and B are knights.
I should add that I have interpreted "there is one" as "at least one". I think
it could also be interpreted as "exactly one". But I don't know how that would
be formalized.
Does that look right?
Vegard
Let's investigate "there is exactly one knight among us" .
From D's statement I conclude d == ¬c , as Vegard did. However, in that case, "there is exactly one knight among us" equivales ¬b . Thus c's statement gives c == ¬b .
Thus I conclude that B and D are the same, and C is different.
Vegard made a mistake however:
> c == "There is one knight among us"
> == { formalize }
> c == b \/ c \/ d
> == { insert d }
> c == b \/ c \/ non c
> == { calculus }
> c == b \/ true
> ==
> c == b
The last step should be:
c == b \/ true
== { calculus }
c == true .
So C is a knight, D is a knave, and the status of B cannot be determined.
+j
> I'll try this one. But I've not really done this before, so excuse me if this
> is very wrong :-)
>
> We have:
>
> d == "You're (C is) lying"
> == { formalize }
> d == non c
>
> We also have:
>
> c == "There is one knight among us"
> == { formalize }
> c == b \/ c \/ d
> == { insert d }
> c == b \/ c \/ non c
> == { calculus }
> c == b \/ true
> ==
> c == b
The last step is obviously wrong and should read:
c == true
This means that C is a knight and D is a knave, and B is indeterminable. (I
hope I've got it right this time!)
Vegard
I think the "exactly one knight" can be formalized as follows:
c == (b /\ non c /\ non d) \/ (non b /\ c /\ non d) \/ (non b /\ non c /\ d)
== { insert d == non c }
c == (b /\ d /\ non d) \/ (non b /\ non d /\ non d) \/ (non b /\ d /\ d)
== { indepotence of /\ }
c == (b /\ false) \/ (non b /\ non d) \/ (non b /\ d)
==
c == false \/ (non b /\ non d) \/ (non b /\ d)
== { /\ distributes over \/ }
c == non b /\ (non d \/ d)
==
c == non b /\ true
== { identity element of /\ }
c == non b
And the conclusion is the same as yours (hopefully also without error). Is
this too long-winded in general? I understood your logic; only one of d and c
can be true. But how would that be formalized, apart from what I just wrote?
(Also, what would be appropriate hints where I did not provide any? Were the
other hints okay?)
> Thus I conclude that B and D are the same, and C is different.
>
> Vegard made a mistake however:
You noticed that too quickly! :-)
Vegard
c == (b /\ false) \/ (non b /\ non d) \/ (non b /\ d)
== { false is zero element of /\ }
c == false \/ (non b /\ non d) \/ (non b /\ d)
c == non b /\ (non d \/ d)
== { excluded middle }
c == non b /\ true
And the conclusion is the same as yours (hopefully also without error). Is
this too long-winded in general?
I understood your logic; only one of d and c
can be true. But how would that be formalized, apart from what I just wrote?
(Also, what would be appropriate hints where I did not provide any? Were the
other hints okay?)
I have a possible solution to the Excalibur problem, which I will write up tomorrow.
+j
I don't see how what you said is different from what I've said. He is not telling us whether he is a knight or knave, that is, his status. What does that mean? It means that the things he says are not sufficient to know his status. Isn't that what 'tell' means? To bring someone to a state of knowledge through speech?
+j
Unless you take it very very literally, where "I'm not telling you whether I'm a knight or a knave." means: "I am neither uttering the words 'I am a knight.' nor 'I am a knave.' ." . Such a statement is true, which would imply that he is a knight. Is that the answer that you're looking for?
I think that's twisting the meaning of the word 'tell' . Isn't it true that he _has_ told us his status? His statement communicated his status.
To decide in general whether someone has told us X , we need to ask: "Can we conclude X from his statement?" . Reasoning happens in a context, so this is equivalent to saying: "Given the context, can we conclude X from his statement?" . But his statement is in the context as well, so this is equivalent to: "Given the context, can we conclude X ?" . And that was my translation.
+j
He is not telling us whether he is a knight or knave, that is, his status. What does that mean?
No. The inhabitant's statement means that he is not telling us whether he is a knight or knave.Unless you take it very very literally, where "I'm not telling you whether I'm a knight or a knave." means: "I am neither uttering the words 'I am a knight.' nor 'I am a knave.' ." . Such a statement is true, which would imply that he is a knight. Is that the answer that you're looking for?
I think that's twisting the meaning of the word 'tell' . Isn't it true that he _has_ told us his status? His statement communicated his status.
The inhabitant is not telling us whether he is a knight or a knave.
If I say: "My age is greater than 24 and less than 26." , does that mean that "I have told you my age." equivales false?! Or put another way, isn't it blatantly contradictory to say something like: "My card is a red 7, not hearts... but I'm not telling you what my card is!" ?
To 'tell' is to allow someone to tell.
+j
* * *
Here is the problem statement.
> One day a stranger came across two inhabitants B and C and asked `Is
> the fabled sword Excalibur on this island?' B answered, `If C is a
> knave then Excalibur is on this island.' while C said, `I never
> claimed that Excalibur is not on this island!'
> The stranger pressed for a definite answer whereupon one of the two
> replied and the stranger knew whether or not Excalibur was on the
> island.
>
> The stranger related this exchange to a friend who remarked `Whichever
> one it was who answered, suppose the other had answered instead. Could
> you have determined if Excalibur was on the island?' The stranger
> answered and then his friend knew whether Excalibur was on the island.
>
> Is Excalibur on the island?
As usual, I let b and c denote respectively that B and C are knights. Furthermore, I let e denote that Excalibur is on the island.
Using the Fundamental Theorem, I conclude (0) and (1) from the inhabitants' statements:
(0) b == c \/ e
(1) c == ¬(C said ¬e) .
(I prefer c \/ e to the less symmetric but more literal translation ¬c => e .)
* * *
Next we learn that one of the two inhabitants says something which allows the stranger to conclude the status of Excalibur. Let's introduce some terminology: Let P be the inhabitant who makes the statement, and call his (boolean) statement x . We call the other inhabitant Q . Booleans p and q denote the knighthood of P and Q , as usual. From the fundamental theorem we have:
(2) p == x .
Since the stranger learns the status of Excalibur, one way or the other, we introduce a new variable which will help to simplify a case analysis:
s == "the stranger learns that Excalibur is on the island"
¬s == "the stranger learns that Excalibur is not on the island" ,
which of course yields:
(3) e == s .
From (2) and (3) we conclude:
(4) p == x == e == s .
Thus armed, we turn to the end of the problem, where the stranger's friend asks what could be concluded, had the other inhabitant made the statement. We calculate:
"the other inhabitant made the statement"
== { Fundamental Theorem }
q == x
== { (4) }
q == p == e == s
== { p,q are b,c }
b == c == e == s
== { (0) }
c \/ e == c == e == s
== { golden rule }
c /\ e == s .
* * *
Finally, we consider two cases.
If the stranger learned that Excalibur is on the island, then s is true. Hence, if the other inhabitant made the statement, c /\ e would be true, which implies e . So, in this case, the stranger's answer to his friend's question would be "Yes." .
On the other hand, if the stranger learned that Excalibur is not on the island, then s is false. Hence, in the other inhabitant made the statement, c /\ e would be false, that is, ¬c \/ ¬e holds. This is too weak to imply ¬e , hence in this case, the stranger's answer to his friend's question would be "No." .
Thus Excalibur is on the island equivales that stranger's answer is "Yes." .
(I don't see how we can do better than this: We have as much information as the stranger's friend had before his question was answered. If his friend needed the answer, so do we.)
* * *
Notice that we did not use (1) . We calculate:
¬c
== { (1) }
(C said ¬e)
=> { Fundamental Theorem }
c == ¬e
== { using the first line }
false == ¬e
== { predicate calculus }
e ,
equivalently, c \/ e . Then from (0) we may conclude b . As far as I can see, this allows to conclude c ≠≠ e in case ¬s , but that is still too weak to conclude ¬e .
+j
A: Are you sworn to an oath of silence?
B: I'm not telling.
I'd say that B's statement is contradictory, which is why we interpret it as a joke: He doesn't intend it to be taken seriously. (Knights and knaves are not permitted to joke!)
+j
C said he never claimed that excalibur is not on the island. If C is a
knave, then C has said that that excalibur is not on the island and
hence if C is a knave then excalibur is on the island. B said that if C
is a knave then excalibur is on the island hence B is a knight.
Now we don't know who answered the second question or what the answer
was so we embark on a case analysis:
0. B said yes hence excalibur is on the island.
1. B said no hence excalibur is not on the island.
2. C said yes: If excalibur is not on the island then C is a knave, but
we know that if C is a knave then excalibur is on the island. Hence C is
a knight and excalibur is on the island.
3. C said no: In this case we cannot decide if excalibur is on the
island, but we know that the stranger did decide, so this case is ruled out.
***
The stranger was asked if he knew whether or not he could have decided
if the inhabitant who did answer had answered. Once again we analyse the
cases:
0. B said yes
The stranger would suppose that C had answered. If C said yes then
excalibur is on the island since B is not a knave. If C had answered no,
then the stranger could not have decided.(Why?)
1. B said no.
If C had answered, the stranger would not have been able to determine if
excalibur is on the island (Why?)
2. C said yes.
The stranger would have supposed B had answered. As B is a knight he
could have determined whether excalibur is on the island.
***
In case 0 the stranger doesn't know whether or not he could have
determined if excalibur is on the island.
In case 1 the stranger does know whether or not he could have determined
if excalibur is on island (he could not have.)
In case 2 the stranger does know whether or not he could have determined
if excalibur is on island (he could have.)
As the friend did know whether the fountain of youth was on the island,
the stranger must have answered that he could not have determined
whether excalibur was on the island i.e. case 0.
So excalibur is on the island.
E.
But the biggest disappointment was to see that I had misinterpreted the problem statement in two ways where it was ambiguous.
* "The stranger pressed for a definite answer whereupon one of the two replied" did not communicate to me that one of the two said 'yes' or 'no' to the question "Is Excalibur on the island?" . I only read this to mean that they said something, and the stranger thereby concluded whether or not Excalibur was on the island.
* "Whichever one it was who answered, suppose the other had answered instead. Could you have determined if Excalibur was on the island?" did not communicate to me that the other gave some (any) answer, but instead that the other person said _the exact same thing_ .
Boo for poor problem statements. I look forward to trying to "calculify" your answer.
Incidentally, it seems you adapted this problem from one about a "fountain of youth" . Now that the answer is out in the open, can you quote your source?
+j
E.