Jump to content

Knights and Knaves: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Guille2015 (talk | contribs)
No edit summary
Guille2015 (talk | contribs)
No edit summary
Line 47: Line 47:
* By asking one yes/no question, can you determine whether John is a knight?
* By asking one yes/no question, can you determine whether John is a knight?


This version of the puzzle was further popularised by a scene in the 1980's fantasy film, [[Labyrinth(film)|Labyrinth]], in which Sarah ([[Jennifer Connelly]]) finds herself faced with two doors each guided by a two-headed knight. One door leads to the castle at the centre of the labyrinth, and one to certain doom.
This version of the puzzle was further popularised by a scene in the 1980's fantasy film, [[Labyrinth (film)|Labyrinth]], in which Sarah ([[Jennifer Connelly]]) finds herself faced with two doors each guided by a two-headed knight. One door leads to the castle at the centre of the labyrinth, and one to certain doom.


===Solution to Question 1===
===Solution to Question 1===

Revision as of 04:50, 3 September 2006

Knights and Knaves are a type of logic puzzle devised by Raymond Smullyan.

On a fictional island, all inhabitants are either knights, who always tell the truth, or knaves, who always lie. The puzzles involve a visitor to the island who meets small groups of inhabitants. Usually the aim is for the visitor to deduce the inhabitants' type from their statements, but some puzzles of this type ask for other facts to be deduced. The puzzle may also be to determine a yes/no question which the visitor can ask in order to discover what he needs to know.

An early example of this type of puzzle involves three inhabitants referred to as A, B and C. The visitor asks A what type he is, but does not hear A's answer. B then says "A said that he is a knave" and C says "Don't believe B: he is lying!"

To solve the puzzle, note that no inhabitant can say that he is a knave. Therefore B's statement must be untrue, so he is a knave, and C's statement must be true, so he is a knight. Since B is a knave, he will always lie. Therefore B was lying when he said that A said he was a knave. Therefore A must have said he was a Knight.

In some variations, inhabitants may also be alternators, who alternate between lying and telling the truth, or normals, who can say whatever they want. A further complication is that the inhabitants may answer yes/no questions in their own language, and the visitor knows that "bal" and "da" mean "yes" and "no" but does not know which is which.

Some Examples of "Knights and Knaves" puzzles

A large class of elementary logical puzzles can be solved using the laws of boolean algebra and logic truth tables. Familiarity with boolean algebra and its simplification process is a prerequisite to understand the following examples. In particular, to solve Question 2 you must understand that the only way that an "if X then Y" statement can be false is for X to be true and Y to be false.

John and Bill are residents of the island of knights and knaves.

Question 1

John says: We are both knaves.

Who is who?

Question 2

John: If Bill is a knave then I'm a knight.

Bill: We are different.

Who is who?

Question 3

Logician: Are you both knights?
John answers either Yes or No, but the Logician does not have enough information to solve the problem.
Logician: Are you both knaves?
John answers either Yes or No, and the Logician can now solve the problem.

Who is who?

Question 4

Here is a rendition of perhaps the most famous of this type of puzzle:

John and Bill are standing at a fork in the road. You know that one of them is a knight and the other a knave, but you don't know which. You also know that one road leads to Someplaceorother, and the other leads to Nowheresville.

  • By asking one yes/no question, can you determine the road to Someplaceorother?
  • By asking one yes/no question, can you determine whether John is a knight?

This version of the puzzle was further popularised by a scene in the 1980's fantasy film, Labyrinth, in which Sarah (Jennifer Connelly) finds herself faced with two doors each guided by a two-headed knight. One door leads to the castle at the centre of the labyrinth, and one to certain doom.

Solution to Question 1

This is what John is saying in a more extended form:

"John is a knave. Bill is a knave."

If John was a knight, he would not be able to say that he was a knave since he would be lying. Therefore the statement "John is a knave" must be true.

Since knaves lie, and one statement is true, the other statement must be false. Therefore the statement "Bill is a knave" must be false which leads to the conclusion that Bill is a knight.

The solution is that John is a knave and Bill is a knight.

Solution to Question 2

We can use Boolean algebra to deduce who's who as follows:

Let J be true if John is a knight and let B be true if Bill is a knight. Now, either John is a knight and what he said was true, or John is not a knight and what he said was false. Translating that into Boolean algebra, we get:

by de Morgan's theorem.

Therefore John is a knave and Bill is a knight. Although most people can solve this puzzle without using Boolean algebra, the example still serves as a testament of the power of Boolean algebra in solving logic puzzles.