Thursday, July 6, 2017

Prisoner Problem: A Riddle (Post 1 of 2)

NOTE: This is a two-part post. This first post will define the riddle, and the second post will present the solution and show some supplemental analysis.

PRISONER PROBLEM

A group of ten prisoners is all under a life sentence. The warden has decided to give them an opportunity to end their sentences early if they can successfully complete the following challenge.

There is a room with two switches in it. These switches do nothing other than serve as indicators--"on" or "off", "up" or "down", "1" or "0", "True" or "False", whatever. Each day, the warden will select one prisoner from this group at random to go into the room. This prisoner must toggle exactly one switch exactly once during the visit to the room; the prisoner may choose which switch to toggle. The warden will then ask this prisoner whether all 10 prisoners have been in the switch room at least once. If the prisoner answers "Yes" and is correct, all 10 prisoners will go free. If the prisoner answers "Yes" and is incorrect, the challenge is over and the prisoners will remain in jail for life. If the prisoner answers "No", the challenge continues regardless of whether or not the prisoner is correct. Both switches will begin in the "off/down" position. Once the challenge begins, the prisoners are not permitted to communicate with each other in any way. However, prior to the commencement of the challenge, the prisoners are permitted to collaborate and decide on a strategy to approach this problem. What strategy should they decide on now in order to set themselvesl all free?

There is no loophole to this game; for instance, they can't sneak a pencil into the room and leave a mark on the wall, no prisoners will die early, blah blah blah. All they have are the room, the switches, and the knowledge of how many prisoners there are. No funny business.

Special note: The strategy is generalizable for n > 1 prisoners. (If n = 1, the solution is trivial.) n = 10 was chosen for this set-up merely to concretize the problem.

Second special note: I was disappointed when the solution was revealed to me. I wasn't satisfied because the solution is stochastic rather than deterministic. But, the stochastic nature of the solution is what enabled me to dedicate an entire post to analysis of the solution, which I did enjoy. So...I guess I'm ok with it?

Go.

No comments:

Post a Comment