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
what is the diffrence between software and hardware language?
What is dialog programming?
what are resources in case of Threads
Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that.
When we delete logfiles such as screenshots how does it affect the ldf file? Ive seen huge change while adding screenshots in the ldf file but a very minor one deleting them.Please Explain
When you deliver your C++ headers and C++ library of a class (what all can you change in the class so that application using your class does not need to recompile the code)
will it allow to add same value in HashMap class.
what is difference between kpo and it industry? that is in terms of work, package etc
what is the difference between Windows application and Unix application?
what is the purpose of checked Menu options
i am getting the error while compiling my cics program with including db2 dclgen member it is showing that ur dclgen member not including and all the host variables are undeclared
I need source code for Enrollment System using Visual Basic 6.0/2008 database MS Access 2007 for my school thesis project...please help me..kindly send in my email jpinedamcp@gmail.com
define profiler???
along with oracle which language will be beneficial to have knowledge with,java,.net,since i m doing oracle have appeared for 8th sem BEIT,plz suggest
Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)