Question
you are one of P recently arrested prisoners. The warden a deranged computer scientist, makes the following annoucncemnt You may meet together today and plan
you are one of P recently arrested prisoners. The warden a deranged computer scientist, makes the following annoucncemnt
You may meet together today and plan a strategy, but after today you will be in isolated cells and have no communication with one another.
I have set up a switch room which contains a light switch, which is either on or off. The switch is not connected to anything.
Every now and then, I will select one prisoner at random to enter the switch room. The prisoner may throw the switch (from on to off, or vice versa), or may leave the switch unchanged. Nobody else will visit the room at that time. No one other than the selected prisoner will know that I took him to the switch room.
Each prisoner will visit the switch room arbitrarily often. More precisely, for any N, eventually, each of you will visit the switch room at least N times.
At any time, any of you may declare: We have all visited the switch room at least once. If the claim is correct, I will set you free. If the claim is incorrect, I will feed you to the crocodiles. Choose wisely!
None of the prisoners know the initial position of the switch. Write a correct winning algorithm, one that results in one of the prisoners declare We have all visited the switch room at least once correctly, without all of them being fed to the crocodiles. Explain clearly why your algorithm is correct.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started