Knights and knaves
Encyclopedia
Knights and Knaves is a type of logic puzzle
Logic puzzle
A logic puzzle is a puzzle deriving from the mathematics field of deduction.-History:The logic puzzle was first produced by Charles Lutwidge Dodgson, who is better known under his pen name Lewis Carroll, the author of Alice's Adventures in Wonderland...

 devised by Raymond Smullyan
Raymond Smullyan
Raymond Merrill Smullyan is an American mathematician, concert pianist, logician, Taoist philosopher, and magician.Born in Far Rockaway, New York, his first career was stage magic. He then earned a BSc from the University of Chicago in 1955 and his Ph.D. from Princeton University in 1959...

.

On a fictional island, all inhabitants are either knight
Knight
A knight was a member of a class of lower nobility in the High Middle Ages.By the Late Middle Ages, the rank had become associated with the ideals of chivalry, a code of conduct for the perfect courtly Christian warrior....

s, who always tell the truth, or knave
Knave
Knave may refer to:* Knave , a British adult magazine*A male servant see also varlet*A journeyman*Another name for the Jack in a deck of cards*In knights and knaves logic puzzles, a person who always lies...

s, who always lie
Lie
For other uses, see Lie A lie is a type of deception in the form of an untruthful statement, especially with the intention to deceive others....

. 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, making C's statement true, so he is a knight. Since A's answer invariably would be "I'm a knight", it is not possible to determine whether A is a knight or knave from the information provided.

In some variations, inhabitants may also be alternators, who alternate between lying and telling the truth, or normals, who can say whatever they want (as in the case of Knight/Knave/Spy puzzles). A further complication is that the inhabitants may answer yes/no question
Yes-no question
In linguistics, a yes–no question, formally known as a polar question, is a question whose expected answer is either "yes" or "no". Formally, they present an exclusive disjunction, a pair of alternatives of which only one is acceptable. In English, such questions can be formed in both positive...

s in their own language, and the visitor knows that "bal" and "da" mean "yes" and "no" but does not know which is which. These types of puzzles were a major inspiration for what has become known as "the hardest logic puzzle ever
The Hardest Logic Puzzle Ever
The Hardest Logic Puzzle Ever is a title coined by American philosopher and logician George Boolos in an article published in The Harvard Review of Philosophy in 1996 for the following Raymond Smullyan inspired logic puzzle:Boolos provides...

".

Examples

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 will help with understanding the following examples.

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

Question 3

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
Fork in the road
A fork in the road is a metaphor, based on a literal expression, for a deciding moment in life or history when a major choice of options is required...

. 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 Death, and the other leads to Freedom. By asking one yes/no question, can you determine the road to Freedom?

This version of the puzzle was further popularised by a scene in the 1986 fantasy film, Labyrinth
Labyrinth (film)
Labyrinth is a 1986 British/American fantasy film directed by Jim Henson, produced by George Lucas, and designed by Brian Froud. Henson collaborated on the screenwriting with children's author Dennis Lee, Terry Jones from Monty Python, and Elaine May .The film stars David Bowie as Jareth the Goblin...

, in which Sarah (Jennifer Connelly
Jennifer Connelly
Jennifer Lynn Connelly is an American film actress, who began her career as a child model. She appeared in magazine, newspaper and television advertising, before making her motion picture debut in the 1984 crime film Once Upon a Time in America...

) finds herself faced with two doors each guarded by a two-headed knight. One door leads to the castle at the centre of the labyrinth, and one to certain doom. It had also appeared some ten years previously, in a very similar form, in the Doctor Who
Doctor Who
Doctor Who is a British science fiction television programme produced by the BBC. The programme depicts the adventures of a time-travelling humanoid alien known as the Doctor who explores the universe in a sentient time machine called the TARDIS that flies through time and space, whose exterior...

story Pyramids of Mars
Pyramids of Mars
Pyramids of Mars is a serial in the British science fiction television series Doctor Who, which was first broadcast in four weekly parts from 25 October to 15 November 1975.-Synopsis:...

.

Solution to Question 1

John is a knave and Bill is a knight.

John's statement can't be true because nobody can admit to being a knave (see Liar paradox
Liar paradox
In philosophy and logic, the liar paradox or liar's paradox , is the statement "this sentence is false"...

). Since John is a knave this means he must have been lying about them both being knaves, and so Bill is a knight.

Solution for Question 2

John is a knave and Bill is a knight.

In this scenario they are making contradictory statements and so one must be a knight and one must be a knave. Since that is exactly what Bill said, Bill must be the knight, and John is the knave.

Solution to Question 3

There are several ways to find out which way leads to freedom. One alternative is asking the following question: "Will the other man tell me that your path leads to freedom?"

If the man says "No", then the path does lead to freedom, if he says "Yes", then it does not. The following logic is used to solve the problem.

If the question is asked of the knight and the knight's path leads to freedom, he will say "No", truthfully answering that the knave would lie and say "No". If the knight's path does not lead to freedom he will say "Yes", since the knave would say that the path leads to freedom.

If the question is asked of the knave and the knave's path leads to freedom he will say "no" since the knight would say "yes" it does lead to freedom. If the Knave's path does not lead to freedom he would say Yes since the Knight would tell you "No" it doesn't lead to freedom.

The reasoning behind this is that, whichever guardian the questioner asks, one would not know whether the guardian was telling the truth or not. Therefore one must create a situation where they receive both the truth and a lie applied one to the other. Therefore if they ask the Knight, they will receive the truth about a lie; if they ask the Knave then they will receive a lie about the truth.

Note that the above solution requires that each of them know that the other is a knight/knave. An alternate solution is to ask of either man, "What would your answer be if I asked you if your path leads to freedom?"

If the man says "Yes", then the path leads to freedom, if he says "No", then it does not. The reason is fairly easy to understand, and is as follows:

If you ask the knight if their path leads to freedom, they will answer truthfully, with "yes" if it does, and "no" if it does not. They will also answer this question truthfully, again stating correctly if the path led to freedom or not.

If you ask the knave if their path leads to freedom, they will answer falsely about their answer, with "no" if it does, and "yes" if it does not. However, when asked this question, they will lie about what their false answer would be, in a sense, lying about their lie. They would answer correctly, with their first lie canceling out the second.

This question forces the knight to say a truth about a truth, and the knave to say a lie about a lie, resulting, in either case, with the truth.

Another alternative is to ask: "if, and only if, you agree with me in that you are both different, could you point me to Freedom?" The logic behind this being that the knave will be unable to answer since he cannot agree that both are different because he would be telling the truth. Therefore the knight would point you in the right direction.

Another alternative is to ask: "Is either one of the following statements correct? You are a Knight and at the same time this is the path to freedom; or you are a knave and this is not the path to freedom". More alternatives for a question to ask can be found using Boolean algebra.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK