QuantForcesquant interview practice

02037. Rainbow hats

difficulty 1800·answer type: strategy·Not solved

Problem

Seven prisoners are given the chance to be set free tomorrow. An executioner will put a hat on each prisoner's head — each hat can be one of the seven colors of the rainbow, chosen completely at the executioner's discretion. Every prisoner can see the hat colors of the other six prisoners, but not his own. They cannot communicate, but each must write down his guess of his own hat color simultaneously. If at least one prisoner correctly guesses his hat color, they all go free. Is there a strategy that guarantees they will be set free?

Submit answer

You must be signed in to submit answers.