Solution

Five Houses, One Missing Pet

Show the problem again

Five houses stand in a row, numbered 1 to 5 from left to right. Each house has a different color (red, green, blue, white, yellow), and each occupant has a different job (baker, pilot, tailor, dentist, chef), a different pet (cat, dog, fish, bird, horse) and a different favorite drink (tea, coffee, milk, juice, water). "Immediately left of" means the house with the next lower number. 1. The chef lives in the blue house. 2. The occupant of the blue house drinks juice. 3. The pilot keeps the horse. 4. The milk drinker keeps the fish. 5. The red house is immediately left of the house of the tea drinker. 6. The baker lives immediately left of the cat owner. 7. The baker lives immediately left of the tea drinker. 8. The bird owner lives immediately left of the tailor. 9. The horse owner lives immediately left of the milk drinker. 10. The milk drinker lives immediately left of the green house. 11. The white house is immediately left of the house of the coffee drinker. Who owns the dog? Answer with the job.

Worked solution

Clues 9 and 10 give three consecutive houses: the horse (kept by the pilot, clue 3) in some house $h$, the milk and the fish (clue 4) in $h+1$, and the green house at $h+2$, so $h \in \{1,2,3\}$. Clues 5, 6 and 7 put the baker in the red house $b$, with the cat and the tea in house $b+1$. Clues 1 and 2 put the chef and the juice in the blue house. So house $b+1$ cannot be $h$ (it has the cat, not the horse) or $h+1$ (tea, not milk); red cannot be $h+2$ (green); and blue cannot be $h$ (the pilot), $h+1$ (milk), $h+2$ (green), $b$ (red) or $b+1$ (tea). **$h = 1$** (pilot 1, milk 2, green 3). Then $b \in \{2, 4\}$. If $b = 4$, the rules above exclude every house for blue. If $b = 2$ (tea in 3), blue is house 4 or 5, and the white house needs coffee directly to its right. White cannot be house 1 (coffee would land on the milk in 2) or house 5 (nothing to its right), so white is 4, coffee is 5, and blue is 5: but the blue house drinks juice. Contradiction. **$h = 2$** (pilot 2, milk 3, green 4). House $b+1$ is neither 2 nor 3, and $b \ne 4$, so $b = 3$ with tea in 4. Blue is 1 or 5. White needs coffee to its right in a house without milk, tea or juice, which forces white 1, coffee 2, and so blue 5. The jobs pilot, baker and chef fill houses 2, 3 and 5, so the tailor lives in house 1 or 4. By clue 8 the bird is immediately left of the tailor: house 1 has no left neighbour, and for house 4 the bird would be in house 3, which holds the fish. Contradiction. **$h = 3$** (pilot and horse 3, milk and fish 4, green 5). Now $b+1 \notin \{3, 4\}$ and $b \ne 5$, so $b \in \{1, 4\}$; $b = 1$ leaves no house for blue, hence $b = 4$: the baker is in the red house 4 and house 5 has the cat and the tea. Blue is 1 or 2. White needs coffee to its right in house 2 or 3, not the blue house: white 1 would force blue 2 with coffee, so white is 2, coffee is in 3, blue is 1 (chef, juice), house 3 is yellow and house 2 drinks water. The tailor and the dentist take houses 2 and 5. A tailor in 5 would need the bird in 4, which has the fish, so the tailor is in house 2 with the bird in house 1, and the dentist is in 5. The only pet left, the dog, is in house 2. The dog belongs to the tailor (and a computer search over all assignments finds this to be the only solution).

Source: Original puzzle written for AxiomIQ in the style of the classic five-house logic grid puzzles in wide circulation; no traceable original source.