Qter Documentation

Rubik's Cube Theory

Before we can explain how to turn a Rubik’s Cube into a computer, we have to explain what a Rubik’s Cube is and the fundamental mathematics behind how it works. First, a Rubik’s Cube is made out of three kinds of pieces: Corners, Edges, and Centers.

You can see that the centers are attached to each other by the core and are only able to rotate in place. This allows us to treat the centers as a fixed reference frame to tell whether or not a sticker is on the correct side. For example, if we have the following scramble,

it may look as if the centers are the only thing unsolved, but in fact we would actually consider everything else to be unsolved. The reason is that all of the stickers are different from the center on the same side as it. Next, people who are beginners at solving Rubik’s Cubes often make the mistake of solving individual stickers instead of whole pieces.

If someone does this, then they haven’t actually made progress towards a solution because the stickers on the pieces move together, which means that all of the pieces on the green face in the example given will have to be reshuffled to bring the rest of the stickers to their correct faces. Instead, it’s better to solve a full “layer” (3x3x1 block), because all of the pieces are in their correct spots and won’t need to be moved for the entire rest of the solve. The takeaway being that in general, we need to think about the cube in terms of pieces rather than in terms of stickers.

Now, we need some way to notate scrambles and solutions on a Rubik’s Cube. We will use the conventional “Singmaster Notation” which is standard in the Rubik’s Cube solving community. First, we will name the six sides of a Rubik’s Cube Up (U), Down (D), Right (R), Left (L), Front (F), and Back (B). Then, we will let the letter representing each face represent a clockwise turn about that face.

To represent double turns or counterclockwise turns, we append a 22 or a '' respectively to the letter representing the face.

Here is a full table of all 18 moves for reference:

It may look like we’re forgetting some moves. After all, there are three layers that you can turn, not just two, and we haven’t given names to turns of the three middle slices. However, we don’t actually need to consider them because “slice” turns can be written in terms of the 18 “face” turns.

Those two cube states are actually the same because if you take the first cube and rotate it so that the green center is in front and the white center is on top again, we would see that it is exactly the same as the second cube. Since we’re using the centers as a reference point, we can consider these two cube states to be exactly the same. Slice turns do have names, but we don’t need to care about them for the purpose of this paper.

Another thing that we will need to name are the pieces of a Rubik’s Cube. To do this, we can simply list the sides that the piece has stickers on. For example, we can talk about the “Up, Front, Right” or UFR corner, or the “Front, Left” — FL — edge.

This system is able to uniquely identify all of the pieces. Finally, a sequence of moves to apply to a Rubik’s Cube is called an algorithm. For example, (L2 D2 L’ U’ L D2 L’ U L’) is an algorithm that speed cubers memorize to help them at the very end of a solution when almost every piece is solved. It performs a three-cycle of the UBL, DBL, and DBR corners: