about photos bookshelf portfolio blog home
Begin main content

Einstein's Puzzle

I can't believe I've never come across this before. It took me a bit under 30 minutes using pen and paper (but I was distracted by work a few times...). Probably would have been quicker to write a Prolog program (but it's much more satisfying by hand :) See how you go:


The Brit lives in the red house.
The Swede keeps dogs as pets.
The Dane drinks tea.
The green house is to the left of the white house.
The owner of the green house drinks coffee.
The man who smokes Pall Mall keeps birds.
The owner of the yellow house smokes Dunhill.
The man living in the house right in the center drinks milk.
The Norwegian lives in the first house.
The man who smokes Blends lives next to the man who keeps cats.
The man who keeps horses lives next to the man who smokes Dunhill.
The man who smokes Blue Master drinks beer.
The German smokes Prince.
The Norwegian lives next to the blue house.
The man who smokes Blends has a neighbor who drinks water.

Who keeps the fish?




Email or meebo me for the answer (comments with the answer will be deleted!).

Wikepedia has some information on the history of this puzzle. Excerpt:

The Zebra Puzzle is a well-known logic puzzle.

It is often called "Einstein's Puzzle" or "Einstein's Riddle" because it is said to have been invented by Albert Einstein as a boy, with the common claim that Einstein said "only 2 percent of the world's population can solve this". It is also sometimes attributed to Lewis Carroll. However, there is no known evidence for Einstein's or Carroll's authorship.

There are several versions of this puzzle. The version below is quoted from the first known publication in Life International magazine on December 17, 1962. The March 25, 1963, issue contained the solution given below and the names of several hundred solvers from around the world.

The version of the puzzle given in Wikipedia is tougher because two pieces of information are missing. Naturally someone has already written Prolog and Lisp solutions for it :)

02:38 AM, 16 Jan 2007 by Mark Aufflick Permalink

Add comment