As is typical in your line of work, you find yourself trapped in a room with only one possibility of escape. On this occasion, Doctor No leaves you a puzzle to solve.
You wake up in a room with a single door, which you observe is the only way out of the room. On the door are 10 dials, which can be turned so that the digits 0-9 can appear. There is also a small red button. Next to the door is a wooden table with a computer. The computer interface only has 10 buttons, one for each digit. The screen has two rows of 10 squares.
On the wall, you see a note: “Since you are reading this, you must be awake. I could have just killed you, but the scriptwriters would never allow this, so they thought you should be given some chance to escape. The room you are in is equipped with exactly two means of killing you. One is some poison gas vents. The other is the floor, which can open, causing you to fall into a pit of alligators, poisonous snakes, and whatever other deadly things my trainee henchman has brought in.
When you select a code on the door and press the little red button, the door will open in 10 minutes. However, first one of the two traps will probably go off. Shame I couldn’t use both, really, but it wouldn’t do to kill off all my lovely pets.
You may have noticed the computer in the room. This is a special computer that works on a certain rule. You can enter a 10 digit number, and based on the rule, the computer will output a new 10 digit number. The door mechanism is related to the computer. For any given 10 digit number, x, and its output, y, if setting the dials on the door to x opens the floor, then setting them to y will cause the poison to flood the room. And, conversely, if x brings poison the room, y will open the floor.
Good luck, old bean.
You go back to the computer for a second look, and try a few random numbers. When you input 9630751442, you get 1111211101. When you input 6626012798, you get 1120003111. When you input 3578545411, you get 0201230110. When you input 4720309962, you get 2021101102. You obviously don’t want to try to survive 10 minutes in a poisoned room, or in a pit of deadly animals.
But how can you get out?