[math-fun] Re: Hungarian prisoner switch puzzle
There are at least four solutions to the problem of the 23 prisoners and weird warden. The first three are efficient, the fourth is slow. 1. The prisoners realize that the room with switches is probably unused and dirty. They agree that the first time each of them is brought into the room, he will seem to spend a long time hesistating over which switch to change. While doing so, he will choose an unused spot on the floor and inconspicuously piss there. 2. The prisoners note that the warden has eight fingers, each with three sections (thumbs are not used in this solution). As each prisoner is taken from his cell to go to the switch room for the first time, he will quickly bite off one section of a finger. 3. The prisoners agree on to tell the warden the following: "We realize that you are a clever person who loves puzzles. We have one for you. We have selected a number that is the constant term of a degree 22 polynomial. Each day you can ask a prisoner the value of the polynomial at any argument except zero. The prisoner is allowed to either decline to answer, or he must evaluate the polynomial and tell you the result. If a prisoner asks you if you know the answer, you must answer truthfully. If you say you know the answer, you must tell him, and if you are wrong, you must release us and throw yourself into the alligator pit." 4. The prisoners ask the warden for 23 Palmpilots. One of the prisoners writes a program and beams it to the other prisoners. The program keeps track of the day and number of times the prisoner has been in the room; every 23 days is a "prison week", starting with week 0. As each prisoner enter the room, he enters the left switch position into the Palmpilot. If a prisoner goes into the room in prison week n and his total "been here" count is greater than n, he will be told to set the left switch up unless it is already up. He will do the same thing if his "been here" count plus the number of days left in the week is less than n. If there's nothing wrong with his count and it is the first day of the prison week, he will set the left switch down unless it is already down. If a prisoner has not changed the left switch then he will change the right switch. Before leaving the room, the prisoner will consult the Palmpilot. If it is the end of prison week, and if the left switch is down, the Palmpilot program will announce that it's time to tell the warden to release all the prisoners. They will throw the warden to the alligators, unless he has lost all his fingers.
participants (1)
-
The Purple Streak, Hilarie Orman