Visit our sponsor Granny's Eggs  
Home
Microsoft Interview Process
Microsoft HR Questions
Technical Questions
Puzzles/Riddles
Resume Tips and Template
Discuss
Question to Interviewer
Interview Tips
Term Of Use
Site Feedback


3 black hats and 2 white hats

Four men are lined up on some steps. They are all facing in the same direction. A wall seperates the fourth man from the other three.
So to summarise :-


Man 1 can see men 2 and 3.
Man 2 can see man 3.
Man 3 can see none of the others.
Man 4 can see none of the others.
The men are wearing hats. They are told that there are two white hats and two black hats. The men initally don't know what colour hat they are wearing. They are told to shout out the colour of the hat that they are wearing as soon as they know for certain what colour it is.
They are not allowed to turn round.

They are not allowed to talk to each other.


So the question is -
Who is the first person to shout out and why?

 

Add your possible solutions in a comment, I will put the one which will convience me here


Comments:

3 black hats and 2 white hats
By Ravin on Monday, August 28, 2006 (UMST)
The man 1 should shout first because he can see two mens 2 and 3. He can see colour of their hats if two black or white hats the 2 and 3 wared, then he can shout white for first case and black for another. And then 2 and 3 in any order can shout then man 4.

Reply to this Comment

Careful...
By psyang on Tuesday, August 29, 2006 (UMST)

There are a couple cases to consider.

 

First, if Man1 sees two black or two white hats, he can deduce his own as the opposite of what he sees, and will shout first. Man 2, hearing Man1 shout, knows that he must have the same color hat as Man3, and will shout out that color. Man3, hearing Man1 and Man2 shout in sequence, will shout the same as Man2. Man4 can then shout out whatever is left.

 

If Man1 sees 1 black and 1 white hat, he cannot deduce his own and will not shout. In this case, Man2 can deduce that since Man1 can't yell out, he must be wearing the opposite color hat as Man3, and will yell out. Man3 can then yell out his hat as the opposite of Man2. Man1 and Man4 are never able to deduce their own color.

 

Reply to this Comment

Think outside the box
By Mike on Tuesday, January 30, 2007 (UMST)

Who is the first person to shout out and why?

The one that takes his hat off and looks at it the fastest!

Reply to this Comment

One clarification
By Sridhar on Wednesday, March 14, 2007 (UMST)
Is it a typo that the title is "3 Black hats and 2 Red hats" and the puzzle mentions about just 4 hats?

Reply to this Comment

You need only the first one, not the all chain.
By Senya on Friday, August 03, 2007 (UMST)
I agree with your beginning. But in case when 2 and 3 have the same color, the 1 shouts first and then there is no guarantee that the next one will be the 2. The same information has the 3. So he can shout the second. So, what do we have? You put yourself into the situation, when your answer is not totally correct. Who asked you about all the chain? Nobody. Answer the question and do not go beyond it.

Reply to this Comment

1st or 2nd person can tell his hat color.
By Vinu on Thursday, October 25, 2007 (UMST)


Since 1st person can see -> 2nd persons and 3rd persons hat color and both are white or blace, then his hat color would be the opposite of that.

 

If first person is not answering, then the 2nd person can assume that himself and the third person are wearing different color hats, so he can tell that he is wearing the opposite color hat than the 3rd guy.

 

Reply to this Comment

4 or 5 hats?
By Jan on Tuesday, February 05, 2008 (UMST)
Agree with Psyang, but if there are 2 black and 2 white then 4 and 1 could also shout the color of their hats.

Reply to this Comment

And the answer is 2nd Person
By faisalsns on Tuesday, February 12, 2008 (UMST)

Who is the first person to shout out and why?

 

2nd person

 

Analysis: If the 2nd and 3rd person wear hats of similar color then the 1st person wud have shouted the other color.

 

The 1st person will be quiet if the 2nd and 3rd persons are wearing hats of different color. This case 2nd person can see that the 1st person hasnt said anything hence he can safely say the color of his hat is not the color of the 3rd person i.e. if the 3rd person is wearing black 2nd person's hat color will be white and vice versa.

 

 

Reply to this Comment

...And the answer is 2nd Person
By faisalsns on Tuesday, February 12, 2008 (UMST)

Who is the first person to shout out and why?

 

2nd person

 

Analysis: If the 2nd and 3rd person wear hats of similar color then the 1st person wud have shouted the other color.

 

The 1st person will be quiet if the 2nd and 3rd persons are wearing hats of different color. This case 2nd person can see that the 1st person hasnt said anything hence he can safely say the color of his hat is not the color of the 3rd person i.e. if the 3rd person is wearing black 2nd person's hat color will be white and vice versa.

 

 

Reply to this Comment

Why is the 2nd?
By PaulM on Sunday, March 09, 2008 (UMST)

Why is the second person would shout first? You just told that if 2=red and 3=red, the first person would shout first.

So in a half cases the first person would shout first and

in other cases the second person.

 

There is no 1 answer as there are two cases. Isn't obvious?

Reply to this Comment

x
By Xx0kittykat0xX on Saturday, March 22, 2008 (UMST)
MAN 2 would shout first because he would wait and if after some time MAN 1 has not said anything he knows his hat is the opposite of MAN 3s, therefore he wouldknow MAN 1 does not know because MAN 2 and 3 are different

Reply to this Comment

Agree
By hooman48 on Friday, July 11, 2008 (UMST)
I agree. The question doesn't say that they cannot take the hat off and look.

Reply to this Comment

Add Your Comment

New Articles
  • Combinations in a character array.
    Write a program that takes input a char array and outputs all the combinations of the characters in the character array.
    Example: consier char array {'a','b','c'}
    the output shouold be abc,cab,bac,acb,cba,bca that is all the combinations of characters 'a','b','c'.


  • N-Queen Problem.
    Write a Program to solve N-Queen Problem.

  • Reverse a string
    Reverse a string using recursive function

  •  

    Most Popular Articles
  • Crazy Guy On The Airplane
    A line of 100 airline passengers is waiting to board a plane. they each hold a ticket to one of the 100 seats on that flight.

  • What are your greatest weaknesses
    Beware - this is an eliminator question, designed to shorten the candidate list. Any admission of a weakness or fault will earn you an “A” for honesty, but an “F” for the interview.

  • Question: Tell me about yourself.
    Many candidates, unprepared for the question, skewer themselves by rambling, recapping their life story, delving into ancient work history or personal matters.

  •  

    New Posts

  • penis viagra online Tramadol
    Posted by BobeCrobChext on 2008年9月30日 (UMST)

  • Fast Tramadol delivery
    Posted by SurojattSit on 2008年9月30日 (UMST)

  • Tramadol - new Online
    Posted by SurojattSit on 2008年9月30日 (UMST)



  •