24 March 2019

What am I doing wrong with this puzzle?

Remember the puzzle I posted last Saturday? https://www.rajibroy.com/?p=18817 The real problem in the book “The Riddler” (thank you Matt Moore for giving me that book) had 7 in the team – not 3. And the answer the book has 7/8. I am getting a far better probability. What am I doing wrong?

The problem, to remind ourselves is – randomly a black or white hat will be put on each of 7 of us. We cannot see our own color but we can see everybody else’s color. When called upon to guess our own color, we can call Black or White or we can say Pass. If one calls Black or White and is right, then the whole team wins. If it is wrong, then the whole team loses. However, if Pass is called, another person in random is asked to guess the color on their head. If everybody Passes then the whole team loses. What is the strategy to maximize the chance to win and what is that probability?

I am attaching the answer in the book which comes to 7/8 (using XOR logic).

My answer is the following:
The first person : If he sees the same color on the other six, he randomly calls a number. Else he says Pass.

The second person : Now he gets a chance only if the first person called Pass. Which means the first person has effectively said “All of you DO NOT have the same color”. So, if the second person sees the same color on everyone of the rest five, he simply calls the opposite color. He is guaranteed to be right. If he sees NOT all hats with the rest five to be of the same color, he simply says “Pass”.

The third person : uses the same logic. If the rest four have the same color, simply call the opposite color. Else say Pass.

This will go recursively and somebody is guaranteed to get the right answer. (In the absolute extreme case, The fifth person will call Pass – which is telling the sixth and seventh person – “Hey you two have different colors” and the sixth person can see the seventh person’s hat color….)

So independent of how many original players were there, there are only 2 cases the team loses – when the first person saw everybody else having the same color (all white or all black) and his random guess of his own color turned out to be wrong.

So, they lose with a probability of 2 / (2 the power n)

Winning probability is (1 minus the above) – which is much higher than 7/8

What am I doing wrong?

Posted March 24, 2019 by Rajib Roy in category "Puzzles


  1. By Jared Bronski on

    I think that you are solving a slightly different puzzle. In your version the guesses are taken sequentially, and everyone has perfect information. Anna guesses first, Ben goes second and knows what Anna guesses, Clarice goes third, etc.

    I do not have a copy of the book “The Riddler” but in the version of the puzzle that I am familiar with each player must make his or her guess based solely on what they know about who is wearing which hat. They do not know about prior guesses. Imagine, for instance, that each player is taken to a locked room. She is shown a picture of her 6 friends wearing white or black hats, and must guess based only on this information without knowing what other people have guessed. So when Clarice is asked for her guess she will not know if she is the first player or the last player or how many previous players might have passed. In this case the solution using the Hamming code is optimal.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.