News for hackers. Stuff that matters.
Re:Puzzle: 100 Prisoners and a Light Bulb by shayan on Tuesday November 13, 2007 @07:58PM (#79600)
I would make every prisoner into a counter!

Everytime someone visits the room has to take the following two steps:

(1)actions:

- if it's their first time make sure the light is off (i.e. if off don't touch, if it was on, turn it off)

- if you have been there before make sure the light is on (i.e. if it was off turn it on, and if it was already on don't touch it)

(2)counting:

- if the light was off when you walked in then add one more to your count

- if it was on then don't count anything

this way everyone counts, we now have 100 counters. And whoever reaches hundred first (counting themselves in) should report it.

Note: the guy that went in on day one, should not count for the day before, but everyone else will count their day before if appropriate (based on the rules above).

Re:Puzzle: 100 Prisoners and a Light Bulb by curi on Tuesday November 13, 2007 @08:14PM (#79605)
so, the light gets turned off 100 times in total. there are 100 different people counting. none ever reach 100 in their count.
Re:Puzzle: 100 Prisoners and a Light Bulb by shayan on Wednesday November 14, 2007 @10:55AM (#79750)
I was trying to eliminate the one counter to make it faster, but I see your point ...you just saved a bunch of lives, and got yourself an up vote!...I looked at the other possible solutions and they all seem to take a while, but I am planning a escape, are you in?