How to Solve the Rubik's Cube

Join Our Community of Science Lovers!

This story is a supplement to the feature "Rubik's Cube Inspired Puzzles Demonstrate Math's "Simple Groups"" which was printed in the July 2008 issue of Scientific American.

Solving the authors’ new puzzles builds on techniques developed for the study of mathematical entities called groups. One essential technique from group theory is specifying a simple, unambiguous system for writing down the elements of the group and how they combine.

Writing It Down


On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


Rubik’s Cube represents a group whose elements are the moves—the twists you can make of each face of the cube—and whose combination rule might be called the “and then” operation: “make one twist and then make another.” The mechanism depicted in the illustration at the right shows that no matter how the cube is scrambled, the small pieces, or cubies, at the center of each face do not move (except to rotate about their centers). So any move for solving the cube can be represented by the first letter of the color of the center cubie—Blue, Green, Orange, Red, Yellow or White—plus some way of stating how much of a twist the move involves. By itself, each letter indicates that the corresponding face is to be turned 90 degrees clockwise—looking “down” on the face from outside the cube (moves Y and B in the diagram below). A superscript indicates other kinds of turns. B2 turns the blue face 180 degrees; Y–1 turns the yellow face 90 degrees counterclockwise (below). The orientation of the cube can be specified by the colors of the three visible center cubies in clockwise order, beginning with the top center cubie; in all the images below, for instance, the orientation is OYB.

Hint: Order Counts The sequence of moves is critical to solving the cube, so the notation must capture the differences. The composite moves YB and BY do not take a given starting arrangement of the cubies to the same final configuration.

Solving the Cube Classic permutation puzzles such as Rubik’s Cube, whose object is to rearrange the pieces into some target configuration, can usually be solved by following a two-step strategy.

Step 1:
By trial and error, select a short, random sequence of moves, such as YBY–1B–1.

Repeat the random sequence several times. Often that will lead to an arrangement in which only a few cubies have been moved—a helpful tool in solving the cube. Here three repetitions, or (YBY–1B–1)3, switch two pairs of corner cubies: the pair bordering the blue and orange faces (cubies labeled P and Q at the below) and the pair bordering the yellow and red faces.

Step Two:
Modify and generalize the useful move you found. For example, to interchange the pair of corner cubies bordering the red and white faces (cubies labeled E and F on a “virgin” cube shown below, for clarity, in orientation GWR), look for a move that “sets up” your “useful move.” Applying the short setup sequence W2O–1 moves corner cubies E and F into positions P and Q (for clarity, the cube faces are reoriented from GWR to OYB). You can now apply the useful move (YBY–1B–1)3, undo the setup sequence by making the opposite moves in reverse order, OW–2, and restore the initial orientation of the cube faces, GWR. The net effect is to interchange the two corner cubies E and F (below).

A similar setup sequence can be found for moving any pair of corner cubies to one of the two pairs interchanged by (YBY–1B–1)3. You can thus construct a custom move for inter­changing any pair of corner cubies. Proceeding in the same way with other random sequences gives enough flexibility to solve the cube and any other classic permutation puzzle.

It’s Time to Stand Up for Science

If you enjoyed this article, I’d like to ask for your support. Scientific American has served as an advocate for science and industry for 180 years, and right now may be the most critical moment in that two-century history.

I’ve been a Scientific American subscriber since I was 12 years old, and it helped shape the way I look at the world. SciAm always educates and delights me, and inspires a sense of awe for our vast, beautiful universe. I hope it does that for you, too.

If you subscribe to Scientific American, you help ensure that our coverage is centered on meaningful research and discovery; that we have the resources to report on the decisions that threaten labs across the U.S.; and that we support both budding and working scientists at a time when the value of science itself too often goes unrecognized.

In return, you get essential news, captivating podcasts, brilliant infographics, can't-miss newsletters, must-watch videos, challenging games, and the science world's best writing and reporting. You can even gift someone a subscription.

There has never been a more important time for us to stand up and show why science matters. I hope you’ll support us in that mission.

Thank you,

David M. Ewalt, Editor in Chief, Scientific American

Subscribe