I came across this variant of the prisoner-hat problem the other day and couldn't seem to muster a proper solution:

$6$ prisoners are on an island and are each assigned a hat numbered $1$ through $7$, but here's the catch: one number is randomly removed. The prisoners have to all guess the number on their hats correctly. Is there a winning strategy and if so, what is it?

  • 2
    $\begingroup$ I suppose they can't talk/communicate with each other and they can't see their own hat's number. $\endgroup$ – Raskolnikov Dec 19 '15 at 18:16
  • $\begingroup$ Please give more information about the question. Can they see all the other hats? Can they see their own hat? How much are they allowed to say? Do they all have to guess correctly? $\endgroup$ – Omnomnomnom Dec 19 '15 at 18:19
  • $\begingroup$ Yes, usual rules apply, they cant communicate during (only beforehand), they can see each other's hats, but not their own, and they all have to guess correctly (I'm honestly not sure whether this has a solution). $\endgroup$ – InCtrl Dec 19 '15 at 18:25
  • $\begingroup$ They can't all guess correctly without some form of communication. As things stand, at least one person has to risk getting his hat color wrong in order to communicate. $\endgroup$ – Omnomnomnom Dec 19 '15 at 18:31
  • $\begingroup$ At best, the first prisoner has a $50/50$ shot of guessing his hat correctly. $\endgroup$ – Omnomnomnom Dec 19 '15 at 18:39

Solution with at most one wrong guess:

First guesser sees which (two) hats are missing. His guess is their sum $S$ modulo $7$.

Each other person sees the value $H$ of the hat of the first guesser. They each calculate $S - H$ modulo $7$, and deduce which hat is missing from the group.

Now, the remaining prisoners can each correctly guess their hat.

  • $\begingroup$ Note that, in this scenario, the first prisoner is nearly guaranteed to guess his hat incorrectly. $\endgroup$ – Omnomnomnom Dec 19 '15 at 18:40
  • $\begingroup$ I do not understand what you mean with "their sum $S$ modulo 7". If for example the two missing hats are say $3,4$ then he would guess $S=3+4=0$ mod $7$? Can you please explain, thanks! $\endgroup$ – Jimmy R. Dec 26 '15 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.