Generalization of this downside:
Guessing hat colours. 4 prisoners
Suppose that there’s $N$ prisoners, insted of $4$. Shows, by discovering explicitly the technique, that if $N$ is even there’s a technique that permits prisoners to avoid wasting themselves with certainty. Show as an alternative that if $N$ is odd there isn’t any technique that permits prisoners to avoid wasting themselves with certainty. However for the case $N$ odd, assuming that for every prisoner the hat’s colour is choosen with chance $1/2$, discover the optimum technique on this case.
Edit: For the second a part of my query, if $N=2k+1$, I do not know if that is optimum however I can save them with chance
$$ frac{ binom{N}{okay} + 2 sum_{j=0}^{k-1} binom{N}{j} }{2^N} = frac{2^N – binom{N}{okay}}{2^N} = 1- frac{binom{N}{okay}}{2^N} $$