# 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"? Commented Feb 18, 2018 at 16:22
• Constructivism says "Wait and see what he does" Commented Feb 18, 2018 at 16:33
• More to the point, what colour is the hat? Commented Feb 18, 2018 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. Commented Feb 18, 2018 at 23:22
• And yet, as if on cue: arstechnica.com/science/2018/02/… Commented Feb 19, 2018 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.

• Contradiction, not paradox. A paradox can be resolved; a contradiction cannot ;) Commented Apr 21, 2018 at 0:13

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 Commented Feb 18, 2018 at 2:29
• yeah you answered 21 sec after me. Commented Feb 18, 2018 at 2:31
• This is incorrect. See my comment on the other answer. Commented Feb 18, 2018 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. Commented Feb 18, 2018 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) Commented Feb 18, 2018 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$'. Commented Feb 19, 2018 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". Commented Feb 18, 2018 at 5:43
• @Dancrumb "He is a knight and he is not a knight" is a contradiction. Commented Feb 18, 2018 at 6:09
• @Dancrumb By obtaining "false" out of a hypothesis by deduction, we just proved that the hypothesis is... well ...false. Commented Feb 18, 2018 at 6:11
• Where is $a$ coming from? Commented Feb 18, 2018 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. Commented Feb 18, 2018 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. Commented Feb 18, 2018 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. Commented Feb 18, 2018 at 22:41
• @jpmc26 Right, my mistake. Commented Feb 18, 2018 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. Commented Feb 18, 2018 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.)

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

This doesn't make sense for knight or knave. A knight wouldn't say that because it's implying they are not a knight when they are, which is a lie. Unless we are to take all meaning out of that phrase/idiom "then I will eat my hat" and take it solely literally as true. But, why would a knight say "If I am a knight" and why would they eat their hat? A knight would state the truth without ambiguity.

A knave would outright lie. The general meaning of "I will eat my hat" implies the rest of the sentence is not true. Which would mean the knave is telling the truth that he isn't a knight, which he can't do.

This is a puzzle asking us to use logic with an illogical statement for either choice.

• Hi @KDB, welcome to Puzzling SE. I believe your answer is along the same lines as Matt Stevens's ones? See their first and second answers. Commented Nov 2, 2021 at 12:29
• Oh wait, I just noticed that the answer by Oray is also along the same lines... Commented Nov 2, 2021 at 12:32

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).

A knight knows s/he is a knight, to make such a statement implies otherwise which is unknightly. While a knave knows s/he is a knave, it is possible they are the bastard son/daughter of a knight (assuming a hereditary system), leaving a vague but unlikely possibility a knave may be a knight. However a knave is also free to not follow through on such a rash promise should it be true.

Also

knights do not stoop to eating hats. They eat legs of lamb, beef or pork while knaves will eat almost anything. Hats are quite filling when needs must. Of course this implies a knave may eat their hat but a knight will not and that a knave needs to be hungry, which is a seperate consideration to whether they are a knight. Of course if they are now a knight, they should now be eating legs of lamb, beef or pork which beats eating hats.

And

a knave that is now found to be a knight has several problems. Their new hat is metal and inedible plus it is unknightly to participate in such speculation whilst a knight. Promotion therefore means the promises made as a knave no longer apply to the new knight.

Dunno if this is what the OP had in mind, but an interesting exercise nonetheless :-)