Einstein's Riddle

Image by Kate Branch from Unsplash

Einstein’s Riddle (also known as the Zebra Puzzle or the Five Houses Puzzle) is one of the most famous logic puzzles in the world.

Popular legend claims that it was created by Albert Einstein when he was a child (or a young student), often accompanied by the assertion that only 2% of the world’s population can solve it in their head. Another common attribution is to mathematician and author Lewis Carroll (author of Alice’s Adventures in Wonderland). However, there is no documented historical evidence from Einstein’s or Carroll’s lifetime to support their authorship. The earliest known published version appeared on December 17, 1962, in Life International magazine.

Despite the “2%” myth, the reality is that the puzzle does not require superhuman abilities, just deductive logical reasoning, data structuring, and patience.

Formal problem description

Imagine a street with 5 consecutive houses in a row (numbered 1 to 5 from left to right). Each house has the following properties:

  1. There are 5 houses of 5 different colors: Yellow, Blue, Red, Green, and White.
  2. In each house lives a person of a different nationality: Norwegian, Dane, Brit, German, and Swede.
  3. Each owner drinks a specific beverage: Water, Tea, Milk, Coffee, and Beer.
  4. Each owner smokes a specific brand of cigars: Dunhill, Blend, Pall Mall, Prince, and BlueMaster.
  5. Each owner keeps a different pet: Cat, Horse, Bird, Fish, and Dog.
  6. No two owners share the same nationality, house color, beverage, cigar brand, or pet.

To make the correct assignment, we are given the following 15 clues:

  1. The Norwegian lives in the first house.
  2. The person living in the center house drinks milk.
  3. The owner of the yellow house smokes Dunhill.
  4. The green house’s owner drinks coffee.
  5. The Dane drinks tea.
  6. The German smokes Prince.
  7. The Swede keeps a dog as a pet.
  8. The owner who smokes BlueMaster drinks beer.
  9. The person who smokes Pall Mall rears a bird.
  10. The green house is immediately to the left of the white house.
  11. The British person lives in the red house.
  12. The person who smokes Blend lives next to the person who keeps a cat.
  13. The person who keeps a horse lives next to the person who smokes Dunhill.
  14. The person who smokes Blend has a neighbor who drinks water.
  15. The Norwegian lives next to the blue house.

The decisive question to answer is: Who owns the fish?

Do you dare to solve it logically before taking on the model?


This puzzle can be formulated as a binary linear optimization model. Do you dare to try it?


Would you like to keep exploring the world of Operations Research? Discover more posts on the topic here.




If you found this useful, please cite this as:

Martín-Campo, F. Javier (May 2026). Einstein’s Riddle. https://www.fjmartincampo.com/blog/2026/einsteinpuzzle/.

or as a BibTeX entry:

@misc{martín-campo2026einstein-s-riddle,
  title   = {Einstein's Riddle},
  author  = {Martín-Campo, F. Javier},
  year    = {2026},
  month   = {May},
  url     = {https://www.fjmartincampo.com/blog/2026/einsteinpuzzle/}
}



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • A crime has been committed... in a sudoku!
  • The harmony of digits in solving Kakuro
  • Killer Sudoku, the empty board challenge that math can solve
  • Solving the Number Sums board using mathematical optimization
  • Building bridges with linear optimization, the Hashi puzzle