# Solution to the Rubik's Cube

Possibly you have seen or even own a Rubik's cube. Hopefully you know the objective is to rotate the sides of the cube to get all the same colored squares on the same side. And you probably are also aware that it is very difficult. There are approximately 42 zillion different states the cube may be in, only one of which is the correct one. Trial and error is not very likely to work here. (Ironically though, many of us seem to try this method anyway. Though you have a better chance at winning the lottery than relying on blind luck here...)

But happily, you don't need to be frustrated any longer. For your convenience (as well as my own) I have posted this solution to Rubik's Cube. At each step, your cube will be in one of a number of states. You simply have to identify the state that applies to your cube at each step, and perform the rotations indicated. If you do so correctly, then the cube will be solved (and you may be revered as a Mathematical Wizard by friends and family).

But before we start, we need some notation. Hold you cube in front of you. The side facing up, we call the U side. The side facing down is the D side. Facing left is the L side, facing right is the R side, the face on the front is the F side, and the face on the back is the B side.

At this point a number of little warnings are justified:

Warning (1): B stands for Back. Not bottom! Do not make this common mistake and think B refers to the side facing down. I can not stress this point enough.
Warning (2): U is U no matter what. The same rule applies to all the sides. If one instruction calls for you to rotate the right side, do not hold the cube so that the right side faces you, rotate it, then decide to rename it the F side. Do not change your orientation of the cube unless the directions specifically ask you to do so!

Now, back to the notation. Using the names for faces, we now have names for all the 26 cubes that make up Rubik's Cube (we don't really count the center of the cube, because we never see it). We name each cubelet (a cubelet is one of the smaller cubes that makes up the big cube) with the letters of the sides it is a part of. For example, the cubelet in the upper right-hand front corner, be will referred to as URF. The cubelet on the left edge (meaning not at either of the corners) that is also on the front side will e referred to as FL. We could also call it LF. It doesn't really matter. You may also want to note that because of the chosen naming system, corner cubelets will have names of three letters while edge (non-corner) cubelets have names of two letters. The center cubelets we don't need to give names to because they are fixed - they cannot be rotated into a different side. They "anchor" their side, in a manner of speaking.

We have names for all the cubelets. Now we need to determine a way to describe how we rotate the faces. What we do is let X (where X represents the name of any side) stand for rotating the X side clockwise 90 degrees. We let X' stand for rotating the X side counterclockwise 90 degrees. And we let X2 stand for rotating the X side 180 degrees.

Warning (3): When we say rotate a face clockwise (or counterclockwise), that means rotate it in the direction that would be clockwise if you were looking straight at it. But don't lose your current orientation!
Warning (4): You may be wondering how we can let one symbol stand for two different things, i.e. "U" means both "the upper face" and "turn the upper face clockwise...". The meaning you should use should be obvious from the context. In general they will refer to moves, and we will explicitly state when we want the single letters to refer to faces.

Also, to make reading the sequences of movements simpler to follow visually, if you see (...)*N, that means do the sequence of moves indicated by "..." a total of N times.
To summarize everything in an example, lets say you have the following sequence of moves:
F R' B2 (L D)*3

You should read this as "rotate the front side clockwise 90 degrees, then rotate the right side counterclockwise 90 degrees, then rotate the back side 180 degrees. Next, rotate the left side clockwise 90 degrees followed by rotating the down side clockwise 90 degrees. Perform this last step a total of three times."

See how having a notation makes everything compact and easy to read?

So without further ado, onto the solution:

## Step 2: Put the U corners in the correct positions with the correct orientation.

After you do this, you need to switch orientation. Turn the cube upside down so that the U face becomes the D face and the D face becomes the U face.

## Step 3: Put the middle layer edges in place.

Change orientation so that the FR position contains an incorrect cubelet. Locate the cubelet that belongs in the FR position.

If it is already in the middle layer (and in the wrong position) then you need to "move it out". Change orientation so that the cubelet you want to move to the top is in the FR position. Then apply sequence "A" and it should be in the top layer. Change orientation such that FR position is where the cubelet needs to go.

You should now be able to apply one of the following sequences:

## A:

If the F side of the piece that belongs in the FR position is facing up, then turn U until the piece that belongs in FR is in the UL position. Then apply
(L U) (U2 F2)*3 (U' L')

## B:

If the F side of the piece that belongs in the FR position is not facing up, then turn U until the piece that belongs in FR is in the BU position. Then apply
(B' U) (R2 U2)*3 (U' B)

Repeat Step 3 as needed until all middle layer pieces are in place.

## Step 4: Orient U edges.

(i.e. make the correct color face upwards.)
An even number of U sides of edges should be up (and if there aren't then someone has been peeling off the stickers on your cube and replacing them somewhere else. Basically, it is not possible at this point for an even number of edges not to be up, provided your cube has not been reassembled.)

Your cube should fall into one of the following cases:

## A:

If the UB and UF edges are incorrectly oriented, then apply
(B L U) (L' U' B')

## B:

If the UB and UL edges are incorrectly oriented, then apply
(B U L) (U' L' B')

## C:

If all 4 edges are wrong, then:
(i) apply step 4a
(ii) change orientation by rotating entire cube 90 degrees in such a way that F becomes L, L becomes B, etc.
(iii) apply step 4a again

## Step 5: Put the U edges in an even permutation.

Turn U until 0, 1, or 4 edges are in the right place.

## A:

If they are all in place, then skip this step.

## B:

If one edge is in place, then turn then whole cube so that this is at the UL position. To cycle the other three:
(i) clockwise, apply
(R2 D') (U2 R' L F2 R L') (D R2)
(ii) counterclockwise, apply
(R2 D') (R' L F2 R L' U2) (D R2)

## C:

If no edges are in place, then turn the whole cube so that you need to exchange UF with UR and UL with UB. Then apply
(R2 D2 B2 D) (L2 F2)*3 (D' B2 D2 R2)

## A:

If they're all correct, skip this step.

## B:

If one corner is placed correctly (meaning it is in the right position; it does not matter if the sides of the cubelet are facing the right way), then you will need to cycle the other three. Turn the cube to move the correctly positioned corner to URF, then:
(i) to cycle corners clockwise, apply
(L') (U R U' R') (L) (R U R' U')
(ii) to cycle corners counterclockwise, apply
(U R U' R') (L') (R U R' U') (L)

## C:

If there are no corners placed correctly, then:
(i) To exchange adjacent corners (ULF and URF will switch positions; ULB and URB will switch positions), apply
(B) (L U L' U')*3 (B')
(ii) To exchange diagonal corners (ULF and URB will switch positions; ULB and URF will switch positions), apply
(R' B2) (F R F' R')*3 (B2 R)

## Step 8: Orient the U corners

First turn the cube (change orientation) so that an incorrectly oriented corner is at the URF position.

## A:

to spin URF clockwise, apply
(D' F D F')*2

## B:

to spin URF counterclockwise, apply
(F D' F' D)*2

Turn the U face to bring the next incorrect corner to the URF position. Repeat step 8A or 8B as needed.

Warning: be sure to rotate the U face only as you repeat this step; don't lose orientation! Also, it will look like you are really messing up your cube at this point. Don't worry about it, just keep fixing those U corners and it all should correct itself in the end.
That's it! Your cube should now be restored to its original order. Enjoy your cube!