Erik Reuter wrote:
>
> I've been thinking about this in my spare moments for the past few
> days and I think I have a solution. Hopefully there are no bugs in my
> strategy (please let me know if there are). Here it is:
>
> Choose one prisoner, call X
>
> Rest of prisoners called R
>
> -------------------
> Strategy for X:
>
> Initialize (in X's memory) a signal counter S = 0
>
> IF NOT X's first time in room THEN {
> IF state of switch B has changed where X left it last THEN {
> IF switch B changed from on to off THEN yell "Shit!" break;
> ELSE IF switch B changed from off to on THEN increment S
> }
> }
>
> IF S >= 22 THEN declare "Everyone has visited" [much celebration];
>
> TOGGLE switch B and remember its state
> ----------------------
>
> ----------------------
> Strategy for all R's:
>
> Note the position of switch B
>
> IF you have seen switch B in an up state on a previous visit
> AND you have NOT ever toggled switch B
> AND switch B is currently in a down state
> THEN TOGGLE switch B
> ELSE TOGGLE switch A
> ------------------------
Erik--
It seems to me that there could be Rs who never
"checked in". Couldn't an R keep visiting the room and
never see B in the up state? Then they would always do
the ELSE clause, S would never get to 22, and they would
all stay there indefinitely.
---David
_______________________________________________
http://www.mccmedia.com/mailman/listinfo/brin-l