# Knights and Knaves Puzzle

On the island of knights and knaves, one of the inhabitants says "If I am a knight, then I will eat my hat."

Will the inhabitant eat his hat?

• Possible SPOILER : Is some meta information needed? As in "knaves always lie"? – Eric Duminil Feb 18 '18 at 16:22
• Constructivism says "Wait and see what he does" – David Tonhofer Feb 18 '18 at 16:33
• More to the point, what colour is the hat? – Rand al'Thor Feb 18 '18 at 17:43
• Note for any non-native English speakers: "If <x>, then I will eat my hat" is an idiom no longer in common use. It isn't a statement of fact at all, but is instead a statement of probability. It means that the speaker feels <x> to be so astonishingly unlikely that they'd be prepared to consume an inedible article of clothing if <x> should actually happen. As hats have gone out of fashion over the past hundred years, this phrase briefly switched to "I will eat my shoe", and then fell out of favour entirely. – Trevor Powell Feb 18 '18 at 23:22
• And yet, as if on cue: arstechnica.com/science/2018/02/… – Amit Naidu Feb 19 '18 at 3:56

Strictly speaking

yes and he's a knight,

because

the implication "if A then B" is false if and only if A is true and B is false.

So after the inhabitant said what he said

if he's a knight and he will eat his hat – he was telling the truth;
if he's a knight and he won't eat his hat – he lied;
if he's a knave and… whatever – he was telling the truth.

So

there is no way a knave could say this and act as a knave. It would be a paradox.

• "If A then B" is the "implies" operator and it is only false if A is true and B is false, not the other way round. – Dancrumb Feb 18 '18 at 5:45
• @Dancrumb Yes, I messed this line up, it's better now. The conclusions seem right though. I guess I was thinking right, writing this particular line wrong. Thank you for your input. – Kamil Maciorowski Feb 18 '18 at 6:04

The inhabitant will eat their hat

Given that Knights always tell the truth and Knaves always lie:

If a knight makes that statement, he will eat his hat, and if a knaves makes that statement, everything in that statement would be the opposite. This means that is he is a knight, he will not eat his hat. If he is a knave, he will eat his hat.

• sniped so hard oops – Quintec Feb 18 '18 at 2:29
• yeah you answered 21 sec after me. – kraby15 Feb 18 '18 at 2:31
• This is incorrect. See my comment on the other answer. – jpmc26 Feb 18 '18 at 4:35

Undetermined.

Because

Let's look at the two possibilities:
1. They are a knight. In this case, they will eat their hat, as they have told the truth.
2. They are a knave. In this case, they have lied. The negation of their statement is "there exists a knight that would not eat their hat". This does not tell us anything about knaves' attitudes toward hat-eating.
Since there are cases in which they eat a hat, and also cases in which they could avoid hat-eating, we cannot conclude if hat-eating will or will not occur.

• Actually, it's not undetermined. $A \implies B$ is logically equivalent to $(\neg{A}) \lor B$, so the negation in your second case (Assume 'They are a knave') is $A \land \neg{B}$. If we take knights and knaves to be logical complements, that negation (i.e. a knave's 'underlying reality') would say that (s)he is an unconditionally non-hat-eating knight. Regardless of dietary preferences, that is a contradiction, so case 2 should be discarded, leaving just case 1. – Lawrence Feb 18 '18 at 11:45
• Yeah... except the knave only has to be lying, not inverting the truth of the whole statement. If the knave's statement is A->B, the truth could be A->!B just as easily as it could be !(A->B) – Dancrumb Feb 18 '18 at 17:05
• @Dancrumb In these liar puzzles, 'lying about a logical statement $x$' is commonly taken to be 'telling the truth about the logical statement $\neg x$'. – Lawrence Feb 19 '18 at 10:53

We have two hyphoteses here:

1. He is a knight.
2. He is a knave.

So, let's give some symbols for that:

$A$: He is a knight.
$B$: He will eat his hat.

Given:

a.

