Brain Teasers
Guess Your Color to Escape!
A warden at a prison decides to give some prisoners a chance to escape by working together to solve a puzzle. He prepares a colored hat for every one of them and tells them the rules. The hats can be either black or white and will be placed on everyone's head. The prisoners will get a chance to discuss a strategy together, which they will all follow, then they will be marched out into a large room where they will see everybody else's hat color. Each prisoner will then simultaneously guess which of the two hat colors they have. If every one of them is right, or every one of them is wrong, they will all go free. However, the prisoners will not be allowed to communicate in any way during this process. Also, the warden will hear their strategy and place hats any way he can to prevent them from going free. What strategy do they use to escape?
Hint
Think about it for two people and then three people. What will be the difference between what a white hatted person sees and a black hatted person sees?Answer
Every prisoner should count up how many black hats they see. If they count an odd number of black hats, they say that they have a black hat. If they count an even number of black hats, then they say that they have a white hat.Hide Hint Show Hint Hide Answer Show Answer
What Next?
View a Similar Brain Teaser...
If you become a registered user you can vote on this brain teaser, keep track of which ones you have seen, and even make your own.
Solve a Puzzle
Comments
It doesn't say there will be an equal number of each color does it?
They should all guess "Red".
why would that work?
i agree that they should guess red.
i agree that they should guess red.
It needs to say that there is the same amount of black and white hats. Other tahn that, it is good, though.
Interesting teaser but I don't get it at all.
Basically, you need to get all the blacks to say one thing, and all the whites to say the other color. If one black hat sees an odd number of black hats, then another black hat will also see an odd number of black hats. A white-hat would see one more black hat than a black hat person (that person's black hat), and would see an even number of blacks. He would say the other color. I don't think that there has to be an even amount of white and black hats. Correct me if I'm wrong, and sorry to confuse you!
Very clever! At first I thought it was missing some info, but when I thought about it it absolutely would work! They would either all be correct or would all be wrong!
spinnercat> sorry to confuse you!
Why are you sorry to confuse me? I thought this was a good puzzle. I felt like I was close, but an answer seemed just-out-of-reach.
Why are you sorry to confuse me? I thought this was a good puzzle. I felt like I was close, but an answer seemed just-out-of-reach.
It didn't say that they had to guess black or white, so they would just say some other color.
Sep 06, 2007
Say there is an equal number of each: black hats will say black, white hats will say white
Say there is an odd number of white hats and an even number of black hats: white hats will say white, and black hats will say black (they are all correct)
Say there is an even number of white hats and an odd number of black hats: white hats will say black and black hats will say white (they are all incorrect)
Both solutions fit the premise of being either entirely right or entirely wrong.
Say there is an odd number of white hats and an even number of black hats: white hats will say white, and black hats will say black (they are all correct)
Say there is an even number of white hats and an odd number of black hats: white hats will say black and black hats will say white (they are all incorrect)
Both solutions fit the premise of being either entirely right or entirely wrong.
Sep 06, 2007
I do think there is two things you need to add to this:
The prisoners must guess either black or white hats. (Fuscia, Purple, or multiple colors would have caused all prisoners to be right)
Also, there is nothing to say they can't use unverbal communication. They could always each turn to their neighbor and offer either a fist to show the person is wearing a black hat or a flat hand to show the person they are wearing a white hat.
The prisoners must guess either black or white hats. (Fuscia, Purple, or multiple colors would have caused all prisoners to be right)
Also, there is nothing to say they can't use unverbal communication. They could always each turn to their neighbor and offer either a fist to show the person is wearing a black hat or a flat hand to show the person they are wearing a white hat.
Thank you, I tried to correct the only say black and white thing, but it was rejected. Thanks for the comments.
there is not enough information in this puzzle... I don't know how you got that answer... it would be a very good riddle if you let on that people somehow know how many hats of each color there are before they have to guess. It doesn't say that anywhere in the riddle. It is a really good idea though!
Actually, you don't need to know anything more to solve this. The solution works reguardless of how many of each color there are.
Sep 19, 2007
Thanks. Enjoyed this puzzle. Worth keeping in mind is the warden's rule: prisoners will--at the same time--guess what color hat they have. Answer not about how many black/white hats total. Warden wants them to guess all wrong or all correctly about their individual hat color.
Really Good
After I read the answer, I was thinking that it would only work if there were the same # of white & black hats, but after more thought (and reading the explanations in the comments) the logic hit me.
After I read the answer, I was thinking that it would only work if there were the same # of white & black hats, but after more thought (and reading the explanations in the comments) the logic hit me.
Had to re-read it a few times, but finally saw the light...To those who still don't get it, think of it in terms of finding a method for the prisoners to all guess the same way based on what they all see.
My answer as soon as I read this:
Officer: "Okay, guess your hats at 3... 2... 1..."
Prisoners: "BLUE!"
Officer: "Okay, guess your hats at 3... 2... 1..."
Prisoners: "BLUE!"
It doesn't say in this puzzle that there will be an even amount of black and white hats. For all I knew there could be only one black hat and the rest could be white. You can't leave things for people to assume in a logic puzzle
^ yes, there could be. It doesn't matter at all. The solution works for any amount of white and black hats.
That would work, but there are two simpler solutions:
1) Pushing the hat down on your eyes so that you can see it.
2) BLUE!
1) Pushing the hat down on your eyes so that you can see it.
2) BLUE!
I would say gray, being that it is impossible to create a perfect black or perfect white, you always end up with some shade of gray.
Oct 09, 2012
Love this brain teaser! Also found something similar here with a nice explanation:
programmerinterview.com /index.php/puzzles/ hat-puzzle-black-and-white-hats/
programmerinterview.com /index.php/puzzles/ hat-puzzle-black-and-white-hats/
To post a comment, please create an account and sign in.
Follow Braingle!