# Prisoner Switch

A warden meets with 23 new prisoners when they arrive. He tells them, “You may meet today and plan a strategy. But after today, you will be in isolated cells and will have no communication with one another.

“In the prison is a switch room, which contains two light switches labeled A and B, each of which can be in either the ‘On’ or the ‘Off’ position. I am not telling you their present positions. The switches are not connected to anything.

“After today, from time to time whenever I feel so inclined, I will 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 one, but only one of the switches. He can’t move both but he can’t move none, either. Then he’ll be led back to his cell.

“No one else will enter the switch room until I lead the next prisoner there, and he’ll be instructed to do the same thing. I’m going to choose prisoners at random. I may choose the same guy three times in a row, or I may jump around and come back.

“But, given enough time, everyone will eventually visit the switch room as many times as everyone else. At any time anyone of you may declare to me, ‘We have all visited the switch room.’

“If it is true, then you will all be set free. If it is false, and somebody has not yet visited the switch room, you will be fed to the alligators.”

Here’s the question:

What is the strategy the prisoners devise?

And here are the hints I’ll give:

Hint number 1: A sixth grader could figure this puzzler out.

Hint 2: Take a long-term perspective.

And Hint 3: Solve the puzzler for three prisoners–it’s the same answer.

### 3 guesses to Prisoner Switch

Warning: Use of undefined constant bfa_comments - assumed 'bfa_comments' (this will throw an Error in a future version of PHP) in /home/customer/www/riddledude.com/public_html/wp-content/themes/atahualpa/comments.php on line 132
• Paul

This is making my head hurt, so I’ll toss out my current thought before I think of a flaw and have to start over.

Each prisoner would be instructed to flip switch A off only if it’s their first time in and the switch was in the on position. Any subsequent flips would be to switch B either on or off, as that is not the control switch. If it was a prisoner’s first time, but the switch was in the off position they would switch B. A selected lead guy/counter guy from the initial strategy meeting would flip switch A to the on position every time he enters the room to reset the count. He would keep track of how many times switch A is turned off. Once it was switched 22 times, he’d know all had been in the room.

The prisoners all meet, and the leader of the prisoners says, “Okay, guys, here’s our strategy. First, there’s only one guy who can count past two, so we’re naming him ‘The Counter.’ He’s going to be responsible for telling the warden we’ve all been in the switch room when the time comes.”
He then proceeds to give instructions to the other inmates. He says, “We’re going to designate Switch A — the switch on the left – as the “real switch.” That’s the only switch that matters to The Counter. The other switch, Switch B, is a dummy. It won’t tell us anything, and you just use it when you have to move a switch, but don’t want to move Switch A. You got it? So Switch A is the meaningful switch and Switch B is a placeholder.”
So, each of the 22 prisoners is told, “When you go into the switch room, we want you to move Switch A to the “On” position. If Switch A is already in the “On” position, then leave it there, flick switch B and walk out.” All the prisoners nod.
Now I want each of you to flick Switch A to the “On” position twice, and only twice. So if you go in there and Switch A is already on, that doesn’t count. I want each of you to actually flick it “On” two times. You got that? ”
All the prisoners nod. One of them raises his hand, tentatively.
“Yes, Berman?”
“Who’s going to be flicking Switch A off, he asks.
“Good question,” says the leader. “The Counter is the only one with the authority to turn off Switch A.”
So, each time The Counter is taken into the switch room, finds the switch in the “On” position, he knows that at least one prisoner has been in there.
It could be one prisoner who came in and turned it on, or it could be six prisoners — the first one turning it on and the next five leaving it on. But when The Counter walks in and finds Switch A in the “On” position, he knows at least one prisoner has been in the room since the last time The Counter turned the switch off.
And when you work it all out, The Counter has to turn off Switch A 44 times in order to know that all 23 prisoners have been in the switch room. And the reason he has to count that high is that he doesn’t know what the original position of the switch is, and therefore he has to wait for everyone to go in twice.
In other words, if the warden started with Switch A in the “On” position, and The Counter was brought in first, he could be fooled into thinking that another prisoner had been in there. And that’s why it’s 44 instead of 22.

Paul, you had the correct premise of this very very tough riddle so …

You’re today’s winner!!!!!