Hacker News new | past | comments | ask | show | jobs | submit login

So? It doesn't have to be true that each prisoner will be visited within any particular time frame.



The solution only requires that they will eventually be visited; you can keep deferring until they are. There's no specific time frame in which you have to make a guess.


> There's no specific time frame in which you have to make a guess

This is correct.

> The solution only requires that they will eventually be visited; you can keep deferring until they are.

This is false; you can't "keep deferring until everyone is visited" because you have no way of assessing whether that's happened. As a strategy, it is impossible to implement.


Yes, you can: the designated prisoner waits until the signal has been fipped n+k times where n is the number of prisoners and k is the number of times the guard can intervene. All other prisoners flip it to that state if it isn't already. See the other replies.


That is a completely different strategy than "if we wait long enough, it's bound to work". Waiting is worthless, no matter how long you wait.


But under the corrected assumption about the problem, you can reliably know when it is safe to say that all prisoners have been in the room and when you should keep deferring. In the other version of the problem, I agree there's no such guarantee; hence why I bought up the difference.




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

Search: