3 ms·
But would it not be sufficient to count p? If switch A starts out in the ON position it would equal one 'fake' prisoner. If the counter just counts one extra (
by TobbenTM 13y ago
But would it not be sufficient to count p?
If switch A starts out in the ON position it would equal one 'fake' prisoner. If the counter just counts one extra (which equals p - 1 (himself) + 1 (fake prisoner) = p) it should be enough, no?
- Serplat 13y agoThe issue is that the counter doesn't know the state of the first switch at the start. If it's on at the start, then sure your solution will work. But if it's off at the start and they all agree to only flip on the switch once, then the counter will sit around forever waiting for p flips, when only p - 1 will ever happen. They need a solution that will work no matter what state the switch is in at the start.