Friday, June 15, 2007

Solving Rubik's Cube

I solved Rubik's cube in 2 weeks. My solution is an original solution, that is I figured it out myself without help. I know that there are websites which give you move solutions, as well as cubes are sold with instructions. I purposely stayed away from these so I could unlock the secrets myself.

I got the cube two weeks ago at the google developer day. I had often played with one in the past, in fact ever since they came out back in the 70's. But I had never tried very hard to find a solution because I didnt have the patience to do any work. Over the years I found people here and there who had solved it and wondered what insights they had to crack such a confusing puzzle. I decided that I would figure it out this time, and on my own.

First I solved one side. Everyone ends up being able to do this in some way, often without realizing the rotations needed to get there. Then I tried to solve the second row. This was difficult and I failed. Then I decided that I needed to review the moves needed to solve first side and start learning how the cubes moved. My hypothesis was that there were patterns which could be learned and used later for the second row.

In particular, I studied movement of just one corner piece and how to move it into the correct position. There is a set of moves to construct the row on the side (this moves a couple blocks out of position on the side), then preserve the row, then fix the blocks that were out of place, then rotate the preserved row back into place. I called this "on world" construction.

I was curious if there were other ways to solve the corner movement problem, and found that the row could be built "off world" or built on a different face, then rotated into the correct position. It turned out that inverting this move, then using the "on world" move to put the block back into place, would allow me to preserve the side, but the cubes on the second and third levels would move around. Breakthrough! Playing around with this, I found another degree of freedom, in that rotation of the bottom row between the "off world inversion" "on world" sequence would change the movement of cubes on the third level. Then I noticed that when executing "on world inversion" "off world", the second row also was preserved! This lead to the theory that the third row could be solved by making these "on/off" world moves. I practiced these moves for a while to get comfortable.

I then set out to solve the second row. This took a couple hours, but found a sequence by accident which preserved the first side, and allowed me to rotate the 4 second level cubes into place. Just lucky, but a breakthrough. I practiced this while trying to figure out how to attack the third row.

There are 8 cubes on the third row and they all moved positions and rotated when doing the on/off world sets of moves. I finally broke down and started writing down how the cubes moved after a specific set of moves. Once I came up with the notation for two basic "on/off world" moves (A and B), I did a lot of work on paper to study their combinations, including different ordering and rotation between moves. Some patterns started to emerge, such as swapping the locations of opposite side cubes, movement of 3 corner cubes. I played with two level moves with rotations, then some 4 level moves with rotations. Unfortunately the notation I was using was confusing when trying to combine moves, so many mistakes had to be corrected. I checked my paper work by manipulating the cube. I also practiced moving the cubes and tried recognizing the cube configuration to determine what pattern I should employ.

The movements of the cubes typically involved cycling 3 corners through 3 positions, then cycling 3 sides through 3 positions. Each side/corner cube would rotate. This was getting to be a lot to track. How could I quickly recognize what pattern could be used? I realized that the kids on youtube who solve Rubiks cube in < 3 minutes must be recognizing simpler patterns to solve things more quickly. Using my method, trying to recognize a pattern and trying a couple of A/B moves could take 20 minutes. I decided that I needed to do more paperwork and find simpler moves. If there were a set of moves which would change only one or two cubes at a time then the cube could be solved systematically.

At this point I started to use the computer to record my work. My notation had become too error prone, diagrams of 9 cubes and arrows showing movement. I decided to number the corners 1-4, and the sides 1-4, then laid them out on a spreadsheet. The position transformations were easy to show in excel, and combinations amounted to copying at row. I decided that I would not record rotations of the individual cubes yet. But I did figure out that rotations of the entire cube between transformations could be easily done by shifting the starting column of the transformation. The last breakthrough happened here.

I found that an A+A(counterclockwise) move would preserve the positions of all the cubes in the third row, but would apply a ccw rotation to 3 corners and flip 2 side cubes. I thought that if I moved the cubes into position, perhaps I could use this move to turn them around and around and solve the puzzle. This turned out to work!

Since yesterday, I've solved the cube 4 or 5 times. It takes about 30 min at this point, but I'm getting faster. I've decided that I need to finish the notation in excel, and perhaps I can find other moves which will simplify the number of moves needed. I'd also like to code up the solution and post it, perhaps as a google gadget. In any case, I can finally say that I've found a solution on my own!

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home