10 prisoners are locked up in individual cells, unable to see, speak or communicate in any way with each other. There is a exercise room with a single light, that is initially off and the prisoners cannot see the light from their own cell.
Every day, the warden picks a prisoner at random, and that prisoner goes to the exercise room.
While there, the prisoner can choose to switch the light on or off, and are not allowed to leave a message.
At any point, any prisoner can claim that all 10 prisoners have been to the exercise room. If they are wrong then all 10 prisoners will be locked up forever! However, if they are correct all of the prisoners are set free.
Before the random picking begins, the prisoners are allowed to discuss a plan. What is their best plan to determine when all 10 prisoners have visited the exercise room?