[Tutor] How to solve it ...

Bob Gailer ramrom@earthling.net
Sun Feb 16 19:49:19 2003


--=======5D666865=======
Content-Type: text/plain; x-avg-checked=avg-ok-21B32D4F; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit

At 09:11 PM 2/16/2003 +0100, Gregor Lingl wrote:
>The lock of the door is controlled by four simple switches, which are
>arranged in a square. The door opens if all the switches are "on" or if all
>of them are "off". When a member arrives to enter, the door always is
>locked, which means that some switches are in the on position and some are 
>off.

>No one who wants to enter can see the switches or touch them directly.

Assumption 1: approach the door with no desire to enter. Then you can see 
and touch the switches directly, and opening the door is a matter 
of  flipping 1 or 2 switches.

>Instead, there are four buttons on the door, labelled "P", "D", "1" and "2".
>If you press "P", a pair of two switches in a horizontal or vertical row is
>randomly selected. If you press "D" a pair of diagonally arranged switches
>is randomly selected.
>After this selection has taken place, pushing button "1" randomly selects
>one of the previously selected switches and changes its position. Contrary 
>to that,
>pushing "2" switches both of them. The sequence "letter, digit" may be
>repeated until the door opens (or you lose patience).

D2 P2 D2 P1 D2 P2 D2 (the door might open after any step other than P1, and 
will open, if not sooner, after the final D2.) Detailed analysis available 
on request. Note that D1 is equivalent to P1, so D2 P2 D2 D1 D2 P2 D2 is an 
equivalent solution.

Bob Gailer
mailto:ramrom@earthling.net
303 442 2625

--=======5D666865=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-21B32D4F
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 2/10/2003

--=======5D666865=======--