Jan. 15th, 2013

alexxkay: (Bar Harbor)
Solution to my recent Colored Hat Puzzle:

Assign each hat color one of the digits from 0-9. Any given set of hats must add up to some number. The total must end in a specific digit, also from 0-9. The prisoners each agree to assume a different final digit. One of the prisoners will be correct in their assumption, the other nine will not. When you see the other nine prisoners' hats, add up their numbers and see what the last digit of this (partial) sum is. Then, using your own assumption as to what the final digit should be when your hat is included in the final sum, do some simple arithmetic to determine the necessary number (and thus color) of your own hat.

This solution can be generalized to N prisoners if the prisoners all know (or can quickly learn) either the concept of modulo arithmetic, or arithmetic in arbitrary number bases. With exactly 10, however, only simple 'standard' arithmetic is needed.

Note that the odds of any *particular* person surviving are the same using this strategy as if they had guessed randomly, 1 in 10. This strategy just divides up the possibility-space in such a way that it guarantees exactly one survivor.

So, given that such a strategy exists, *should* you use it? The strategy puts a lower bound on the possible outcomes, but also an upper bound. Choosing randomly *could* let all ten of you survive (though very unlikely). Using this strategy guarantees that nine of you will die -- a very poor outcome.

If all prisoners are patriotic spies who desperately want one of them to survive to deliver the Death Star plans to the Rebel Alliance, then sacrificing the other nine makes some sense.

If two of the prisoners are a married couple who want to survive if *and only if* their spouse does also, then they definitely don't want to follow this strategy. I was talking this over with [livejournal.com profile] herooftheage, who came up with an elegant strategy that such a couple could follow in order to obtain their desired result. Can you? Does it work for a polyamorous relationship of 3? Or more?

I note that the statement of conditions does not say that the arrangement of hats will be random, only that it *might* contain a wide range of possibilities. Assuming I wasn't in the patriotic spy scenario, I would definitely assume that the hats would have a pattern, and base my guess on my own pattern-matching abilities. It's possible that the mad logician who has us imprisoned actually intends that and will deliberately provide us with a pattern. Alternately, he may not intend there to be a pattern, but leave the logistics of hat placement in the hands of a minion who isn't a random number generator.

Profile

alexxkay: (Default)
Alexx Kay

February 2025

S M T W T F S
      1
23 45678
9101112131415
16171819202122
232425262728 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags