New Issue: Science’s Impossible Questions. Read Now

How to Solve the Rubik's Cube

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.

Subscribe to Support Independent Journalism

Great science journalism requires human expertise, time, effort and creativity. And it costs money. That’s why I and the journalists here at Scientific American hope you’ll join our community.

When you subscribe, you are supporting staff and freelance journalists who are passionate about telling science stories that are true, important and compelling. Our editors and reporters are often experts in their fields, which means they understand the nuances of big discoveries and can untangle the breakthroughs from the hype. With a subscription, you are also supporting rigorous fact-checking to ensure the words we publish are precise and accurate. And you’re supporting original illustrations, graphics and photos that bring you closer to an advanced laboratory, an ice sheet in Antarctica or a space mission in orbit. You’re helping us craft other types of high-quality journalism as well: Our newsletters are carefully written, edited and curated by staffers you have or will come to know and love. Our Science Quickly podcast is based on original reporting, collaboration with editors and scientists and exacting production.

Subscriptions keep this engine running so we can continue to deliver thoughtful, rigorous and independent science journalism to you. In an era of viral misinformation, this work is crucial. If you value what we do, I hope you’ll consider joining us as a subscriber

Thank you,

Jeanna Bryner, Editor in Chief, Scientific American

Subscribe