Knights and squires

from Wikipedia, the free encyclopedia

Knights and Squires is a logic puzzle by Raymond Smullyan .

On a fictional island, all residents are either knights who always tell the truth or squires (also called villains) who always lie . In the logic puzzle, a visitor comes to the island and meets some residents. Usually, he has to deduce from the statements of the residents which species they belong to, but sometimes also find out something else. There are also puzzles where the visitor has to come up with a yes-no question that enables them to find out what they want to know.

An early example of this type includes three residents A, B, and C. The visitor asks A what he is but does not hear the answer. Then B says: “A said he was a squire”, and C: “Don't believe B, he's lying!” To solve the puzzle you have to know that no resident can say he is a squire. Therefore B's statement is wrong, so he is a squire. C's statement is correct, so he is a knight. Since A said "I am a knight" it is impossible to find out what he is.

In some variants there are also residents who are alternate, that is, alternately lying and telling the truth, or spies who say what they want. Another possible complication is that residents answer yes-no questions in their own language while the visitor only knows that “bal” and “da” mean “yes” and “no”, but not in which order. This type of puzzle inspired the most difficult puzzle in the world .

Examples

A large class of elementary logic puzzles can be solved using Boolean algebra and logical truth tables. Boolean algebra and its simplification process will help understand the following examples.

Johannes and Wilhelm are both residents of the Isle of Knights and Squires.

Question 1

Johannes says: We are both squires.

Who is what?

Question 2

Johannes: If and only then when Wilhelm is a squire, I'm a squire.

Wilhelm: We are of different types.

Who is who?

Question 3

Here is the most popular variant of Knights and Squires:

Johannes and Wilhelm stand at a fork in the road . The visitor knows that one of them is a squire, the other a knight, but not which one. He also knows that one path to death leads others to freedom. With which yes-no question does he find his way to freedom?

This version of the puzzle was popularized in a scene from the fantasy film Labyrinth in which Sarah ( Jennifer Connelly ) finds two doors, each guarded by a two-headed knight. One door leads to the center of the castle, the other to the safe doom.

Answer to question 1

John's statement is equivalent to:

"Johannes is a squire and Wilhelm is a squire."

If John were a knight, he didn't say he was a squire because he was lying about it. So the claim "John is a squire" is true.

Since Knappen lies and one statement is true, the other statement must be false. So the assertion “Wilhelm is a squire” is necessarily wrong, ergo Wilhelm must be a knight.

Solution: Johannes is a squire and Wilhelm is a knight.

Answer to question 2

Johannes is a squire and Wilhelm is a knight.

In this scenario, John says the equivalent of “We are not of different types” (that is, both knights or both squires). Wilhelm says the opposite. Since both contradict each other, one has to lie, the other tell the truth, so one must be a knight and one a squire. Since the latter is what Wilhelm said, Wilhelm is the knight, so John is the squire.

Answer to question 3

In order to find out which path leads to freedom, the following question should be asked: "Will the other man tell me whether your path leads to freedom?"

If the man says “yes”, then his path does not lead to freedom; if he says “no”, then he does it.

If the question is asked of the knight whose path leads to freedom, he will say “no” because this is the truth that the squire would lie and say “no”. If the knight's path does not lead to freedom, he will say “yes”, as the squire would say so.

If you ask the question to the squire whose path leads to freedom, he will say “no” and thus lie, because the knight would say “yes”. If his path does not lead to freedom, the squire said “yes” because the knight would say “no”.

For this solution, squires and knights must know each other's identity.

Another solution is the question: "What would your answer be, I asked you whether your path leads to freedom?"

If the person asked answers "yes", then his path leads to freedom; if he answers "no", then not.

The knight is telling the truth that he would tell the truth.

The squire would have to lie about lying.

Web links