Episode 07

Logic Puzzles 101: Knights, Knaves, and Liars

38 minutes Logic • Formal Reasoning May 16, 2026

Raymond Smullyan's island of truth-tellers and liars is one of the most elegant puzzles ever devised. Today we explore why — and learn to solve increasingly devious variations without going mad.

Audio coming soon — read the full episode below

What We Cover in 38 Minutes

  • Raymond Smullyan: mathematician, logician, magician, and puzzle genius
  • The island of knights and knaves — and why the setup is perfect
  • The fundamental technique: case analysis for truth-teller/liar puzzles
  • Classic one-person, two-person, and three-person variants with solutions
  • The single-question trick: asking a stranger to determine a path
  • From recreational puzzles to formal logic: what knights and knaves actually teach
  • Self-referential puzzles and Gödel connections (accessible version)
  • Zebra Puzzles and constraint logic: the next level of logical puzzling
  • Logic puzzle variants: Normals, Spies, Alternators, and temporal puzzles
  • Five solvable puzzles with step-by-step walkthroughs

Raymond Smullyan and the Island of Logic

In 1978, a mathematician, pianist, and former stage magician named Raymond Smullyan published a book called What Is the Name of This Book? The title is a meta-joke — the book is partly about self-reference and paradox — but the content inside launched a thousand logic puzzle enthusiasts. Smullyan described an island where every inhabitant was either a knight (who always tells the truth) or a knave (who always lies), and presented a series of puzzles to determine which residents were which, based on what they said.

Smullyan didn't invent the underlying idea — liars paradoxes appear in ancient Greek philosophy, and truth-teller/liar riddles appear in folklore worldwide. What he did was formalize the structure, extend it brilliantly in dozens of directions, and show that these seemingly simple puzzles connect to some of the deepest ideas in mathematical logic.

He followed up with The Lady or the Tiger? (1982), Alice in Puzzle-Land (1982), To Mock a Mockingbird (1985) — on combinatory logic — and many more. Smullyan lived to 97 (1919–2017) and was still writing and playing piano professionally in his 90s. When he wasn't writing logic books, he was doing stage magic or composing music. He's one of the most genuinely extraordinary figures in the history of recreational mathematics.

The Setup: Why It Works So Well

The beauty of the knights and knaves framework is that it creates a puzzle system with absolutely clear rules. There's no ambiguity, no trick language, no cultural knowledge required. Every puzzle operates under the same two axioms:

1. Knights always tell the truth. Every statement a knight makes is true.
2. Knaves always lie. Every statement a knave makes is false.

That's it. From these two rules, a remarkably rich space of deductive puzzles emerges. The elegance is in the simplicity of the axioms combined with the complexity of the inferences they permit.

Smullyan the Magician

Before his career in logic, Raymond Smullyan earned money as a stage magician while studying mathematics. He attended the University of Chicago and Princeton, where he got his PhD under Alonzo Church (the same Church whose work underpins computer science). He then taught at Princeton, Yeshiva University, and the City University of New York. He attributed his talent for puzzles partly to his magician's training: both require setting up expectations and then elegantly violating them.

The Fundamental Technique: Case Analysis

The master tool for solving knights and knaves puzzles is systematic case analysis. You hypothesize that a given person is a knight, check whether all their statements are consistent with that assumption, then hypothesize they're a knave and check again. One hypothesis should lead to contradiction; the other should be consistent. Let's walk through the classic versions.

One Person, One Statement

Puzzle 1 — The Basic Case
You meet an inhabitant who says: "I am a knave."
Is this person a knight or a knave?
Solution: This is actually a paradox disguised as a puzzle! Case 1: Assume knight. Knights tell truth. But a knight cannot truthfully say "I am a knave." Contradiction. Case 2: Assume knave. Knaves lie. If they're a knave and say "I am a knave," they're telling the truth — but knaves can't tell the truth. Contradiction again.

