Ten prisoners are being held in separate cells. Periodically, one of the prisoners is taken individually to a room containing a switch that can be turned on or off, but does not control anything. The prisoner may turn the switch on or off, or do nothing. Before any of the prisoners visited the room, the switch was in the off position. Some prisoners visit the room more than once, before other prisoners have visited the room at all, and they are not aware of each other’s visits. The ruler has decreed that when any one prisoner is certain that all the prisoners have visited the room, he may say so. If he is correct, all the prisoners will be released. If he is incorrect, all the prisoners will be executed.
You have one opportunity to give a single set of instructions to each of the prisoners, to help them determine with certainty when all of them have visited the room. What do you tell them?
The AnswerSee Answer