Legend has it that Albert Einstein made up this puzzle when he was a young boy. It’s also been attributed to Lewis Carroll. However, there is no known evidence for either Einstein’s or Carroll’s authorship and the version published in Life International in 1962 mentions brands of cigarettes, such as Kools, that did not exist during Carroll’s lifetime or Einstein’s boyhood.
This particular type of logic problem is known as a “zebra puzzle” and has been used as a benchmark in the evaluation of computer algorithms for solving constraint satisfaction problems.
• There are five houses.
• The Englishman lives in the red house.
• The Spaniard owns the dog.
• Coffee is drunk in the green house.
• The Ukrainian drinks tea.
• The green house is immediately to the right of the ivory house.
• The Old Gold smoker owns snails.
• Kools are smoked in the yellow house.
• Milk is drunk in the middle house.
• The Norwegian lives in the first house.
• The man who smokes Chesterfields lives in the house next to the man with the fox.
• Kools are smoked in the house next to the house where the horse is kept.
• The Lucky Strike smoker drinks orange juice.
• The Japanese smokes Parliaments.
• The Norwegian lives next to the blue house.
Now, who drinks water? Who owns the zebra?