There are 5 persons in a line, all facing in the same direction. There are 5 hats, 2 white and 3 black. A person can't see the color of his own hat, but can see the color of the hat of all the people standing in front of him.
The Third/middle person was asked to tell the color of his own hat. He couldn't answer. Then the second person( the person in front of the middle one) was asked the color of his own hat. He too couldn't answer. Tell the color of the Hat of the first person in the line?
===========================================
Solution:
Middle person couldn't tell the color. It means of the two persons standing in front of him at-least one of them was wearing a black hat.
Second person couldn't tell the Hat's color. He knows that there has to be at-least black hat either on him or on the first person. If the first person is wearing white then he is surely wearing black. But if the first person is wearing black, then he can't tell. Thus the first person is wearing black.
Showing posts with label puzzles. Show all posts
Showing posts with label puzzles. Show all posts
Monday, January 01, 2007
Hats
Posted by Romram at 7:45 PM 0 comments
Salaries of three persons
There are 3 persons A,B,C and their salaries are X, Y, Z respectively.
Problem: Device a scheme so that all three of them know X+Y+Z, by asking each other questions.
Constraint: None should come to the other one's salary, i.e. A should not know Y and Z and so on...
===============================================
Solution:
C tells B that its salary is K (a fake value)
B tells A the total K+Y
A tells C the total K+Y+X
Finally C calculates X+Y+Z and tells it to everybody.
Posted by Romram at 7:39 PM 0 comments
Subscribe to:
Posts (Atom)