Puzzle: "Yes colour of my hat is white."

1k Views Asked by At

There are $n$ people in room each being put on hat from amongest at least $n$ white hats and $n-1$ black hats. They stand in a queue, so that everyone can see the colour of the hat of the person standing in front of him.

Starting from the back we ask the person in turn, "Do you know the what is the colour of your hat?" If the first $n-1$ person say no, prove that front person will say "Yes colour of my hat is white."

original question

3

There are 3 best solutions below

2
On

I'm supposing every person can see the color of all the hats in front of him.

If the last person in the queue says $no$, then every one hears his reponse and then knows that there is at least $1$ white hats on the head of the first $n-1$ persons. Because otherwise the last person can deduce his own hat is white.

Now for the second last person, if he sees no white hat in front of him, then he knows his own hat is white. But he says still $no$, which means there is at least a white hat in front of him. And his response is heard by everyone and everyone knows there is at least a white hat on the head of the first $n-2$ persons.

Similarly, if one person says $no$, this means there is at least a white hat in front of him and everyone knows that information after they hear the response.

So finally the first one knows his hat is white..

3
On

Solution:

Let $p(n)$: If first $(n-1)$ people say no, the person in the first will say yes.

For $n = 1$ , there are no black hats$(n-1=1-1=0)$. Hence the first person will say “Yes colour of my hat is white.”

Suppose the statement is true for $n=k$.

Let $n=k+1$

See how the man standing in the front would think. Suppose my hatis black, then there are $k$ people with at least $k$ white hats and $k-1$ black hats.

By $p(k)$, since first $(k-1)$ person said no, the person behind me must say yes. "I know the colour of my hat is white"

If he says mo. So colour of my hat can not be black. Hence it is white.

So $p(k)$ is true

so, $p(k)$ is true $\implies$ $p(k-1)$ is true.

Hence by the principle of mathematical induction it is proved!

Explanation:

IF $n=2$, there is 1 black hat and at least 2 white hats. If the last person sees a black cap is put on by the person in front on him, he would definitely say "yes colour of my hat is white" as there is only 1 black hat.

But if he not able to answer first person will logically thinks he has put white hat and person behind him might have out black or white hat.

0
On

This is not an answer, as there is a serious problem in the formulation.

As I said in my comments, each of the persons has to be able to see the hats of all the persons in front of him/her. Not just the hat of the guy next to him/her.

Let me explain why with the current formulation, it does not work even for $n=3$.

The first one will say I don't know regardless of the colour of the hat of the second guy. So his answer DOES NOT provide any piece of information to the second and third guy. Similarly, the second guy will also answer no, regardless of what he sees on the head of the third guy, and this also does not provide any information to the third guy.

On the other hand, if the first could see the hats of the 2nd and 3rd guy, then by saying I don't know, the 2nd and 3rd guys obtain the information the the 1st guy does not see 2 black hats. So if the 2nd guy also says, I don't know, then the 3rd guy will know that his hat is not black, for if it were black, then the 2nd guy, knowing that the 1st does not see 2 black hat, his own hat would be white. This argument can be generalised using induction to $n$ white and $n-1$ black hats.