The puzzle is sometimes attributed to Albert Einstein although it's questionable whether he would waste time with similar nonsense. More likely, someone borrowed Einstein's name to promote the riddle. If Einstein has something to do with it, the reason he invented it was probably to get rid of annoying students. :-)
At any rate, there are five houses. Each of them has one of five different left-right positions, five different colors, five different nationalities of the owners, five different favorite cigarette brands they like, five different beverages they drink, and five different species of pets they shelter. Moreover,
- The Englishman lives in the red house.
- The Swede keeps dogs.
- The Dane drinks tea.
- The green house is just to the left of the white one.
- The owner of the green house drinks coffee.
- The Pall Mall smoker keeps birds.
- The owner of the yellow house smokes Dunhills.
- The man in the center house drinks milk.
- The Norwegian lives in the first house.
- The Blend smoker has a neighbor who keeps cats.
- The man who smokes Blue Masters drinks bier.
- The man who keeps horses lives next to the Dunhill smoker.
- The German smokes Prince.
- The Norwegian lives next to the blue house.
- The Blend smoker has a neighbor who drinks water.
Can you write a Mathematica program that makes the solution automatic?
Warning: many TRF readers are both bright enough & patient as well as lucky (assuming that they haven't copied the solution from an internet source) ;-) so don't open the comments if you want to avoid spoilers.
For a brutally complete spoiler, see: