Rubik's Cube for Dummies III

The solution to Rubik’s cube relies on two main principles.

  1. Break the problem down into simpler subproblems. We chose the one dubbed layer by layer.
  2. To solve each subproblem, recognize the position, then alter the position to bring it one step closer to the solution.

We already outlined a possible implementation of the first, as an useful preface to the Moves section.

Layer by Layer

As we said, the layer by layer approach breaks down the cube into layers. As you look at the cube, having chosen a top side, you can cut the cube into two horizontal slices, which form three layers. These are the layers we will solve in order. Solve the top layer, then solve the middle layer, then solve the bottom layer and you’ve solved the whole cube. With a catch, of course. When you solve the second layer, you have to make sure not to “un-solve” the first layer. And, when you solve the third layer, you must be careful not to “un-solve” the first and second layers. “But how in the world will I do that?”, you may ask. Well, that’s why I’m writing this article, ain’t it?

Recognizing a Position

This step involves concentrating on the cubie that you want to move to complete the next of your solution and ignoring the other cubies. Though simple, it is a very important step, as it avoids overwhelming you with the complexity of the cube. You must ignore the cubies that don’t interest you for your layer. When you solve the top layer, you pretty much concentrate on the cubies that include the color you chose as top side color, and ignore the rest. Similarly, in solving the middle layer, you will focus on cubies that are a part of this layer.

Sometimes, a position must be massaged to correspond to the conditions of the move to be performed next. For example, your move cannot be applied as presented, because you can’t trivially place the cubie in the desired position for your move. The trick here is to find situations that are a mirror of the situation you want to find yourself in, so that you can apply a mirror version of the move. Or, you may be solving the middle layer and the cubie you need to put in place next is already in the middle layer. In this case, you must perform a move that brings the cubie to the bottom layer, before you can actually put it in place.

It will soon become apparent that most moves work on groups of three cubies. They swap three cubies at a time, or rotate in place three cubies at a time. You may be discouraged to find that there exist positions where you have only two cubies that are not in position. But worry not! As in all these cases, you solve the condition by applying your move multiple times, each time changing three cubies. For example, assume that, out of cubies 1, 2, 3 and 4, only cubies 1 and 2 are not in position. Apply your move to cubies 1, 3 and 4 such that cubie 1 is in position. Now, cubies 2, 3 and 4 will be in the wrong position, and as you can see, you’re back to a “group of 3” situation that you just solve trivially using your move.

Altering a Position

That’s why we invented moves. The top layer corresponds to simple moves and, hopefully, you can solve any one side on the cube already. The middle and bottom layers, however, must be solved without disturbing the top layer. Based on this condition, I devised the following move discovery heuristic to learn new moves while keeping things simple. Try moving some cubies from the top layer to one of the other layers, by performing a few rotations, then try to bring the cubies back in place. When you put the cubies back in place, you undo the rotations you used, only you already know that doing so will not cause any changes to the cube. Or, you can try to place them back with slightly different rotations, which has a great chance of changing something in the cube at the end of the move. And, because you’re putting the cubies back in their layer, your top layer remains unaffected by the move.

Top Layer

OK, while I hope my audience has no difficulty with this layer, I have to come up with something for exhaustiveness’ sake.

  1. Choose a side.
  2. Find the center cubie that corresponds to that side.
  3. Start placing edge cubies around the center cubie by performing simple rotations. Do not worry about the other layers.
  4. Start placing corner cubies around the center cubie, while not disturbing the edge cubies already in place. You typically do so by moving a group of three cubies to the lateral side, just in place for the corner cubie to slide in, and then bringing the augmented group back.

When placing the cubies, honor the positions that they will occupy in the final state. That is, guide yourself by the center cubies of the lateral sides to ensure the top layer forms a lateral belt corresponding to the final state of the cube.

Middle Layer

The second layer is only a bit harder, as you must keep the first layer intact. Of course, it is not about keeping the top layer intact with each rotation you perform, after all, it’s clear that there are only a few rotations that leave the first layer intact — rotations of the belt and rotations of the third, bottom layer — and these can’t possibly solve the cube by themselves. No, it’s not about that, it’s about making sure that the layer is intact at the end of each move. Yes, you may upset the top layer in the middle of a move, but by the time your move is complete, the layer must be back in position. This is this principle that forms the basis of our solutions to the second and third layers.

Solving the middle layer involves a smaller arsenal of moves than the other two layers. The reasons are at hand. First of all, the center cubies are already in place, on their final side. There are only edge cubies to worry about. Such cubies can be on the third layer, or on the second layer, but in the wrong position. If a cubie is on the third layer, you must bring it near its correct location, by rotating the bottom side. Then, apply Move 1. If the cubie is on the middle layer, apply Move 1 to replace it with a different cubie. Your cubie will then end up on the bottom layer and you will be able to apply Move 1 as usually.

Bottom Layer

There are four important steps involving the bottom layer. I always do them in this order:

  1. Put the corner cubies in their position (though they may not be rotated correctly yet).
  2. Rotate the corner cubies in place without changing their place. (Now you’re done with the corners.)
  3. Put the edge cubies in place (though they may not yet be rotated correctly).
  4. Rotate the edge cubies, without changing their place. (Now you’re done with the edge cubies.)

To address step 1, use Move 2. Perform step 2 using Move 3. Perform step 3 using Move 4 or Move 5, at your choosing. The last step requires a composition of both Move 4 and Move 5, as they have slightly different effects. Be sure to recognize composite positions, where, for example, a swapping that appears to involve only two cubies is actually a composition of swappings of three cubies. Reread “Recognizing a Position” above.

Rubik’s Cube for Dummies II

OK, dummy! You’re ready to uncover the marvelous secrets of the cube. You know I’ll be talking of moves, which are nothing more than lists of rotations, applied to any of the sides of the cube, rotations which can have a clockwise or a counter-clockwise direction. You already know the meaning of these terms, I just made sure we’re on the same page.

Before we consider the moves, it will help to point out how I came up with these moves. The basic idea of the solution to Rubik’s cube, as you will see in a future article, is to break down the problem into subproblems. One such division is the one I dubbed layer by layer. “Layer by layer” considers the cube as being formed of layers to be solved separately. As you look at the cube, having chosen a top side, you can make two horizontal cuts, forming three layers. These are the layers we will solve in order. Solve the top layer, then solve the middle layer, then solve the bottom layer and you’ve solved the whole cube. With a catch, of course. When you solve the second layer, you have to make sure not to “un-solve” the first layer. And, when you solve the third layer, you must be careful not to “un-solve” the first and second layers.

Here are the moves that I chose as representative in the context of the “layer by layer” approach. These are not the only possible moves, but hopefully a simple enough subset of them.

Move 1: R’ T’ H B’ H’ B T R. Bring the three rightmost cubies of the top side down to the front side, (via a one-time counter-clockwise rotation of the right side), move the middle and bottom cubies to the left side (though I illustrate this by moving the top side in the opposite direction), place the remaining cubie back on the top side (now note that when you rotated the top side, you moved the lone lateral cubie onto the right side, so to bring it back up, you must rotate the hidden side), move the bottom cubie from the left side to the hidden side (by a counter-clockwise rotation of the bottom side), bring the top cubie back on the lateral side, bring the middle and bottom cubies back under the top cubie, onto the front side, (the move actually brings the top and bottom cubies in alignment with the middle cubie) and place the three cubies back on the top layer. Note how, at the end of the operation, the entire top layer is unchanged.

Effect: Moves the bottom center cubie of the left side to the middle layer on the same side, to the left of the center cubie. Also, swaps the colors of the cubie. Affects other cubies on the bottom layer, but this is not an issue at this point. It does not affect any other cubies on the middle layer.

Move 2: R’ B’ R B R F’ R’ F. Move the three rightmost cubies of the top layer to the front side, remove the bottom one (by moving it to the left side), put the remaining two cubies back in place. Next, we concentrate on placing the wandering cubie back in, but not the way you took it out. Move the cubie to the front side, put it back in its final position (this has the effect of moving the other two cubies out of the top side and onto the hidden side, but we’ll fix this soon), move it laterally by rotating the front side, bring its two partners from the hidden side onto the top side, then bring the remaining cubies from the left side to the top side.

Effect: Swaps three of the four corner cubies of the bottom layer. It leaves the bottom right corner cubie of the front side unchanged. The other three cubies are moved as follows. Imagine looking at the bottom side of the cubie, with the front side at the top. The cubie that is left unchanged is now at the top right of the side you’re looking at. The top left cubie moves to the bottom left, the bottom left cubie moves to the bottom right, and the bottom right cubie moves to the top left. The move has other effects, which do not affect the top and middle layers.