Conclusion: No inhabitant of this island can make this statement. A well-formed puzzle would never present this scenario as a straight question. This is Smullyan showing you the limits of the system — a warm-up for the self-reference chapter.
Puzzle 2 — The Classic Opener
You meet an inhabitant who says: "I am a knight."
Is this person a knight or a knave?
Solution: Case 1: Assume knight. Knights tell truth. Saying "I am a knight" is a true statement. Consistent! Case 2: Assume knave. Knaves lie. Saying "I am a knight" is a lie (since they're actually a knave). Consistent!

Conclusion: We cannot determine their type. Both a knight and a knave can say "I am a knight." This puzzle has no solution — it teaches you that not all situations permit logical resolution. This is also important: knowing when a puzzle is underdetermined is a skill.

Two People: Where It Gets Interesting

Puzzle 3 — Two Inhabitants
You meet A and B. A says: "We are both knaves." B says nothing.
What are A and B?
Solution: Case 1: Assume A is a knight. Knights tell truth. "We are both knaves" would have to be true — but then A would be a knave, contradiction. So A cannot be a knight.

Case 2: A must be a knave. Knaves lie. "We are both knaves" is false. The only way this statement is false is if at least one of them is NOT a knave. Since A is a knave, B must not be a knave. Therefore B is a knight.

Conclusion: A is a knave, B is a knight.

The Single-Question Trick

This is the most famous result in knights and knaves logic, and it's one of the most elegant pieces of puzzle reasoning ever devised. The setup: you're at a fork in the road. One path leads to safety, one to danger. There's an inhabitant of unknown type standing at the fork. You may ask exactly one yes-or-no question. What do you ask?

The solution depends on a beautiful symmetry. Instead of asking a direct question, you ask a meta-question: "If I asked you whether the left path leads to safety, what would you say?"

Let's check why this works:

If the inhabitant is a knight and left is safe: they would answer "yes" to the direct question, so they say "yes" to the meta-question. Correct.

If the inhabitant is a knave and left is safe: they would lie about the direct question and say "no" — but then they'd lie about what they would say and answer "yes" to the meta-question. The double lie cancels out to truth. Correct.

In every scenario, both knights and knaves give the true answer to "What would you say if I asked you X?" The meta-question neutralizes the lying behavior.

The Three Gods Problem

Philosopher George Boolos published what he called "the hardest logic puzzle ever" in 1996: Three gods — True, False, and Random — answer yes or no in their own language (where "ja" and "da" mean yes and no but you don't know which is which). You may ask three yes/no questions to any of the gods, in any order. Determine which god is which. This problem extends the single-question trick into genuinely demanding territory. Boolos's paper is freely available and includes a full solution — perfect for an afternoon of logical suffering.

From Puzzles to Formal Logic

Knights and knaves puzzles are recreational mathematics that translate directly into formal propositional logic. Each puzzle is a constraint satisfaction problem: find the truth-value assignment (knight/knave for each person) that satisfies all the statements simultaneously.

This connection to formal logic is why Smullyan used these puzzles as pedagogical tools. In his more advanced books, he moved toward modal logic (logic about what is necessarily or possibly true), temporal logic (statements whose truth varies over time), and ultimately toward the self-referential puzzles that illuminate Gödel's incompleteness theorems.

Gödel's first incompleteness theorem, roughly stated, says that any sufficiently powerful formal system contains statements that are true but cannot be proven within the system. The key move in Gödel's proof is constructing a statement that says, essentially, "This statement is not provable." Smullyan showed in Forever Undecided (1987) how this concept maps onto a knights-and-knaves-style framework involving "reasoners" rather than truth-tellers and liars. He made Gödel accessible to a genuinely broad audience — no small feat.

Puzzle Variants: The Ecosystem Beyond Knights and Knaves

The basic knights and knaves format is just the beginning. Smullyan and others have extended it in multiple directions:

Knights, Knaves, and Normals

"Normals" can say anything — true or false. Three-valued logic emerges when you can't assume all speakers are constrained.

Spies and Alternators

"Alternators" alternate between true and false statements. This makes temporal position in a conversation relevant to solution.

Day/Night Variants

Knights tell truth by day but lie at night; knaves the opposite. You must also deduce the time of day from available evidence.

Probabilistic Variants

Inhabitants tell truth with probability p. Now you're in Bayesian reasoning territory rather than pure deduction.

Zebra Puzzles

Five houses, five attributes each, fifteen constraints. No knights or knaves — pure constraint propagation. Often attributed to Einstein but origin uncertain.

Grid Deduction Puzzles

Nonograms, Sudoku, Nurikabe — place/fill/exclude based on constraints. Logic in two-dimensional space rather than propositional.

The Zebra Puzzle: Constraint Logic at Scale

The "Zebra Puzzle" (sometimes called Einstein's Riddle, though he almost certainly didn't write it) represents a different branch of logic puzzling. Instead of truth-tellers and liars, you're given a set of constraints that narrow down a configuration:

Five houses in a row, each painted a different color. Each has an owner of a different nationality, who keeps a different pet, drinks a different beverage, and smokes a different brand. Fifteen clues are given. The question: who keeps the fish?

Solving this requires systematic constraint propagation rather than case analysis. You build a grid of possibilities, use each clue to eliminate impossible combinations, and continue until only one configuration remains. It's satisfying in a completely different way than knights and knaves — methodical rather than sudden-insight.

Modern constraint logic programming languages like Prolog solve Zebra-style puzzles almost instantly. But solving one by hand, with pencil and a well-drawn grid, remains one of the most satisfying lunch-hour activities I know.

Why Logic Puzzles Matter Beyond Entertainment

There's a case to be made — and Smullyan made it — that logic puzzles are one of the best introductions to mathematical thinking that exist. They require no prior knowledge, they have clear unambiguous rules, they reward careful reasoning, and they provide immediate feedback: either your conclusion follows from the premises or it doesn't.

This is very different from most subjects where validity is fuzzy or depends on context. In a knights and knaves puzzle, you cannot "sort of" solve it. The reasoning either holds or there's a flaw in it, and finding that flaw is educational in a way that being handed the right answer never is.

Cognitive scientists who study formal reasoning — particularly the research program of Philip Johnson-Laird at Princeton — have used logic puzzles extensively to study how humans actually reason, as opposed to how formal logic says we should. Johnson-Laird's "mental models" theory holds that people reason by constructing small-scale mental simulations of possible worlds rather than by applying abstract inference rules. Logic puzzles are a window into this process.

When you work through a knights and knaves puzzle, you're essentially building mental models: "If A is a knight, then the world looks like this. If A is a knave, the world looks like that." You're not applying modus ponens as a syntactic rule — you're simulating possibilities. This is why the puzzles feel natural even to people with no formal logic training, and why they're genuinely educational: they exercise the same cognitive machinery we use for real-world reasoning, but in a controlled environment where we can check our work.

A Final Challenge Puzzle

Puzzle 4 — The Advanced Case
You meet three inhabitants: A, B, and C.
A says: "Exactly one of the three of us is a knight."
B says: "Exactly two of the three of us are knights."
C says: "All three of us are knaves."
Who is a knight and who is a knave?
Solution: Start with C's claim "All three are knaves." If C is a knight, this is true — but then C is a knave, contradiction. So C is a knave.

Now try A: "Exactly one is a knight." We know C is a knave. If A is a knight, their statement is true, meaning exactly one (just A) is a knight. That makes B also a knave. Check B: B claims "Exactly two are knights." B is a knave, so this must be false — "not exactly two are knights" is true (only one is). Consistent!

Conclusion: A is a knight. B and C are knaves.

Notice how the solution required you to lock in one person's type first (C), then propagate through the others. This is the standard deduction chain in multi-person logic puzzles. Most puzzles of this type yield to the same methodical approach: find the person whose statement forces the most constraints, resolve them first, then continue from there.

Resources for Going Deeper

Listener Q&A

Q: How do I know when I've made a valid deductive step vs. when I've just assumed something?

This is the core metacognitive skill in logic puzzling. A valid deductive step follows necessarily from the premises — not "probably" or "likely," but necessarily. The test: if your premises are true, can your conclusion possibly be false? If yes, you've made an inference rather than a deduction. In knights and knaves puzzles, valid steps include: "If this knight says X, then X must be true" and "If this knave says X, then X must be false." Everything else requires additional premises. The feeling of certainty is not sufficient — check whether the step is formally valid.

Q: Can knights and knaves puzzles have multiple solutions?

Well-constructed ones shouldn't — a puzzle with multiple solutions is considered defective in the logic puzzle community. However, some puzzles are intentionally designed to be underdetermined, teaching you to recognize when more information is needed. Smullyan often included puzzles where the question is "Can you determine X?" rather than "What is X?" — and the correct answer is sometimes "No, the given information is insufficient to determine X." Recognizing underdetermination is as important a skill as finding solutions.

Q: I've seen variations where people sometimes lie and sometimes tell the truth. How do you solve those?

Those are "normal" type characters in Smullyan's taxonomy — people who can say anything. When a puzzle includes normals, case analysis becomes more complex because each normal person has two degrees of freedom (could be saying something true or false) rather than one. You typically need more constraints from other speakers to resolve a puzzle with normals. If a puzzle includes alternators (people who alternate true/false/true/false statements), you also need to track which position in the sequence each statement occupies. These are harder classes that reward careful bookkeeping over pure logical intuition.

Q: What's the connection between these puzzles and programming?

Direct and profound. Boolean logic — the foundation of all digital computing — is propositional logic made operational. AND, OR, NOT, XOR are the same connectives used in formal logic puzzles. Constraint satisfaction problems, which include logic puzzles, are a major research area in computer science with applications in scheduling, planning, hardware verification, and AI reasoning. Prolog, the logic programming language, can solve Zebra Puzzles in milliseconds by treating them as constraint satisfaction. If you find logic puzzles satisfying, you'll likely find formal methods in software engineering and computational logic rewarding too.