Qm
Foundational

Knights, Knaves and Truth-Tellers

A classic logic-puzzle family where knights always tell the truth and knaves always lie, so the trick is to reason about what a statement implies rather than whether it sounds true.

Prerequisites: How to Attack a Brainteaser

Knights and knaves puzzles put you on an island where every inhabitant is either a knight, who always tells the truth, or a knave, who always lies. You're given a few statements from a handful of people and asked to work out who is which, or sometimes just to work out one fact, without ever fully identifying everyone. The trick that trips people up is treating a statement as evidence about the world directly ("he says it's raining, so maybe it's raining"). Instead you have to reason about the statement conditional on the speaker's type: if a knight says X, then X is true; if a knave says X, then X is false. You then check which assignment of knight/knave labels makes every statement consistent with its speaker's type.

The classic self-referential trap is a person who says "I am a knave." A knight can't say this, because it would be a true statement admitting to being a knave, contradiction. A knave can't say it either, because it would be a false statement, meaning the speaker actually is a knave, but a knave's statements must be false, so this would make it true, contradiction again. The statement is simply impossible for anyone on the island to make, which is itself useful information in a puzzle where such a line appears attributed to a specific person: it tells you the puzzle intends a paradox device, or that you've mis-parsed who is speaking.

Compound statements are where most solving time goes: "A says: B is a knave, and I am a knight" requires testing A as a knight (both clauses must then be true) and as a knave (the whole conjunction must then be false, which happens if either clause is false) separately, then checking the rest of the puzzle for consistency under each case.

Never read a knight/knave statement as evidence about the world, read it as a claim conditional on the speaker's type, then test each possible assignment of knight/knave labels for internal consistency across every statement at once.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. Ask and answer about this concept. Off-topic gets removed.
  2. No homework dumps. Show what you tried first.
  3. Corrections are welcome. Cite a source when you claim an error.

Loading discussion…

Related concepts

Practice in interviews

Further reading

  • Smullyan, What Is the Name of This Book?
ShareTwitterLinkedIn