Bright Idea

A jailer will send each of a group of n prisoners alone into a certain room. Each prisoner will visit the room infinitely often, but the order of the visits will be determined arbitrarily by the jailer. The prisoners can confer in advance, but once the visits have commenced they can communicate with one another only by means of a light in the room, which they can turn on or off. How can they ensure that some prisoner will eventually be able to determine that everyone has visited the room?

Click for Answer