This is a puzzle question ....
The 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.' and be 100% sure.
"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."
What is the strategy they come up with so that they can be free?
Answer Posted / samy
The above answer is correct. But not optiomized. Onr small
correction. Everyone need to Flip the first switch only
once. And leader Need to Flip the first switch 22 times.
Is This Answer Correct ? | 9 Yes | 32 No |
Post New Answer View All Answers
Write a shell program to test whether a given year is leap year or not ?
Differevce between arrays and array builders?
can we allocate memory for interface? if no then why?
diffrence between oracle apps , .NET , SAP
what are the missinschema properties and should we pass primary key in select command
we create a pf with 3 fields.2 is defined as keyfields.we lock it with alcobj command.how we find out whether the file is locked or not?is it dspfd??/
how do we provide security for web services
public static void main(String args[]) describe it
what does mean and stack mean in genral programming?
Tag for turning an image into a hyperlink is
What are the Short cut Keys of Tally ERP?
I m new to the dbms. Recently i came across words clustered indexes & nonclustered indexes but i dont know what is this all about & whats the difference between them.. So please help me!!!!!!!!
how can we implement locks in plsql?
hi this is uday i want prepare for nic exam if any one have previous question papers please send me or atlest guide me how to prepare my ID is udaykiran4u@in.com
Is anyone has done the ASP.NET MVC4 workshop course(2 days) from Peers Technologies. Let me know. I need to talk before joining ASP.NET MVC4 training at peers, Hyderabad.