Click here to Skip to main content
15,121,414 members
Articles / Programming Languages / C++
Posted 20 Dec 2003


18 bookmarked

A non-computational solution to Einstein's Riddle

Rate me:
Please Sign up or sign in to vote.
4.41/5 (18 votes)
20 Dec 2003CPOL6 min read
This is a fun article on how to solve Einstein's riddle without the help of a computer.


Einstein's Riddle

There are 5 houses of 5 different colors. In each house lives a person of a different nationality. Each of the 5 residents drinks a certain type of beverage, smokes a certain brand of cigar, and keeps a certain pet. None of them have the same pet, smoke the same brand of cigar or drink the same beverage.

The question is: Who owns the fish?


  1. The Brit lives in the red house.
  2. The Swede keeps dogs as pets.
  3. The Dane drinks tea.
  4. The green house is on the left of the white house.
  5. The resident of the green house drinks coffee.
  6. The person who smokes Pall Mall rears birds.
  7. The resident of the yellow house smokes Dunhill.
  8. The resident of the center house drinks milk.
  9. The Norwegian lives in the first house.
  10. The person who smokes Blends lives next to the one who keeps cats.
  11. The person who keeps the horse lives next to the one who smokes Dunhill.
  12. The person who smokes Bluemasters drinks beer.
  13. The German smokes Prince.
  14. The Norwegian lives next to the blue house.
  15. The person who smokes Blends has a neighbor who drinks water.

Well, where do I start? First to avoid any charge of plagiarism, the source code pointer above, isn't mine. It belongs to this article. As you can see, the article pointed to above, refers to a computational solution to the problem. Here I present a reasoning approach that uses no combinatorial methods. It is said that Einstein thought that 98% of the world's people couldn't solve this riddle, which might have been an accurate prediction for the relatively ancient time Einstein was living in. That might not be true today, but I personally don't think the percentage of people who can't solve it have gone down much. Maybe 80% would be a better estimate for today. Chances are if you're reading this article, you probably can solve it. It isn't a difficult riddle if you have some experience with reasoning beyond what evolution endowed all of us with. Anyways, before I derail into a politically motivated ranting, will get going...

My Method of solving such a problem.

Notice I stated, "my method", because other people would likely approach it differently. First we start with establishing certain assumptions. In this case, the base assumption I tried to establish was the orientation of the houses. From the hints, it is clear that many conclusions can be met by knowing how the houses are positioned relative to one another. While one can argue as to what the hints tell us about the orientation of the houses, my understanding lead me to the following conclusions:



