Appreciating Rubik’s Cube

Rubik’s Cube is a very clever invention with huge numbers of positions of its pieces. This essay describes the mathematics without showing how to solve the puzzle. First let us appreciate the cube. I can solve the puzzle in three to five minutes but that is for another document or video.

The 3 by 3 cube has 6 faces with a pivot tile in the middle of each face. These tiles define the color for each face and rotate but do not change position. You can rotate the whole cube, but the pivots do not change their relationships with each other. The orange face is opposite the red face, the white face is opposite the yellow face, and the green face is opposite the blue face.

When Prince Charles married Lady Diana, I saw a souvenir Rubik’s cube with 6 pictures of them on the faces instead of the usual solid colors. I suppose it can be an extra challenge to solve the cube without leaving Charles’ nose upside down on a pivot tile. At that time, I also saw an Executive-Proof Rubik’s Cube. All the faces were green, making it impossible to scramble the cube.

There are 8 corner cubies. The corners each have 3 faces. The raw number of possible layouts are:

(Any of the 8 could be in a position, and any of the remaining 7 could be in the next position, etc.)

8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 8!    = 40,320 ways the corners can be arranged.

3 x 3 x 3 x 3 x 3 x 3 x 3 x 3 = 3^8 =   6,561 ways the 8 corners can be oriented (rotated).

8! x 3^8 =                   264,539,520 combinations of the corners of the Rubik’s Cube. 

There are 12 edges that each have 2 faces. That makes the following raw combinations:

12! = 479,001,600 ways the edges can be arranged.

2^12 = 4,096 ways the edges can be oriented.

12! x 2^12 = 1,961,990,553,600 combinations for the edges.

The total raw combinations of Rubik’s Cube positions are the corners times the edges:   

 264,539,520 x 1,961,990,553,600 = 519,024,039,293,878,272,000

What I mean by “raw combinations” is you could take apart a Rubik’s Cube and put any cubie anywhere in any orientation. Not all combinations are possible when twisting from a solved Rubik’s Cube. When twisting a cube, you cannot “do one thing”. There are always many cubies on the move, and you cannot leave only one cubie rotated. The minimum number of cubies that can be out of place is two. I see that often when I am about to finish solving the cube.  You could take a solved cube, rotate a face 45 degrees, pop up an edge while spreading the adjacent corner cubies. That will remove one cubie. Rotate that cubie and put it all back together and scramble the cube. Give it to someone to solve and they should fail. Undo that rotation to make the Rubik’s Cube right again.

You can think of the combinations as a tree of nodes, but it is really intersecting cycles of nodes. The simplest cycle is to twist a face 90 degrees 4 times, and you return to the starting point. Repeating a more-complex sequence will also eventually return to the starting point.

Most people can eventually solve one face of the Rubik’s Cube. I like solving the orange face on top. It is amazing how much solving that one face reduces the numerical complexity of the cube. With the top 4 corners solved and the 4 edges solved, the 8! is reduced to 4!, 3^8 becomes 3^4, the 12! is reduced to 8!, and the 2^12 is reduced to 2^8. That is:

4! x 3^4 x 8! x 2^8 = 24 x 81 x 40320 x 256 = 20,065,812,480

That reduces the complexity by a factor of 25,866,086,400. That is amazing! That is better than taking the square root!

When solving the first face of the cube, you do not have to be careful not to disturb already solved cubies. They can be rotated out of the way and moved back into place. I solve the edges first, then the corners. The raw complexity has been reduced, but now you must be careful not to wreck what progress you have made. From now on, we must use sequences of moves to solve some cubies while preserving already positioned cubies.

Next, I solve the bottom red corners by repeating a 7-twist sequence and then the bottom edges with a simple sequence. For the corners, the sequence keeps one corner where it is and does not rotate it. I call that the anchor. The next corner keeps its position, but it rotates. The other two corners swap position and rotate. I use the swapping to get two cubies into their proper locations and the other two swapped, then if one corner is in its proper rotation, I use that as the anchor. Otherwise, I use that sequence twice to get one corner to rotate into the anchor position. Then I apply the sequence to solve the bottom corners.

When we moved to Florida, I put various puzzles in a box and did not solve the Rubik’s Cube for over a year. I had regressed on this bottom corners sequence. When I tried to solve the Rubik’s Cube again, and I watched what I was doing, I got it wrong. I had to do it without watching so many times that I could then peek at the moves and remember them.

Finally, I solve the equator, the middle slice. That is a simple sequence of moves. When all but the 4 edges of the equator are solved, what is the complexity?

It is 4 edges that have 4! possible positions and 2^4 orientations or

24 x 16 = 384 possibilities. A couple of times, when I got to this stage, the cube was already solved, because I had a 1/384 probability of that, just by chance. I call the middle slice the equator, but I rotate the cube to make it the prime meridian.

They say you are never more than 20 moves from solving the Rubik’s Cube.
The question is: “Which 20 moves?”
I take many more than 20 to solve each face. Where do they get the 20 moves? When you make a move, a 90, 180, or 270-degree twist, in one of 9 planes, makes 27 choices. That makes 27^20 combinations.

If that were a tree of choices, it would total: 42,391,158,275,216,203,514,294,433,201.

The Rubik’s Cube has cycles that clip the “game tree” and perhaps reduce the count.

Our computed complexity, 519,024,039,293,878,272,000, is a lot less than 27^20 above.