Originally posted by: stan394
Answer:
During the discussion phase, the 30 prisoners designated one as the Counter.
For a non-Counter prisoner, he turned on the light bulb, if
- the light bulb is off, and
- and he has never turned on the light bulb before, and
- he did this only once, ever
For the Counter, he turned off the light bulb, whenever
- he sees that the light bulb is on.
The Counter can go talk to the warden once he turned off the light bulb 29 times.
EDIT:
For a more fault tolerant solution, each non-Counter prisoner turned on the light bulb twice only when it's off. The Counter goes talk to the warden after he turned off the light the 59th time.