Why did I end up with these two orientations? Well, they seem to be the only ones that made sense, given the use of phrases such as ["Center": hint#8], ["on the Left": hint#4]. I chose the second orientation because of simplicity, and am not even sure the first orientation would work, I didn't try it. Now let's get to answering some questions in the riddle.

  1. Finding The Color of the Houses

    House #5 can't be green because, it isn't to the left of any house (see hint #4). House #2 is blue because it is the only house next to the Norwegian (see hint#14), and from hint #9, we know that the Norwegian lives in house #1. House #3 drinks milk (see hint#8), but we know the resident of the green house drinks coffee (see hint#5), so house #3 can't be green. We are now left to choose between house #1 and house #4, but we know house #1 is to the left of the blue house (see second sentence of this section), and from hint #4, the green house is to the left of a white house not a blue one. So which house is green? common! :).

    Since we now know house #4 is green, we can infer by way of hint #4 that house #5 is white, because it is to whose left, green is located.

    Since there are 2 uncolored houses left (House #1, House #3), we start with House #1. Well that's simple, the Norwegian lives there and from hint#1, the Brit lives in the red house. We conclude house #3 is Red.

    You're not really expecting me to tell you which house is yellow, are you????!!!


    Now we can move on to the other aspects of the puzzle, good news is we don't have to do too much work to solve the whole puzzle. Some of the clues can be filled in by merely looking at the hints and filling in the gaps. Surprisingly, one can't get prematurely to the solution. In other words, you have to solve the whole riddle before you could answer the question. I might be wrong, maybe it is just a coincidence on my part. If however it isn't, then it might be that the puzzle was an adaptation of some already formulated combinatorial technique. Einstein must have come up with this while trying to pose another experimental challenge to his quantum theory nemesis. :) Anyways, lets get going....

    First, I have color coded the clues. Purple for the clues that can be filled in directly from the hints. Black for the ones we have to figure out. Here are the ones we can already fill:


  2. Who keeps the horse?

    Well that's simple, from hint #11, the only house next to the Dunhill smoker is the blue house.

    Answer: House2


    At this point, we're stock!!!. Now we need to use some rather fuzzy logic. Below is a list of puzzle characters lined-up against the houses they could possibly occupy.


    As you can see, there is somewhat of a red light blinking on the relation between the Dane and the BlueMasters smoker. One thing we do know is that they are not the same person. Meaning the Dane isn't the BlueMasters smoker, because the Dane drinks tea (see hint #3) while the BlueMasters smoker drinks beer (see hint #12). What all of this means is that either the Dane lives in house #5 and the BlueMasters smoker lives in house #2 or vice verse. Let's try the first scenario:

    Scenario a


    With the above scenario ,the German and the Swede are left to both battle for house #4, which shouldn't be. So scenario a doesn't work. So...well if I have to say it, we will try scenario b:

    Scenario b


    Note that scenario b has already been proven to be correct by showing that scenario a is incorrect. Next we look at the German and the Swede. Between the two of them, they now have house #4 and house #5 to choose from (House #2 is out of question for the German, the Dane is already there.). The German smokes Prince (see hint #13), so he couldn't be living in house #5....well you get the idea.


  3. Who Smokes the Blend brand of cigarette?

    Per hint #15, the only place the Blend smoker could live is house #2. It is also clear who drinks water.


  4. Filling in the rest:

    We know what all houses smoke but the Brit, so the Brit is left to smoke Pall Mall. The only person who lives next to the Blend smoker, who hasn't been assigned a pet is the Norwegian (see hint #10), so the Norwegian keeps cats.


Our Solution??...Please!!


Last update: Correction of step 2.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
United States United States
biography? I am not that old yet.

Comments and Discussions

QuestionInteresting Pin
Member 1078506629-Apr-14 22:43
MemberMember 1078506629-Apr-14 22:43 
AnswerEinstein's Riddle iphone app Pin
Anatol1y16-Apr-12 2:32
MemberAnatol1y16-Apr-12 2:32 
GeneralHint 15 and the riddle description Pin
Dezhi Zhao24-Dec-03 6:01
MemberDezhi Zhao24-Dec-03 6:01 
GeneralRe: Hint 15 and the riddle description Pin
mystro_AKA_kokie24-Dec-03 6:59
Membermystro_AKA_kokie24-Dec-03 6:59 
GeneralLet's solve it without using Hint 15 Pin
Dezhi Zhao24-Dec-03 11:33
MemberDezhi Zhao24-Dec-03 11:33 
GeneralRe: Let's solve it without using Hint 15 Pin
mystro_AKA_kokie24-Dec-03 14:18
Membermystro_AKA_kokie24-Dec-03 14:18 
GeneralMore puzzles Pin
Blair Bonnett22-Dec-03 23:18
MemberBlair Bonnett22-Dec-03 23:18 
QuestionHouse #4 missing a pet??? Pin
leppie22-Dec-03 7:52
Memberleppie22-Dec-03 7:52 
AnswerRe: House #4 missing a pet??? Pin
mystro_AKA_kokie22-Dec-03 8:30
Membermystro_AKA_kokie22-Dec-03 8:30 
GeneralAlternative solution methods Pin
mogwai21-Dec-03 22:50
Membermogwai21-Dec-03 22:50 
GeneralRe: Alternative solution methods Pin
mystro_AKA_kokie22-Dec-03 2:58
Membermystro_AKA_kokie22-Dec-03 2:58 
GeneralRe: Alternative solution methods Pin
mogwai22-Dec-03 4:08
Membermogwai22-Dec-03 4:08 
GeneralRe: Alternative solution methods Pin
David Crow22-Dec-03 5:53
MemberDavid Crow22-Dec-03 5:53 
GeneralQuestion about step 2 Pin
John M. Drescher21-Dec-03 20:53
MemberJohn M. Drescher21-Dec-03 20:53 
GeneralRe: Question about step 2 Pin
unitrunker21-Dec-03 22:04
Memberunitrunker21-Dec-03 22:04 
GeneralRe: Question about step 2 Pin
mystro_AKA_kokie22-Dec-03 3:05
Membermystro_AKA_kokie22-Dec-03 3:05 
GeneralRe: Question about step 2 Pin
John M. Drescher22-Dec-03 7:16
MemberJohn M. Drescher22-Dec-03 7:16 
GeneralRe: Question about step 2 Pin
John M. Drescher22-Dec-03 7:24
MemberJohn M. Drescher22-Dec-03 7:24 
GeneralRe: Question about step 2 Pin
mystro_AKA_kokie22-Dec-03 8:05
Membermystro_AKA_kokie22-Dec-03 8:05 
GeneralRe: Question about step 2 Pin
John M. Drescher22-Dec-03 9:56
MemberJohn M. Drescher22-Dec-03 9:56 
GeneralRe: Question about step 2 Pin
mystro_AKA_kokie22-Dec-03 10:11
Membermystro_AKA_kokie22-Dec-03 10:11 
GeneralRe: Question about step 2 Pin
John M. Drescher22-Dec-03 15:45
MemberJohn M. Drescher22-Dec-03 15:45 
GeneralRe: Question about step 2 Pin
mystro_AKA_kokie22-Dec-03 18:56
Membermystro_AKA_kokie22-Dec-03 18:56 
GeneralRe: Question about step 2 Pin
John M. Drescher23-Dec-03 8:33
MemberJohn M. Drescher23-Dec-03 8:33 
GeneralRe: Question about step 2 Pin
mystro_AKA_kokie23-Dec-03 20:43
Membermystro_AKA_kokie23-Dec-03 20:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.