desh: (fuzzy sweatpants)
desh ([personal profile] desh) wrote2006-01-25 12:46 am

puzzle

LOGIC PUZZLE TIME!

This is one of my favorite puzzles, both because the answer isn't easy, and because the setup is very similar to another problem a lot of people know.

You and two other prisoners are set to be executed. You're given one chance to get out, by some sadistic game invented by your captors. (Isn't that how it always is?)

You're each privately given a hat, which is either red or blue (randomly chosen, independent of the hats chosen for the other people). You can't see your own hat. Once you're all wearing the hats, you're ushered into a common room where you can see the other two people and their hats. Without being allowed to communicate, you're then sent back to your solitary confinement and your hats are removed.

Each of you is then given a piece of paper to write down your hat color. You may either write "red", write "blue", or leave the paper blank. If any of you guess wrong, or if you all leave your papers blank, then you're all executed. But if even one of you guesses right, without any wrong guesses, you're all set free.

If you are allowed to discuss strategy among the three of you before the hats are handed out, but you're allowed no communication during or afterwards, what is the optimal strategy? In other words, what should you do such that you all have the best chance of survival? (The answer is "legit", assuming no wording loopholes, no color-blindness, no sympathetic guards, and nothing else like that.)

(Comments to this post are screened, but only correct answers and really good guesses will remain screened. I'll unscreen questions, comments, wrong answers...almost everything except correct answers. Eventually, I'll unscreen everything.) EDIT: Comments now contain spoilers.

[identity profile] vox-dei.livejournal.com 2006-01-25 08:07 am (UTC)(link)
Okay, I'm not sure here or anything but here's a guess. I think that the people should make the decision whether to leave the paper blank based on the color of the hats that they see when they're in the room. At least two of the people will have the same color hat, so a person that enters and sees the other two people wearing hats of the same color should write an answer. The reason that it should be the person that sees to hats of identical color is that it is guaranteed that at least one person will have an answer. If you were to assign the job to someone who saw hats of both colors and it turns out that all three wore the same color hat, then all papers would be left blank. Now, if you assign the job to a person that sees hats of the same color, then it could play out in two ways:

1) Two hats are the same and one is different. This means that only one person will fill out the paper.
2) Three hats are the same. This means that all of them will include an answer.

Now, the person that sees both hats of the same color can either decide that his hat is the same as theirs or is the other color. In the first scenario, the odds that he'll be right are 50/50, but in the second scenario it is clear that each person ought to say that his hat is the same color as the two that he sees. Because none of the people can determine which of the two scenarios is the case, it is to the person's advantage that sees two hats of the same color to guess that his hat is the same as theirs. I think.