Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The group selects one person to work as a counter. All other prisoners will only turn on the light if it is off and it is their first time in the room (if it's on they do nothing).

The counter will always turn the light off (and count the number of times he does so).

When the counter reaches 99, he knows that all 100 prisoners have visited the room.

It could take forever - especially since the jailer can not be truly random and could potentially pick a single prisoner (or even the counter) every single day.



Aren't the chances of it not taking forever infinitesimal?

All it takes is two prisoners to go to the room in between counter visits, and the counter will only ever reach 98.

See the subtle difference between slashcom's answer and yours?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: