tag:blogger.com,1999:blog-5730391.post8338170622121713570..comments2019-01-20T19:38:38.339-08:00Comments on Blaine's Puzzle Blog: Friday Fun: Rapidly Rotating Electronic LockBlainehttp://www.blogger.com/profile/06379274325110866036noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-5730391.post-22466721960461141792009-05-06T13:04:00.000-07:002009-05-06T13:04:00.000-07:00What I was trying to convey was that if you exclud...What I was trying to convey was that if you exclude "D" as a starting position, then you can skip the first step (i.e. only use steps 2-8) and you have a 7-step solution. In either case, the longest solution always occurs on the lock that started in an "A" position. So including D doesn't mean that D is solved in the last step, only that it requires an extra step early on to eliminate it. I'm not sure off-hand if my solution is optimal.<br /><br />You might also investigate what happens with more or less buttons. I think (but haven't proven) that a three-button lock can never have a guaranteed solution in a finite number of tries; I haven't looked at more buttons.Philhttps://www.blogger.com/profile/12737842662641035211noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-58239443302562437072009-05-06T10:31:00.000-07:002009-05-06T10:31:00.000-07:00With my interpretation of Phil's solution, I am ha...With my interpretation of Phil's solution, I am having a problem agreeing with his summary statement which is correct except for the stated start condition. If the lock begins in the open D, (all same), state, it will always open again on the second try after entering his first two C,(alternating), patterns. It appears to be the A,(single bit), patterns that about 12% of the time require 8 attempts. I'm continuing to play with this. Even with the answers I find the puzzle interesting. (Even if I am my own worst puzzle.)hughhttps://www.blogger.com/profile/16914509834442545746noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-42930798589934673332009-05-06T01:27:00.000-07:002009-05-06T01:27:00.000-07:00P.P.P.S. And if you are comparing this to Phil's s...P.P.P.S. And if you are comparing this to Phil's solution I labeled my states slightly differently. Essentially A and C are swapped in the two solutions.Blainehttps://www.blogger.com/profile/06379274325110866036noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-75071283791795283962009-05-06T01:25:00.000-07:002009-05-06T01:25:00.000-07:00P.P.S. Oh, and and step 4, there's the possibilit...P.P.S. Oh, and and step 4, there's the possibility you open the lock. I forgot to mention that. But if not, you continue to steps 5 and later.Blainehttps://www.blogger.com/profile/06379274325110866036noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-10984667176892739772009-05-06T01:23:00.000-07:002009-05-06T01:23:00.000-07:00Phil has the intended solution. Just to reiterate,...Phil has the intended solution. Just to reiterate, in case the mathematical notation got hairy for anyone:<br /><br />There are sixteen possible states for the buttons (2 choices for each of 4 buttons = 2 x 2 x 2 x 2 = 16).<br /><br />Of these two are the winning state of all off (0000) or all on (1111).<br /><br />You can divide the remaining states into three groups, based on their similarity, ignoring rotation.<br />State A (every other button pushed):<br />0101, 1010<br /><br />State B (two adjacent buttons are pushed):<br />0011, 0110, 1100, 1001<br /><br />State C: (one button is different from the other three):<br />0001, 0010, 0100, 1000, 0111, 1110, 1101, 1011<br /><br />The winning states are 0000 and 1111. At the outset you are in situation A, B or C though you don't know which. <br /><br />Step 1) Push buttons on *opposite* sides of the dial:<br />If you were in A, the lock opens!<br />If you were in B, you're in B again. <br />If you were in C, then you are still in C<br /><br />Step 2) Push two *adjacent* buttons:<br />If you were in B, the lock opens, or you switch to A. <br />If you were in C, then you are still in C<br /><br />Step 3) Push two *opposite* buttons:<br />If you were in A, the lock opens!<br />If you were in C, then you are still in C<br /><br />If you are not free by this point, you know you are in C. <br /><br />Step 4) Push any *single* button. This will switch you to A or B.<br /><br />Now repeat the above steps.<br /><br />Step 5) Push buttons on *opposite* sides of the dial:<br />If you were in A, the lock opens! <br />If you were in B, you're in B again. <br /><br />Step 6) Push two *adjacent* buttons:<br />If you were in B, the lock opens or you switch to A. <br /><br />Step 7) Push two *opposite* buttons:<br />You had to be in A, the lock opens! <br /><br />So in a maximum of 7 minutes you will have opened the lock.<br /><br />P.S. I suppose there is the possibility you started in an unlocked state of 0000 or 1111 at the beginning. If that is allowed, just add a Step "0" where you don't press anything (or press everything) and see if the lock opens.<br /><br />Answer:<br />Yes, you can guarantee you'll open the lock after 7 tries, if you follow the steps above.Blainehttps://www.blogger.com/profile/06379274325110866036noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-86920125477913956792009-05-05T11:44:00.000-07:002009-05-05T11:44:00.000-07:00I also thank Phil for explaining how what I think ...I also thank Phil for explaining how what I think is termed an "invariance" can be put to practical use. The term was mentioned in passing to me but I never caught on.hughhttps://www.blogger.com/profile/16914509834442545746noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-90159364187775396832009-05-04T23:32:00.000-07:002009-05-04T23:32:00.000-07:00Thank you Phil! I was afraid my spreadsheet might...Thank you Phil! I was afraid my spreadsheet might have had a problem. Runs of 4000 trials on each type of lock opened every time. (Just being fussy.)hughhttps://www.blogger.com/profile/16914509834442545746noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-21702751791644314002009-05-04T23:01:00.000-07:002009-05-04T23:01:00.000-07:00After automating some more, and speeding things up...After automating some more, and speeding things up, I see my eyeball fixes aren't working. Like one of my profs said, "Have theory behind your actions." Turns out that I've been having only a 90% to 93% success rate. Still flubbing around is still better than doing nothing in order to escape. I'll try putting Phil's analysis to work. This is fascinating. I'm close to obsessed.hughhttps://www.blogger.com/profile/16914509834442545746noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-68671821864490425242009-05-04T20:55:00.000-07:002009-05-04T20:55:00.000-07:00Blaine, thanks for the excellent puzzle. I propos...Blaine, thanks for the excellent puzzle. I propose the following solution and proof... and I look forward to having my logic shot-down :)<br /><br /><I>Summary</I>The door can be opened in 8 tries... or only 7 tries if you assume that the lock cannot begin in the "open" position.<br /><br /><I>Notation</I>Describe the internal switches using binary notation (e.g. 1001 means that the first and last switch are on). Binary compliments (e.g. 1001 and 0110) are equivalent, since button pushes toggle the switches (instead of changing them to be absolutely on or off) and because both 0000 and 1111 are solutions. Stated another way, the state of a single switch doesn't matter, only the pattern of the states.<br /><br />Use the same notation to indicate button pushes; an arbitrary scheme could be used to assign each bit to a particular button (like start with the "North" button and continue clockwise, so 1001 represents pushing the North and West buttons); but as will be shown below, the specific bit-to-button mapping scheme is not important. Furthermore, complimentary button pushes are equivalent (e.g. 1001 and 0110 will yield equivalent results on the switches).<br /><br /><I>Classification</I>Ignoring compliments, there are 8 possible patterns of switches and of toggles (0000 0001 0010 0011 0100 0101 0110, and 0111). The patterns can be grouped into the following classifications:<br />A: patterns with one matching bit and three non-matching bits (0001 0010 0100 0111)<br />B: patterns with two adjacent matching bits (0011 0110)<br />C: patterns with alternating bits (0101)<br />D: patterns with all bits the same (0000); this is the combination of switches which opens the door<br /><br /><I>Rotation</I>The rotation of the dial can be seen as "rotating" the bit pattern of the switches. If the switches are labeled 1234, they could stay as 1234 or become 2341, 3412, or 4123. Critically, rotation will never change the classification of a pattern. Hence, an A will remain an A, a B will remain a B, etc. For example, 0001 could rotate one position to become 0010 (an A to an A) or 0011 could rotate two positions to become 1100, which is equivalent to 0011 (a B to a B). This is why the exact mapping of button pushes to the dial is arbitrary.<br /><br /><I>Effects of applying each pattern of button pushes to each pattern of bits</I>Consider applying an "A" button push to a "B" pattern of switches. By considering the possible combinations, it is easy to see that this can only result in an A switch pattern (0001+0011=0010, 0010+0011=0001, 0100+0011=0111, 0111+0011=0100, 0001+0110=0111, 0010+0110=0100, 0100+0110=0010, and 0111+0110=0001). Following this approach, the following table can be constructed (the example is indicated with a *). This really isn't as tedious as it sounds!<br /><br />button push pattern A turns switch pattern:<br />A -> B or C or D, depending on the specific pattern<br />B -> A (*)<br />C -> A<br />D -> A<br /><br />button push pattern B turns switch pattern:<br />A -> A<br />B -> C or D, depending on the specific pattern<br />C -> B<br />D -> B<br /><br />button push pattern C turns switch pattern:<br />A -> A<br />B -> B<br />C -> D<br />D -> C<br /><br />button push pattern D turns switch pattern:<br />A -> A<br />B -> B<br />C -> C<br />D -> D<br /><br /><I>Solution</I>The system could start in either switch pattern A, B, C, or D. The following solution will guarantee that pattern D is reached.<br />1) button pattern C (A->A, B->B, C->D [solved], D->C), leaving A, B, or C switch patterns<br />2) button pattern C (A->A, B->B, C->D [solved]), leaving A or B switch patterns<br />3) button pattern B (A->A, B->C or D [solved]), leaving A or C switch patterns<br />4) button pattern C (A->A, C->D [solved]), leaving only A switch pattern<br />5) button pattern A (A->B or C or D [solved]), leaving B or C switch pattern<br />6) button pattern C (B->B, C->D [solved]), leaving only B switch pattern<br />7) button pattern B (B->C or D [solved]), leaving only C switch pattern<br />8) button pattern C (C->D [solved]), solving the puzzle<br /><br />Note that if starting in a D pattern is not possible, then step 1 can be skipped.<br /><br />As an interesting aside, I believe that a 3-button door would have no guaranteed solution.Philhttps://www.blogger.com/profile/12737842662641035211noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-76240316334234011402009-05-04T13:32:00.000-07:002009-05-04T13:32:00.000-07:00I'm amazed. You still won't get a proof from me, ...I'm amazed. You still won't get a proof from me, but I redid my spreadsheet to automate the rotation, and redid the masks, six of them, taking your hints.<br /><br />So far no lock has failed to open in time, both rotating and static.<br /><br />Once I would have written a program, but now I have fun abusing applications. I am interested in the proof if you don't think its beyond me.hughhttps://www.blogger.com/profile/16914509834442545746noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-23711984962611942572009-05-03T10:05:00.000-07:002009-05-03T10:05:00.000-07:00More testing has proved to me that my approach doe...More testing has proved to me that my approach doesn't guarantee success. Maximum tries went from 13 to 21. I didn't really answer your question anyway. I was operating on the basis that the system would have to unlock a STATIC lock as well as a ROTATING lock. Now I have to try to understand whether you just proved that there is no sure way to open the lock in time, or...?hughhttps://www.blogger.com/profile/16914509834442545746noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-50866938040795386502009-05-03T07:50:00.000-07:002009-05-03T07:50:00.000-07:00Hugh, I think your method can work randomly, but I...Hugh, I think your method can work randomly, but I don't think it will guarantee the lock will open. Let's imagine that buttons 1 and 2 (top and bottom) had different states (one on, one off). On odd turns, let's say the dial always aligned so you were toggling these between 01 and 10 (still locked). For the even turns, let's imagine that you only ever got one of the untouched switches (4 or 8, left or right) to rotate to the place were you were toggling a single button (4,2,1,8 respectively in your example). Then you'd never be affecting the state of switch 1 and 2 separately to unlock the lock, correct?Blainehttps://www.blogger.com/profile/06379274325110866036noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-7952261805718871442009-05-02T13:31:00.000-07:002009-05-02T13:31:00.000-07:00If the lock spins after an incorrect attempt, and ...If the lock spins after an incorrect attempt, and you don't know which buttons you just pushed, how could you ever "guarantee" that you'll unlock it in any number of tries? Every attempt would be equally as much of a complete guess as the last one.patdugghttps://www.blogger.com/profile/02699939367868272276noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-35963488343456085772009-05-02T10:39:00.000-07:002009-05-02T10:39:00.000-07:003,2,3,4,3,1,3,8 is more like it. In binary the 1's...3,2,3,4,3,1,3,8 is more like it. In binary the 1's of each number show the combination of buttons of the STATIC lock to be pushed. The button positions (top, bottom, left, right) are given labels of 1,2,4,8. 3 means push buttons 1 and 2. 2 means push button 2, etc.<br /><br />In programming terms, I am subjecting an unknown 4 bit number (the lock) to eight successive exclusive-or masks (the combination numbers). Success comes with 0000 or 1111.<br /><br />For the ROTATING lock, the labels remain the same as before (ignore the fact that the buttons have changed.) What apparently has changed is that more than 1 application of the 8 masks is required.<br /><br />My solution is not backed by any rigor, simply by limited testing.<br /><br />The fun part of this is that I was involved in the development of keyless hotel locks.hughhttps://www.blogger.com/profile/16914509834442545746noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-86416799212850777962009-05-02T08:41:00.000-07:002009-05-02T08:41:00.000-07:00Can you explain your notation of "32,34,31,38"? I...Can you explain your notation of "32,34,31,38"? I'm not getting how that relates to the buttons.Blainehttps://www.blogger.com/profile/06379274325110866036noreply@blogger.comtag:blogger.com,1999:blog-5730391.post-40089808023887866372009-05-01T18:11:00.000-07:002009-05-01T18:11:00.000-07:00A very interesting puzzle. Thanks.
If the lock di...A very interesting puzzle. Thanks.<br /><br />If the lock didn't spin, it could be unlocked in 7 or less trys, or go from one locked condition to the other in 8 trys. In that case the combination would be something like 32,34,31,38.<br /><br />With the spinning lock, this and simpler combinations applied twice work. The most tries it took me was 13. The fly in the ointment is that how the combination is entered isn't all that obvious, but easily stated.hughhttps://www.blogger.com/profile/16914509834442545746noreply@blogger.com