Three hats are placed on the heads of three men standing in a line. Each man can only see the men and hats in front of him. In addition, the men all know that the hats came from a bag with 3 red hats and 2 blue hats.
Each man is asked if he knows which color hat he is wearing. The man in the back responds first, "No." Then the man in the middle responds, "No." Finally, the man in front responds, "Yes."
If they are all perfectly logical and telling the truth, what color hat is the man at the front wearing?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
This problem is very similar to another one at Maths Is Fun
Log in to reply
but they can only see the hats infront, the middle guy doesn’t know what colour the guy behind is wearing
Some illustration using python
```
>> import itertools as it
>> items = ['k'] * 3 + ['b'] * 2
>> items
['k', 'k', 'k', 'b', 'b']
>> set( it.combinations( items, 3 ) )
{('k', 'k', 'b'), ('k', 'b', 'b'), ('k', 'k', 'k')}
>> set( it.permutations( items, 3 ) )
{('k', 'k', 'k'), ('b', 'k', 'b'), ('k', 'k', 'b'), ('k', 'b', 'b'), ('b', 'b', 'k'), ('b', 'k', 'k'), ('k', 'b', 'k')}
>> sorted( set( it.permutations( items, 3 ) ) )
[('b', 'b', 'k'), ('b', 'k', 'b'), ('b', 'k', 'k'), ('k', 'b', 'b'), ('k', 'b', 'k'), ('k', 'k', 'b'), ('k', 'k', 'k')]where
```
if all 3 have a red hat on, the third ll never know what hat he is wearing !
There are 4 possible cases for the front and middle man's hats.
Case | 1 | 2 | 3 | 4 | |||
Front man | b | b | r | r | |||
Middle Man | b | r | b | r |
If it were case 1, the man in the back would know there aren't any blue hats left for him and he would have said yes (for a red hat). Therefore it isn't case 1. (The other two men also realize it isn't case 1 from the man in the back's statement).
If it were case 2, the man in the middle would have guessed his hat was red (knowing that the man in the front has a blue hat and case 1 is wrong). Therefore, it isn't case 2 either.
So the man in the front has a red hat.
"If it were case 2, the man in the middle would have guessed his hat was red (knowing that the man in the front has a blue hat and case 1 is wrong). Therefore, it isn't case 2 either."
you mean case 3
Log in to reply
No, they mean case 2. Case 3 has the middle man with a blue hat and the front man with a red hat, but the eliminated case is exactly the opposite and matches case 2.
Great explanation, thanks! I completely missed the part that after each question, from back to front, new knowledge was gained at each step.
I got caught in the wording, "Do you KNOW what color your hat is?" Of course the middle man can't know, nor can the front man. They can guess or assume what color it is based on what you said however. I think the wording needs to be changed to "think"
Log in to reply
Nope, "know" is the correct word to use here. The problem comes with the assumption that "they are all perfectly logical and telling the truth", so under these assumptions, we can indeed "know" what color of hat the person in the front is wearing.
If the backman sees 2 blue caps in front of him, he can surely say that he wears a red cap. When he says 'no'. then we can say his front men wear these possible caps. M a n Front man(1) Middle man(2) 1st case blue red 2nd case red red 3rd case red blue
There we can see in only one case the front man wear blue cap. So if the front man definitely wear blue cap the middle man surely say that he wear a red cap. But his answer is 'no'. So we can now surely say that the front man didn't wear blue cap. He must wear a red cap
In the first line, If the backman sees 2 blue caps in front of him, he can surely say that he wears a red cap. Kidly update "he wears a blue cap" to "he wears a red cap" in the solution.
Log in to reply
Sorry, I made a mistake. Thanks for informing me......
If back man sees two blue hats in front of him, then he can know his own must be red. Any other combo leaves him not knowing, so he must say "no". Middle man will know this. If middle man sees a blue hat in front of him, he will therefore KNOW his own cannot be blue, and would respond "yes". Since he said "no", front man knows his own must be red.
I didn't worry too much about what colour hats the back and middle man were actually wearing. The puzzle says we are to assume they are telling the truth. If the front man is telling the truth and knows what colour hat he is wearing, then the only logical conclusion is that he has fathomed out that the other two are wearing blue hats. Otherwise he couldn't possible know what colour he was wearing, because if they were both wearing red then his could either be red or blue. And if they were wearing a mix there would still be both red and blue hats available. If we accept that puzzles assertion at face value, that he is telling the truth when he says he knows what colour hat he is wearing, then we don't actually need to worry about how he has figured that out at all – his assertion can only mean he's wearing a red hat!
The man at the back knows his hat is red if he sees two blue hats. The fact that he doesn't know his hat's color means he sees two red or one of each. The second person knows this information and looks in front of him. If he sees a blue hat, he would know that the man at the back saw one of each. The fact that he doesn't know means he sees a red hat which the man at the front knows and deduces that he has a red hat.
We call the man in the back is A , the man in the middle is B and the man is the front is C .
If both B and C wear a blue hat, A will know that she's wearing a red hat since there are only two blue hats, a contradiction.
So, at least a person among B and C wears a red hat. ( ∗ )
Furthermore, if C 's wearing a blue hat, combining with ( ∗ ) , B could know that she's wearing a red hat, a contradiction.
Hence, C isn't wearing a blue hat, so C 's wearing a red hat.
If the man in the back sees both men in front of him wearing blue hats, he will know that he is wearing a red hat, so this is not correct. Because of that, two men in front of him can't both wear blue hats, so there are three cases:
The middle man has a red hat, the front man has a blue hat.
The middle man has a blue hat, the front man has a red hat.
The middle man has a red hat, the front man has a red hat.
If the front man has a blue hat, the middle man will know that he is wearing a red hat, this is incorrect. The front man must be wearing a red hat, so that the middle man don't know for sure what is the hat color he is wearing.
( MIB : Man in the back, MIM : Man in the middle, MIF : Man in the front)
Man one only says yes if he sees two blue hats. He doesn't.
Man two, knowing that he, and man three could be wearing either blue and red, or red and red, could only say yes if he saw a blue hat. He doesn't.
Therefore he sees a red one.
First say no it doesn't give any conclusion but if second says no by seeing tha blue colour of first man this means he is in doubt that he is wearing blue or red here last one say yes because he see blue of second $and concluding the answer of second .
Let’s call the man at the back C.
Let’s call the man in the middle B.
Let’s call the main in the front A.
C knows A and B’s hats. There are 2 blue hats. The only case he would know in is if all 2 blue hats would already be in use. He doesn’t know. Therefore both A and B do not have a blue hat.
This means A or B (or both) has a red hat. B can see As hat. If he sees a blue hat on A he would know he would have to have a red hat as there is at least one red hat in him or A. If there A has a red hat, B doesn’t know if he also has a red hat as there can be 1 or 2 hats. As he does not know As hat is red.
The man mostly on the left has a blue hat, and the man in the middle has a blue hat, and the man in the front has a red hat. And I have the sorting hat.
Problem Loading...
Note Loading...
Set Loading...
Only if the back man sees 2 blue hats can he know that his must be red. Therefore, the back man sees either 2 red hats or 1 red and 1 blue. Only if the middle man sees a blue hat can he know that his must be red. Therefore, the middle man sees a red hat. The front man correctly deduces his hat is red.