Logic

Logic Grid Puzzles and the Zebra Problem

Five houses, five nationalities, five drinks. The puzzle that taught a generation how to think in constraint tables, and how to build your own.

Logic Grid Puzzles and the Zebra Problem
The classic five-by-five elimination grid. Illustration: PuzzleMakers

Five houses in a row, each a different colour, each occupied by a person of a different nationality, each of whom drinks a different beverage, smokes a different brand and keeps a different pet. Fifteen clues. Two questions: who drinks water, and who owns the zebra?

The Zebra Puzzle first appeared in a magazine in 1962 and has been reprinted, adapted and misattributed ever since. It is the canonical example of a constraint satisfaction problem that a person can solve on paper, and it is the ancestor of every logic grid puzzle in every puzzle magazine sold today.

The structure

Every logic grid puzzle has the same shape: a set of positions, several attribute categories, and exactly one value from each category assigned to each position. The clues constrain the assignment; the solution is the unique assignment consistent with all of them.

The reason it works on paper is the elimination table. Draw a grid crossing every category against every other, and each clue lets you write X in some cells and a tick in others. A tick in one cell forces X across its entire row and column. That cascade is the whole technique.

You are not searching for the answer. You are removing everything that is not the answer, and seeing what survives.

The three clue types

Clues in this genre come in three flavours, and knowing which is which tells you how to use them.

  • Direct assignments. The Norwegian lives in the first house. Enter it, cascade, done. These are free and should be used first.
  • Direct exclusions. The person who drinks coffee does not keep dogs. One X. Cheap but rarely decisive alone.
  • Positional relations. The green house is immediately to the right of the ivory house. These are the expensive ones, because they constrain pairs rather than cells, and they are where the real deduction lives.

Positional clues are best handled by enumerating the possible placements rather than trying to reason about them abstractly. Green-right-of-ivory has exactly four possible positions in a five-house row, and three of them usually die immediately when you check them against the direct assignments.

Solving the zebra puzzle without guessing

The standard route is roughly this. Place the direct assignments. Apply the positional clue about the adjacent houses, which usually pins the colour ordering to one or two possibilities. Use the middle-house clue to break the tie. From there the beverage category resolves, and each resolved category makes the next one cheaper.

What you should never need is a guess. A well-constructed logic grid puzzle is solvable by pure elimination, which is the same guarantee that makes any deduction puzzle trustworthy. If you find yourself picking one of two options and seeing what happens, the puzzle is either flawed or you have missed a clue.

Constructing one

Building a logic grid puzzle is easier than it looks and harder to do well than it looks.

  1. Write the solution first. Fill in the complete assignment table. Every clue you write afterwards will be a true statement about it, which makes contradictions impossible by construction.
  2. Generate far too many clues. Write every true statement you can, of all three types.
  3. Remove clues one at a time. After each removal, check the puzzle still has a unique solution. Stop when removing any further clue makes it ambiguous.
  4. Check the removal order does not matter much. A puzzle that only works if the solver reads the clues in the order you wrote them is a bad puzzle.

Step three is where the quality comes from, and it is also where most amateur puzzles fail. A puzzle with twenty clues where twelve would do is not harder, it is just longer.

Related: the same elimination reasoning underpins nonograms, and the arithmetic-constrained cousins are covered in Kakuro, Killer and the rest.

Why the format survived

Logic grids are the only mainstream puzzle format where the solving method is completely explicit. There is no hidden technique, no vocabulary to acquire, no cultural knowledge required. Everything you need is in the clues, and the elimination table is teachable in about ninety seconds.

That accessibility is why the format shows up in aptitude tests, in classrooms, and in the introductory chapter of most books on formal logic. It is also why it is a good gateway puzzle for someone who says they are bad at puzzles, because the failure mode is always a missed clue rather than a missing piece of knowledge.

If you want to extend the habit into shorter formats, a well-organised riddle collection exercises the same constraint-narrowing instinct in a single paragraph, and a daily one-clue cryptic is a good bridge from pure logic into wordplay - the reasoning is identical, only the raw material changes.

PA
Written by Priya Anand Counts things so constructors do not have to: difficulty curves, word frequency, grid statistics. More from Priya Anand →

Keep reading

All Logic →

One good puzzle a week. No filler.

New articles, constructor notes and a fresh mini crossword every Sunday. Free, and easy to leave.