Move 3: R’ B’ R B’ R’ B2 R B2. Move the three rightmost cubies of the top side to the front side, move the bottom one to the left side, put the remaining two cubies back in place. Now we alter our position such that we place the wandering cubie back slightly differently. Move the remaining cubie to the hidden side, bring the two rightmost cubies of the top side to the front side, then bring the wandering cubie back under them, and put the three back in place.

Effect: Flips three of the four corner cubies of the bottom layer. Look at the bottom side, with the front side on top. The move flips the top right, bottom right and bottom left cubies, leaving the top left cubie unchanged. The flip is counter-clockwise (in the direction that you would loosen a screw). The move affects other cubies, but it does not affect the top and middle layers, nor does it affect the corners in other ways.

Move 4: L’ R F’ L R’ B2 L’ R F’ L R’. Bring the central vertical belt of the top side to the front side (the first and the second rotation), move the bottom cubie of the belt on the left side, put the remaining belt back on the top side. Now prepare to put the cubie back in position. Move the cubie from the left side to the right side (the 180 degree of the bottom side), bring the belt back on the front side, then move the cubie back under its two siblings, to recreate the belt. Finally, move the belt back on the top side. A word of caution is due. Don’t lose track of which side is your front side. Although the narrative suggests you’re working with the bottom side when you move the bottom cubie of the belt to the top side, you are actually working with the front side now. It is the center cubie of each side that identifies which side you are working with. Just don’t get confused when you try to understand the move.

Effect: Swaps three of the four edge cubies of the bottom side. Looking at the bottom side, with the front side on top, the middle-left cubie moves as center-bottom, the center-bottom cubie moves as middle-right cubie, the middle-right cubie moves as middle-left cubie. In the process, cubie that was middle-left prior to the move and the cubie that was center-bottom prior to the move both become flipped.

Move 5: H2 B’ L R’ H2 L’ R B’ H2. This move is a flavor of Move 4. If we ignore the first two rotations of Move 4, we end up with a swapping of slightly different cubies. The initial 180 degree rotation of the hidden side of this move compensates that situation, and yields a slightly different result as a bonus.

Effect: Swaps the same three out of four edge cubies of the bottom side. It does not, however, flip the cubies in place.

The moves will soon show their power, as we uncover the Solution.

Rubik's Cube for Dummies I

Rubik’s cube is pretty simple, as you already know. So at first glance you may think there is little need, if any, to establish terminology. But before we start talking about the cube, we must decide on a common vocabulary, so that we can convey the information as intended. Terminology is important. And since I’m the one conveying the information in this series of articles, I’ll have to settle on terminology by myself. Here is what you need to know, in five easy paragraphs.

The cube is formed of smaller cubies. There exist only center, corner and edge cubies. A cube has 6 sides. Cubies can be swapped with each other, or flipped in place.

The cube sides are named T (top), L (left), F (front), R (right), B (bottom) and H (hidden). Whenever you turn the cube in your hands, the side you’re looking at is the front side, and so on. This means that any side can become the “top” side at any time.

A side rotation is just that – a rotation of the side. You can rotate a side clockwise or conter-clockwise. Also, you can rotate a side once, twice, or three times. If you rotate it more than three times, it’s just as if you had rotated it once, or twice, or three times, because four rotations bring the side back to its initial position. In other words, I might refer to a side rotation by saying “perform this rotation once, twice, or three times, and do it clockwise or counter-clockwise”.

I will set up a compact notation to talk about rotations. To rotate a side, I require the following information: the side to move, the direction of the rotation (clockwise or counter-clockwise) and the number of times I rotate. To represent the side under consideration, I will use its letter code. When referring to the direction of the rotation, I will append an apostrophe if the rotation is counter-clockwise. When referring to the number of times that the side rotates, I will append this number to the notation. Only if the number of rotations is not 1, will I append it. Here are a few examples:

  • F3 – rotate the front side three times, clockwise.
  • T’2 – rotate the top side twice, counter-clockwise.
  • R – rotate the right side once, clockwise.

Finally, I introduce moves, which are just a collection of rotations. A move really is an indication to “apply the specified rotations in the given order”. F R F’ H3 is an example move, and it means “rotate the front side once clockwise, then rotate the right side once clockwise, then rotate the front side once counter-clockwise, then rotate the hidden (back) side three times clockwise”. Although each individual rotation can consider different top, front, bottom, left, right, hidden sides, a move always applies its rotations with the same top, front, bottom, left, right and hidden sides. Imagine what would happen if it were not for this restrictions… a move could then represent many different combinations, which makes no sense.

That’s it. Armed with terminology, we can start to refer to the cube and eventually solve it. Read on.