# 7 hats, 6 prisoners

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?

• I suppose they can't talk/communicate with each other and they can't see their own hat's number. – Raskolnikov Dec 19 '15 at 18:16
• 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? – Omnomnomnom Dec 19 '15 at 18:19
• 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). – InCtrl Dec 19 '15 at 18:25
• 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. – Omnomnomnom Dec 19 '15 at 18:31
• At best, the first prisoner has a $50/50$ shot of guessing his hat correctly. – Omnomnomnom Dec 19 '15 at 18:39

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.
• 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! – Jimmy R. Dec 26 '15 at 18:10