$(A \rightarrow B) \leftrightarrow A$
Explanation: The sentence "if he is a knight, he will eat his hat." is true if, and only if, he is a knight.

This means that what he told is true if, and only if, he is a knight and is necessarily false if he is not.

This can be simplified by...

...replacing the implication in $a$ with an OR:

... producing:

b.

$(\lnot A \lor B) \leftrightarrow A$
Explanation: The sentence "he is not a knight or he will eat his hat." is true if, and only if, he is a knight.

Let's see each of the hypothesis:

1c.

Assuming the hypothesis 1 is true:
$A = \text{true}$
Explanation: He is a knight.

1d.

By replacing $A$ as $\text{true}$ (from $1c$) in $b$:
$(\lnot \text{true} \lor B) \leftrightarrow \text{true}$
Explanation: The sentence "he is not a knight (i.e. not true) or he will eat his hat." is true if, and only if, he is a knight (i.e. true).

Simplifying that:

1e.

$(\text{false} \lor B) \leftrightarrow \text{true}$
The sentence "false or he will eat his hat" is true.

1f.

$B \leftrightarrow \text{true}$
The sentence "he will eat his hat" is true.

1g.

$B$
He will eat his hat.

2c.

Assuming the hypothesis 2 is true:
$A = \text{false}$
Explanation: He is not a knight.

2d.

By replacing $A$ as $\text{false}$ (from $2c$) in $b$:
$(\lnot \text{false} \lor B) \leftrightarrow \text{false}$
Explanation: The sentence "he is not a knight (i.e. not false) or he will eat his hat." is true if, and only if, he is a knight (i.e. false).

Simplifying that:

2e.

$(\text{true} \lor B) \leftrightarrow \text{false}$
The sentence "true or he will eat his hat" is false.

2f.

$\text{true} \leftrightarrow \text{false}$
The sentence "true" is false.

2g.

$\text{false}$

What that means?

Hypothesis 2 implies a contradiction (it leads to $\text{false}$ as a conclusion). It is not just the case that this is because the inhabitant is a knave and told a lie, this is what we assumed in this hypothesis. It really means that the hypothesis 2 simply is not true.

Therefore:

Hypothesis 1 is true, he is a knight and will eat his hat.

• f is not a contradiction. It is a sentence with a clear logical value of False that does not depend on the truth-value of the statement "he will not eat his hat". – Dancrumb Feb 18 '18 at 5:43
• @Dancrumb "He is a knight and he is not a knight" is a contradiction. – Victor Stafusa Feb 18 '18 at 6:09
• @Dancrumb By obtaining "false" out of a hypothesis by deduction, we just proved that the hypothesis is... well ...false. – Victor Stafusa Feb 18 '18 at 6:11
• Where is $a$ coming from? – Eric Duminil Feb 18 '18 at 16:28
• @EricDuminil Yes, if he is a knave, then the sentence "If he is a knight, he will eat his hat" is true. Therefore he couldn't have said it, since he's a knave and the sentence is true. Since we're given that he did say it, we can only conclude he cannot possibly be a knave. – aschepler Feb 18 '18 at 23:06

Yes. If the inhabitant is a knight, then he must eat his hat, as he is telling the truth. If the inhabitant is a knave, then he also must eat his hat, since if he didn't he would tell the truth.

• This is incorrect. $p \implies q$ is only falsified by $p \land \neg q$. If the speaker is a knave, p is false, so q doesn't matter, which means the statement may be true regardless of whether the speaker eats his hat. – jpmc26 Feb 18 '18 at 4:28
• @jpmc26 yes, technically, but based on the fact that there seems to be one answer, and common logic, this answer makes the most sense. If the person was a knave and made the statement, and didn’t eat his hat, I would be viewed by normal people as a true statement. – Quintec Feb 18 '18 at 22:41
• @jpmc26 Right, my mistake. – HolyBlackCat Feb 18 '18 at 22:51

One of the inhabitants says

If I am a knight, then I will eat my hat.

