Wednesday, September 05, 2007

Prisoners and Switches

A prison warden meets with 23 new prisoners when they arrive. He tells them, "You may meet today and plan your strategy for the challenge I'm about to propose. But after today, you'll be in isolated cells and will have no communication with one another. In the prison is a switch room, which contains two switches labeled A and B, each of which can be in either the On or Off position. The switches aren't connected to anything. I'm not telling you the switches' present positions. After today, from time to time, whenever I feel so inclined, I'll select one prisoner at random and escort him to the switch room. This prisoner will select one of the two switches and reverse its position. He must move only one of the switches. He can't move both switches, and he can't move neither switch. Then, I'll lead the prisoner back to his cell. No one else will enter the switch room until I lead the next prisoner there, and I'll instruct him to do the same thing. I'm going to choose prisoners at random. I might choose the same prisoner three times in a row, or I might jump around and come back. However, given enough time, everyone will eventually visit the switch room as many times as everyone else. At any time, if you're 100 percent certain, any one of you can declare to me, 'We have now all visited the switch room.' If that person is correct, I'll set you all free. If that person is wrong, and somebody hasn't yet visited the switch room, I'll feed you all to the alligators."

What strategy can the prisoners use to obtain freedom?


4 Comments:

At Monday, January 07, 2008 4:50:00 PM, Blogger Caci said...

I don't have a well thought out answer yet, but I am thinking it might have something to do with the guys counting themselves off like 1,2,1,2,1,2.....etc and all 1's only mess with switch "a" and all 2's only mess with switch "b". Like I said it isn't well thought out yet, because I am still not sure how they will know when everyone has been in the room an equal number of times. The warden said that they could say when everyone had been in the room....at least once? because he also said everyone would be in there the same number of times...meaning they could all have been in there 3 times, but wouldn't they have all been in there at least once before they were all in there 3 times? Not sure about that part....

 
At Tuesday, January 08, 2008 8:26:00 AM, Blogger Michael said...

You’re getting on the right lines. The warden saying that everyone will be in there the same number of times is just meant to say that he’s not always going to pick the same guy. Of course, the prisoners could end the game before everyone has been an equal number of times if they know that everyone has been at least once.

 
At Wednesday, January 09, 2008 10:09:00 AM, Blogger Michael said...

Well, Caci gave in and called me, so I'll go ahead and post the answer here.

The prisoners choose one person to do the counting, and that person is the only one allowed to turn switch A off. Every other prisoner, when the enter the room, can turn switch A on if it is off and they have never turned it on before. Otherwise, they just flip switch B. When the counter comes in the room, he turns switch A off if it is on or he just flips switch B. Everytime he turns switch A off, he increments his count by one. When he has counted the total number of prisoners, then they will have all visited the room.

 
At Wednesday, January 09, 2008 4:18:00 PM, Blogger Caci said...

what do you mean I gave in and called you? I had a day of deep meditation, saw the Virgin Mary and was transported into the room with the prisoners....I saw it happening before my very eyes, the one prisoner switching only A and counting....it was so real.....I must have called while I was in my trance.....

 

Post a Comment

<< Home