How Our Logic Puzzles Are Made (and Why They Never Need Guessing)
Quick answer: Every puzzle starts as a random, complete answer. A program writes true clues about that answer and keeps adding them until a solver proves there is exactly one possible solution, then removes any clue that isn't needed and checks again. That's why no puzzle on Daily Zebra Puzzle ever requires a guess, and why everyone in the world gets the same puzzle on the same UTC day.
We think you should know how the puzzles you solve are built. Nothing here is hand-written by a puzzle setter: every puzzle is generated by a computer program and then verified by a second pass of the same logic. Here is the full process in plain language.
Step 1: pick a random solution
The generator begins at the end. It decides who lives where before writing a single clue.
For a Medium puzzle (5 houses, 4 categories), that means shuffling each category into the five houses at random. One outcome might look like this:
| House | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Name | Bob | Alice | Erin | Dan | Cara |
| Drink | water | tea | milk | coffee | juice |
| Pet | fish | cat | dog | bird | horse |
| Color | green | red | blue | white | yellow |
This hidden table is the answer key. Because the clues are written from it, they can never contradict each other.
Step 2: generate true clues
Next, the program produces a large pool of statements that are true for this answer, using the same eight patterns you see on the site:
- "Alice lives in house 2."
- "Dan does not live in house 1."
- "Alice is the tea drinker." / "Alice lives in the red house."
- "Bob is not the cat owner."
- "The coffee drinker lives directly to the left of Cara."
- "Erin lives next to the cat owner."
- "Bob lives somewhere to the left of the dog owner."
- "The horse owner lives in one of the end houses."
Every one of these is checked against the answer table before it can be used. A false clue never enters the pool.
Step 3: add clues until exactly one solution remains
Now the program picks clues from the pool one at a time. After each addition it runs a solver that asks: how many complete arrangements of the grid are consistent with every clue so far?
- At first, the answer is "a huge number".
- As clues are added, the count shrinks.
- The generator stops adding when the count is exactly one.
At that point, the clues pin down the hidden answer and nothing else.
Step 4: remove redundant clues
Adding clues greedily usually leaves some that aren't needed: a later clue may have made an earlier one unnecessary. So the generator tries removing each clue in turn and re-runs the solver. If the puzzle still has exactly one solution without that clue, the clue goes. This keeps puzzles tight, so every clue you read does real work.
Step 5: verify again
After pruning, the solver checks the final clue list once more from scratch to confirm there is exactly one solution. Only puzzles that pass this final check are published.
How the solver works: constraint satisfaction in plain words
A zebra puzzle is what computer scientists call a constraint satisfaction problem. There are variables (which house each item is in), each with a set of possible values (house 1 to 5), and constraints (the clues) that rule out combinations.
Our solver is built on a method called backtracking, which is roughly what a very patient person would do with a pencil and eraser:
- Choose an item that hasn't been placed, preferably one with few possible houses left.
- Try putting it in one of its possible houses.
- Apply every clue and cross out whatever that placement makes impossible.
- If some item now has no possible house, the try was wrong: undo it (backtrack) and try the next house.
- If everything is placed and every clue holds, record a solution, then keep searching for another one.
The "keep searching" part matters. The generator doesn't just want a solution; it needs to prove there is no second one. The solver can stop as soon as it finds two, because two already means the puzzle isn't finished.
A computer can explore enormous numbers of branches quickly, so it uses trial and error freely. You don't have to, which brings us to guessing.
Why you never have to guess
Because each puzzle has exactly one solution, every cell is determined by the clues. That means there is always a logical reason why each item belongs where it does.
To be precise about what "no guessing" means: on Easy and Medium, most progress comes from direct elimination, reading one clue and crossing things out. On Hard, you will sometimes need a longer chain, such as "if the cat owner were in house 2, then the tea drinker would have to be in house 3, which clue 6 forbids, so the cat owner is not in house 2." That is still logic, not a guess: you are proving a cell impossible, not hoping. You never need to pick an option at random and see if it works out.
For ways to find those chains, see our guide to logic grid techniques.
How difficulty is set
| Level | Houses | Categories | Clue style |
|---|---|---|---|
| Easy | 4 | 3 | Mostly direct clues (house positions, "is" links) |
| Medium | 5 | 4 | Direct and relative clues |
| Hard | 5 | 5 | Mostly relative clues ("next to", "left of"), kept to a minimum |
Size is the first lever: more houses and categories mean many more possible arrangements. Clue type is the second. Direct clues such as "Alice lives in house 2" settle cells immediately, while relative clues only narrow things down in combination. For Hard, the generator also rejects puzzles that can be finished with simple one-clue-at-a-time elimination, so each Hard puzzle requires at least some multi-step reasoning.
The same puzzle for everyone
There is one puzzle per level per day, and a new set appears at 00:00 UTC. The day is based on the UTC date, not your local date, so a solver in Tokyo and a solver in Toronto get the same puzzle at the same moment. Depending on where you live, the change may happen in your morning, afternoon or evening. Past days stay available in the archive.
Answers are checked on the server
Your browser receives the clues, not the answer. When you press Check, or ask for a hint (which reveals one cell and flags mistakes), the request goes to our server, which compares your grid with the stored solution. Keeping the answer off the page means nobody can spoil the puzzle by peeking at the page source, and it keeps streaks meaningful. Your streaks and progress are stored in your own browser.
Want to see it in action?
The best way to appreciate a tight puzzle is to solve one: today's puzzle is waiting. If you're curious where this kind of puzzle came from, read our history of the zebra puzzle.
Put it into practice
Try today's puzzle at Easy, Medium or Hard, or pick an older one from the archive.