QuoteWell he has to know in which specified period the switch was turned on. If the light is on at the end of such a period then the person visiting on the last day must take the tokens. He can, however, turn the light switch on, or leave it on on such days if he leaves the required number of tokens in the light switch.
Originally posted by: Starboy
You have two variable holders: the lightbulb and the day. If the counter does not need to know when the light switch was turned on, all he has is the lightbulb variable...
So that's why you have the standard count, so he knows how many to add. Interesting...
It is complicated in algorithm form, but on a 1-to-1 basis as described above the prisoners need only follow a set of easy rules. The way I've written them above is generic, the rules they would need to follow are very easy.