7 hats, 6 prisoners

105 Views Asked by At

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?

1

There are 1 best solutions below

2
On

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.