From this sentence, I can conclude that the inhabitant does not know whether if he/she is Knight or Knaves, because he/she says "if I am a knight". so he/she is not sure,

because if he/she was sure,

he would say "if I were a knight, I would", that would conclude that he/she would be a knave, if knights would be telling the truth, or knight if he/she would be telling a lie.

So,

the given information is inconclusive to infer whether if the inhabitant is a knight or knave or the inhabitant's English is kinda poor.

Extracting from my first answer, but sticking with the liars tag, the answer is;

No

Because

Knights are not liars, therefore would not make the statement in the first place, the intent of which is to imply the subject is not a knight. A lie.

.

Knaves are liars and as such are the only inhabitants likely to make such a statement. However as liars, they would not follow through.

IF we are assuming Knights tell the whole truth, and Knaves fully Lies.

The statement "If I am a knight, then I will eat my hat." If the statement is true then the inhabitant (the knight) will eat their hat at some point in the future. If the statement is false then the inhabitant (a knave) has told us that A Knight will eat their own hats, which means that Knight do not eat their hats. Also He can choose to eat his Hat since he told a lie about knights eating hats

By my logic, the inhabitant will eat the hat in 2 of 3 possibilities; 1) Inhabitant is a knight and therefore eats his hat 2) Inhabitant is a knave and chooses not to eat his hat 3) Inhabitant is a knave and eats is hat because Knaves chooses to eat hat

• "If the statement is false then the inhabitant (a knave) has told us that A Knight will eat their own hats" - not necessarily. All he's saying is that if HE is a knight, then HE will eat his hat - nothing about ALL knights. – Rand al'Thor Feb 18 '18 at 17:43

It is true: the speaker will eat their hat, and in fact, is a knight.

If the speaker is a knight they are telling the truth and will eat their hat - that part is easy.

If the speaker is a knave then they are lying. So we have to figure out what the negation of "if I am a knight, then I will eat my hat" is.

Some have argued that

if I am a knight, then I will eat my hat

means

(I am a knight) $\to$ (I will eat my hat).

This means the same as

$\neg$((I am a knight) $\wedge$ $\neg$(I will eat my hat)),

so its negation is

((I am a knight) $\wedge$ $\neg$(I will eat my hat)),

which is the same as making the two statements

I will not eat my hat

and

I am a knight.

But the second of these is a contradiction --- once we account for its being a lie, the knave's statement implies that the knave is a knight. So if we interpret the statement as meaning "(I am a knight) $\to$ (I will eat my hat)", then it follows that the speaker is a knight, and therefore will eat their hat.

However, the interpretation of the statement as a logical implication is a bit suspect. If we stick with a more natural language interpretation then the negation of

if I am a knight, then I will eat my hat

is

it is not the case that if I were a knight, then I would eat my hat.

It seems at first glance that this is a perfectly consistent thing for a knave to say. It only talks about what would happen if the knave were a knight, but since the knave is not in fact a knight the statement is simply irrelevant, which means that the knave can say it, and then eat their hat, or not, according to their whim.

However, the knave (presumably) knows very well that knights always tell the truth, and that if a knight were to say "if I am a knight, then I will eat my hat", then they would eat their hat. This means that the statement

it is not the case that if I were a knight, then I would eat my hat.

is actually false, or to put it another way, the statement

if I am a knight, then I will eat my hat

is true (even if spoken by a knave), and therefore can't be spoken by a knave.

So whichever way we interpret it, the speaker must be a knight, and will eat their hat.

(Some other answers have asserted that the negation of

if I am a knight, then I will eat my hat

is

there exists a knight who will not eat their hat,

but I don't think that's right. The negation of this last statement is

all knights will eat their hats,

which is not at all the same as "if I am a knight, then I will eat my hat." The original statement refers to a specific knight - the one who has uttered the statement - and is not a universal statement about all knights.)

No

Because

a knight's hat is made of metal and no self respecting knight would try to eat a metal hat and therefore would not make such a statement. On the other hand, a knaves hat is made of felt or leather which is edible (kind of).