The Rubik's Cube Group

The moves of a Rubik's cube form a nonabelian group generated by six quarter turns, modeled here as permutations of the 48 movable stickers. Why move sequences are read left to right, which face turns commute, the orders of moves such as RU (105) and R U R' U' (6) read from how they cycle and twist the pieces, the largest order 1260, the three invariants (equal corner and edge parity, total twist, total flip) and the count of 43,252,003,274,489,856,000 positions, confirmed by the Schreier-Sims algorithm; subgroups, commutators and conjugates as solving tools, the superflip, and the proof that every position can be solved in 20 face turns.

A Rubik's cube in any position can be returned to its solved state, and a solved cube can be scrambled into any of a very large number of positions. Several facts about it are familiar to anyone who has taken one apart.

  • A cube reassembled at random usually cannot be solved.
  • A single corner piece twisted in place makes it unsolvable, and so does a single edge piece flipped over, or two edge pieces swapped.
  • Repeating any fixed sequence of turns long enough always brings the cube back to where it started, sometimes only after more than a thousand repetitions.

Why should a twisted corner be beyond repair, when every corner can be moved anywhere? And why must some sequences be repeated so many times?

Each of these facts is a theorem about a group. The elements are the moves of the cube, two moves count as equal when they have the same effect, and the operation is doing one move after another. This group is generated by six quarter turns, it is far from abelian, and it has exactly 43,252,003,274,489,856,000 elements.

First we build the group as a group of permutations of the cube's stickers, and see which turns commute. Then we compute the orders of some moves from how they cycle the pieces. Next we prove the three conditions a reachable position must satisfy, and use them, with a computer check, to count the positions. Finally we look at subgroups, at the commutators and conjugates that solvers use, and at the proof that 20 turns always suffice.

This is the third article of Groups. It assumes the definition of a group and of the order of an element (Groups: Definition and First Examples), and uses Dihedral Groups for comparison. The cube is not in the course text; the class sessions used it as a running example of a nonabelian group alongside the dihedral groups. A standard mathematical account is Joyner's (1997, Chapter 10; published in expanded form as Adventures in Group Theory). The record of the search for the shortest solutions is Rokicki, Kociemba, Davidson and Dethridge (2013). Every number below is computed by the script for this article, which models the cube from scratch.

Pieces, stickers and moves

The cube is built from 26 visible pieces, called cubies.

  • The 6 center cubies, one in the middle of each face, have one sticker each and only turn in place. They fix the color of each face, and the cube is always held with the same centers up, front and so on.
  • The 8 corner cubies have three stickers each.
  • The 12 edge cubies have two.

That makes $8 \cdot 3 + 12 \cdot 2 = 48$ movable stickers, called facets, in 48 positions on the surface.

The faces are named Up, Down, Left, Right, Front and Back. In the standard notation, introduced by David Singmaster (Joyner, 1997, §4.5), the letters $U$, $D$, $L$, $R$, $F$, $B$ also denote the quarter turns. $U$ turns the up face 90 degrees clockwise as seen when looking at that face from outside the cube, and similarly for the others. A cubie is named by the faces it touches: the corner $UFR$ sits where the up, front and right faces meet.

Moves as permutations. A face turn carries the facet in each of the 48 positions to some position, possibly the same one, and different facets to different positions. So it is a permutation of the 48 facet positions. A move is any sequence of face turns, and it too acts as a permutation of the facet positions. Two sequences are regarded as the same move when they produce the same permutation. On a real cube this is the same as producing the same pattern from the solved cube, because every facet can be identified by its colors. The cubies have different sets of colors, and each facet is the one of its cubie's colors that it shows. Looking at the cube therefore tells exactly where every facet went.

Each quarter turn moves 20 facets in five cycles of length 4. Three are cycles of corner facets (the 4 corners of the turning layer have 12 facets) and two of edge facets (the 4 edges have 8). The first panel of the figure below shows them for $U$.

The cube unfolded into a net (Up above Front, Down below, Left, Right and Back in a row), with the facets moved by a move colored by the cycle they belong to and labeled with the cycle's length. Top: the quarter turn U moves 20 facets in five 4-cycles, three of corner facets and two of edge facets. Bottom: notice that R U R' U' moves only 18 facets, in two 6-cycles of corner facets and two 3-cycles of edge facets; the other 30 facets return to where they started.
The cube unfolded into a net (Up above Front, Down below, Left, Right and Back in a row), with the facets moved by a move colored by the cycle they belong to and labeled with the cycle's length. Top: the quarter turn U moves 20 facets in five 4-cycles, three of corner facets and two of edge facets. Bottom: notice that R U R' U' moves only 18 facets, in two 6-cycles of corner facets and two 3-cycles of edge facets; the other 30 facets return to where they started.

The group. Let $G$ be the set of all permutations of the 48 facet positions produced by sequences of face turns, with "do one move, then the other" as the operation. It is a group, and each axiom has a plain meaning on the cube.

  • Closure: doing one sequence of face turns and then another is a sequence of face turns.
  • Associativity: composition of permutations is associative.
  • Identity: the empty sequence, which leaves every facet in place, written $1$.
  • Inverses: a quarter turn $X$ has order 4, since four quarter turns of a face restore it, so $X^{-1} = X^3$ is again a sequence of face turns. The inverse of a sequence $X_1 X_2 \cdots X_k$ is $X_k^{-1} \cdots X_2^{-1} X_1^{-1}$: undo the last turn first. This is the rule $(ab)^{-1} = b^{-1}a^{-1}$, proved for every group in Basic Properties of Groups.

The inverse quarter turn $X^{-1}$ is written $X'$ and turns the face counterclockwise; the half turn $X^2$ is written $X2$. The group is said to be generated by $U, D, L, R, F, B$, since every element is a product of these and their inverses. Generators are discussed further in Subgroups and Cyclic Groups.

Reading left to right. Cube notation is read in the order the turns are made: $RU$ means "turn $R$, then turn $U$". So in this article the product $MN$ of two moves means $M$ first, then $N$. This is the opposite of the convention for composing functions, where $f \circ g$ applies $g$ first. This unit uses the function convention for Dihedral Groups and Symmetric Groups and Permutations. If $m$ and $n$ denote the permutations of facet positions produced by $M$ and $N$, then $MN$ produces $n \circ m$. The choice does not affect whether the axioms hold, since associativity, the identity and inverses do not depend on which factor is written first. It keeps the article consistent with every book and website about the cube.

Check your understanding. In cube notation, what is the inverse of the move $RU$? A common first answer is $R' U'$.

It is $U' R'$. The move $RU$ turns $R$ and then $U$, so undoing it must undo the $U$ turn first. The answer $R' U'$ undoes the turns in the order they were made, which is a different move; the script confirms that $U' R'$ restores the cube and $R' U'$ does not.

A model of the cube. The script for this article builds the cube from coordinates rather than from a hand-drawn diagram. Each cubie sits at a point with coordinates in $\{-1, 0, 1\}$, with $x$ pointing right, $y$ up and $z$ toward the viewer. Each facet is a pair (cubie position, outward direction). A quarter turn of the face whose outward direction is $a$ rotates every facet of that layer through $-90$ degrees about $a$, which is clockwise as seen from outside. This produces the six generators as permutations of 48 numbered facets, and every claim below is checked by computing with them.

Not abelian, but partly

With the group defined, the first question about it is whether the order of the turns matters. Turning the front and then the right face is not the same as turning them in the other order: $FR \neq RF$. The model shows how they differ. The up-facing sticker of the $UFR$ corner ends on the right face under $FR$, but on the back face under $RF$. Altogether 18 of the 48 facets end in different places. So $G$ is nonabelian.

Some pairs of moves do commute. Turns of opposite faces, such as $U$ and $D$, move disjoint sets of facets. Moves that touch disjoint sets of facets commute, just as disjoint cycles commute. The script finds that the only commuting pairs of distinct face turns are the three pairs of opposite faces, $\{U, D\}$, $\{F, B\}$ and $\{R, L\}$. Every two adjacent faces share a row of cubies, and their turns do not commute.

Check your understanding. Does $U$ commute with the half turn $D2$? With the half turn $R2$?

$U$ commutes with $D2$, because $D2$ moves only facets of the down layer, which $U$ never touches. It does not commute with $R2$: the two layers share the cubies $UFR$, $UR$ and $UBR$, and the script confirms that the two orders differ.

Orders of moves

The opening claimed that repeating a move always returns the cube to its start, sometimes only after a thousand repetitions. How many repetitions does a given move need? The order of a move $M$ is the least positive $k$ with $M^k = 1$ (Groups: Definition and First Examples). Every move has finite order, because $G$ is a finite group of permutations. The general fact that every element of a finite group has finite order is proved in Basic Properties of Groups. A quarter turn has order 4 and a half turn order 2. Products of turns can have much larger orders, and their orders can be read from what they do to the cubies.

How to read an order. Here is the idea in one sentence. The cubies run on separate clocks, one for each cycle, and the move's order is the first time all the clocks agree. A move permutes the corner cubies among the corner positions and the edge cubies among the edge positions, and it may also turn a cubie as it moves it.

  • Corners. Follow the corner cubies in one cycle of length $L$. After $L$ repetitions of the move, each of them is back in its own position, turned by the same total amount. That amount is the net twist of the cycle, 0, 1 or 2 thirds of a full turn. If the net twist is 0, the facets of these corners return after $L$ repetitions. Otherwise they need $3L$, since three trips around the cycle add up the twist to a whole turn.
  • Edges. Edge cubies behave in the same way with flips. A cycle of length $L$ needs $L$ repetitions if its net flip is 0 and $2L$ if the edges come back flipped.

The order of the move is the least common multiple of these numbers over all its cycles, by the rule for the order of a product of disjoint cycles (Symmetric Groups and Permutations). The script compares this rule with the order of the facet permutation for 200 random moves and finds agreement in every case.

The move $RU$. It moves five corners in a cycle ($UBL$, $UFL$, $DBR$, $DFR$, $UBR$ in some order) that returns twisted, so their 15 facets form one cycle of length 15. It twists the corner $UFR$ in place, a facet cycle of length 3. It moves seven edges in a cycle that returns unflipped, giving two facet cycles of length 7. Altogether 32 facets move, and

$$\lvert RU \rvert = \operatorname{lcm}(15, 3, 7) = 105.$$

The powers of $RU$ show the separate clocks running at once:

Power Corners home Corners home and untwisted Edges home
$(RU)^5$ 8 2 5
$(RU)^7$ 3 2 12
$(RU)^{15}$ 8 8 5
$(RU)^{35}$ 8 2 12
$(RU)^{105}$ 8 8 12

After 35 repetitions every cubie is back in its place, but six corners are twisted; only at the 105th does the cube return to its starting state. The move $FR$ has the same order, 105, and so does $RF$. In fact $RF$ is a relabelled version of $FR$: $F'(FR)F = RF$. Elements related in this way, called conjugates, always have the same order (the reason is given below).

The move $R U R' U'$. This sequence, popular with speedcubers, moves only 7 cubies and 18 facets. It exchanges two pairs of corners, and both pairs come back twisted. It moves three edges in a cycle that comes back unflipped.

Check your understanding. From that description alone, how many repetitions of $R U R' U'$ put every edge back in its own position, and how many put every corner back in its own position, ignoring twists?

Three for the edges, which travel around a 3-cycle, and two for the corners, since a second exchange swaps each pair back. Neither number is the order of the move, because after two repetitions the corners are home but twisted. Each twisted pair of corners needs $3 \cdot 2 = 6$ repetitions, so its six facets form a cycle of length 6. The three edges need 3, giving two facet cycles of length 3 (the second panel of the figure). So the order is $\operatorname{lcm}(6, 3) = 6$. Its square leaves every corner in place, four of them twisted, and moves three edges. Its cube restores every edge and leaves the two pairs of corners exchanged. Its inverse is $(R U R' U')^{-1} = U R U' R'$, by reversing the sequence and inverting each turn, and it has the same order 6.

The largest order. The move $R U2 D' B D'$ has order 1260.

  • On the corners it has a cycle of length 5 and a cycle of length 3, both twisted, which need 15 and 9 repetitions. So the corners need $\operatorname{lcm}(15, 9) = 45$.
  • On the edges it has a flipped cycle of length 7 (14 repetitions), a flipped cycle of length 2 (4 repetitions) and an unflipped cycle of length 2 (2 repetitions). So the edges need 28.

Then $\operatorname{lcm}(45, 28) = 1260$. Singmaster stated that 1260 is the largest order of any element of the cube group (Joyner, 1997, Chapter 5). The script confirms it. It runs through every way of splitting the 8 corners and the 12 edges into cycles, with every choice of which cycles are twisted or flipped. It keeps those allowed by the three conditions proved below, and finds that the largest least common multiple is 1260.

Those three conditions are the next question. Twisting and flipping clearly matter to orders; which twists and flips can a move actually produce?

The three invariants

A position of the cube is described by four pieces of data:

  • the corner permutation $\sigma$, a permutation of the 8 corner positions, telling which corner cubie sits where;
  • the edge permutation $\tau$, a permutation of the 12 edge positions;
  • the twist of each corner cubie, a number in $\mathbb{Z}_3$;
  • the flip of each edge cubie, a number in $\mathbb{Z}_2$.

To define twists and flips, give each position a reference facet.

  • For a corner position, it is the facet on the up or down face.
  • For an edge position, it is the facet on the up or down face if it has one, and otherwise (for the four edges of the middle layer) the facet on the front or back face.

Every cubie likewise has a reference sticker, the one that sits on the reference facet of its home position when the cube is solved. The twist of a corner cubie is the number of clockwise thirds of a turn (as seen from outside the corner) from the reference facet of its current position to the facet carrying its reference sticker. The flip of an edge cubie is 0 if its reference sticker is on the reference facet of its current position and 1 otherwise. In the solved cube every twist and every flip is 0.

The twists of the eight corners form an element of the direct product $\mathbb{Z}_3^8 = \mathbb{Z}_3 \times \cdots \times \mathbb{Z}_3$, and the flips an element of $\mathbb{Z}_2^{12}$ (direct products). If the cube is taken apart and reassembled, every corner can go to any corner position in any of 3 orientations, and every edge to any edge position in either of 2. So there are

$$8! \cdot 3^8 \cdot 12! \cdot 2^{12} = 519{,}024{,}039{,}293{,}878{,}272{,}000$$

possible assemblies. Each is determined by its data $(\sigma, \text{twists}, \tau, \text{flips})$, and each determines where every facet is. Which of them can be reached by turning the faces?

Theorem. A position of the cube can be reached from the solved cube by face turns if and only if

  1. $\sigma$ and $\tau$ have the same parity (both even or both odd);
  2. the twists of the corners add up to 0 in $\mathbb{Z}_3$;
  3. the flips of the edges add up to 0 in $\mathbb{Z}_2$.

This is the "second fundamental theorem of cube theory" in Joyner's notes (1997, Theorem 202), where it is credited to Ann Scott. Even and odd permutations are defined in Symmetric Groups and Permutations. A permutation is even or odd according as it is a product of an even or an odd number of transpositions, and the sign of a product is the product of the signs.

Here is the plan of the proof. The three conditions are invariants: quantities that no face turn can change. Necessity is proved by checking each of the six turns against each condition. Sufficiency is harder, and is settled by a count together with a computer calculation of $\lvert G \rvert$.

Proof that the conditions are necessary. The solved cube satisfies all three conditions, and every reachable position is reached by a sequence of face turns. So it suffices to show that each face turn preserves all three.

(1) A quarter turn $X$ moves the four corner cubies of its layer in a 4-cycle of corner positions and the four edge cubies in a 4-cycle of edge positions. A 4-cycle is odd. So $X$ changes the parity of the corner permutation and of the edge permutation together: if they were equal before the turn, they are equal after it.

(2) Consider a corner cubie in position $p$ and a quarter turn $X$ that moves it. The turn rigidly rotates the cubie into its new position $X(p)$, and rotations preserve the cyclic order of the three facets around a corner. So the cubie's twist increases by an amount $t_X(p)$ that depends only on $X$ and $p$. It is the number of clockwise thirds from the reference facet of $X(p)$ to the facet that the turn carries the reference facet of $p$ onto. Computing these amounts from the model gives:

Turn Increases of twist for the 4 corners moved Total
$U$, $D$ 0, 0, 0, 0 0
$F$, $B$, $R$, $L$ 1, 1, 2, 2 6

A turn of the up or down face keeps every reference sticker in the up or down face, so it twists nothing. A turn of a side face changes the sum of the twists by 6, which is 0 in $\mathbb{Z}_3$. So the total twist stays 0.

(3) In the same way, a turn changes the flip of each edge it moves by an amount depending only on the turn and the position. The quarter turns $U$, $D$, $R$ and $L$ flip no edges with the chosen reference facets. $F$ and $B$ flip all four edges they move, changing the total flip by 4, which is 0 in $\mathbb{Z}_2$. $\blacksquare$

The script checks the lemma behind (2) and (3), that orientations add in this way, on 300 random positions, and checks the three conditions on each.

Check your understanding. The move of order 1260 had two twisted corner cycles. Could some move have exactly one twisted corner cycle, with every other corner returning untwisted?

No. Starting from the solved cube, the net twist of a cycle is the sum of the twists that one application of the move gives the corners in it. So the net twists of all the cycles add up to the total twist of the position the move produces, which is 0 by condition 2. One nonzero net twist with all the others 0 would add up to 1 or 2. Twisted corner cycles come at least in pairs, and for the same reason flipped edge cycles come in even numbers. The script's search for the largest order uses exactly these restrictions.

Proof that the conditions are sufficient. This half is not proved by hand here. Joyner (1997, §10.2) outlines a constructive proof.

  • He gives explicit sequences of turns that twist exactly two corners or flip exactly two edges.
  • He states that moves cycling any three corners or any three edges also exist, leaving their verification and one further step as exercises.
  • He argues that these moves and their conjugates reach every position satisfying the conditions.

This article instead counts, and lets a computer supply the one number the count needs. Exactly one assembly in two satisfies condition 1, one in three satisfies condition 2 and one in two satisfies condition 3. The three conditions concern independent parts of the data, so the number of assemblies satisfying all three is

$$\frac{8! \cdot 3^8 \cdot 12! \cdot 2^{12}}{2 \cdot 3 \cdot 2} = 43{,}252{,}003{,}274{,}489{,}856{,}000.$$

The necessity proof shows that every element of $G$ gives one of these assemblies. Different elements of $G$ give different assemblies, since an assembly determines where every facet goes. So $\lvert G \rvert$ is at most this number, with equality exactly when every such assembly is reachable. A computer calculation of $\lvert G \rvert$ from the six generators, described next, gives exactly this number, which completes the proof. It is a computer-assisted proof, resting on that calculation. $\blacksquare$

The order of the group

Corollary. The Rubik's cube group has order

$$\lvert G \rvert = 8! \cdot 3^7 \cdot 12! \cdot 2^{10} = 43{,}252{,}003{,}274{,}489{,}856{,}000 = 2^{27} \cdot 3^{14} \cdot 5^3 \cdot 7^2 \cdot 11.$$

Each factor has a meaning:

  • $8!$ arrangements of the corners;
  • $3^7$ twists, since the eighth corner's twist is forced by the other seven;
  • $12!/2$ arrangements of the edges, since the parity is forced by the corners;
  • $2^{11}$ flips, since the twelfth is forced.

The total is about $4.3 \times 10^{19}$, the figure given by Rokicki and coauthors (2013). A reassembled cube is solvable with probability exactly $1/12$, the fraction of assemblies that satisfy the three conditions. This is why a cube that has been taken apart and put back together at random usually cannot be solved.

Check your understanding. Suppose only the eight corners are taken out and put back at random, and the edges are left in their solved places. What is the chance that the cube can still be solved?

One in six. With the edges solved, $\tau$ is the identity, which is even, so $\sigma$ must be even: one chance in two. The twists must add to 0: one chance in three. Flips are already 0. The script counts $8! \cdot 3^8 = 264{,}539{,}520$ corner assemblies, of which $44{,}089{,}920$ are solvable, exactly one in six.

How can a computer find $\lvert G \rvert$ when the group is far too large to list? It can be computed from the six generators by the Schreier-Sims algorithm, which the script implements. The idea is a chain of questions. To how many positions can the facet in position 0 be carried? Of the moves that leave that facet in place, to how many positions can a second chosen facet be carried? And so on, until only the identity is left. The answers multiply to $\lvert G \rvert$. For the cube the algorithm finds the sequence

$$24, 21, 18, 15, 12, 24, 22, 9, 20, 6, 18, 16, 14, 12, 10, 8, 6, 2,$$

whose product is 43,252,003,274,489,856,000, in agreement with the count. That the product of these orbit sizes is the order of the group is an instance of the orbit-stabilizer relation, a consequence of Lagrange's theorem.

The theorem answers the opening question. A twisted corner can be moved anywhere, but the sum of the twists cannot change.

  • A single twisted corner violates condition 2.
  • A single flipped edge violates condition 3.
  • Two swapped edges with everything else solved violate condition 1, an odd edge permutation with an even corner permutation.

None of these can be undone by turning the faces.

Subgroups

What if only some of the turns are allowed? Restricting the generators gives smaller groups inside $G$, examples of the subgroups studied in Subgroups and Cyclic Groups. The script computes their orders by the same algorithm.

Generated by Order
$U$ 4
$U$ and $D$ 16
$U2$, $D2$, $F2$, $B2$, $R2$, $L2$ (half turns only) 663,552
$R$ and $U$ 73,483,200
$U$, $D$, $R2$, $L2$, $F2$, $B2$ 19,508,428,800
all six quarter turns 43,252,003,274,489,856,000

The group generated by $U$ and $D$ has order $4 \cdot 4 = 16$. The two turns commute and move disjoint facets, so the moves $U^a D^b$ with $0 \le a, b \le 3$ are all different. The last subgroup before $G$ is the one used by Rokicki and coauthors (2013, §4). Its moves never twist a corner or flip an edge, and its order is $8! \cdot 8! \cdot 4!/2$. $G$ splits into $2{,}217{,}093{,}120$ copies of it, called cosets, which served as the units of their search. Every order in the table divides $\lvert G \rvert$, as Lagrange's theorem requires of the order of any subgroup of a finite group.

Check your understanding. Predict the order of the subgroup generated by $U$ and the half turn $D2$.

It is $4 \cdot 2 = 8$. The two moves commute and touch disjoint facets, so the moves $U^a (D2)^b$ with $0 \le a \le 3$ and $0 \le b \le 1$ are all different, and every product of $U$ and $D2$ has this form. The script's Schreier-Sims computation gives 8.

Commutators and conjugates

How do solvers fix a few pieces without disturbing the rest? They use two group-theoretic constructions constantly.

A commutator is a move of the form $M N M^{-1} N^{-1}$, such as $R U R' U'$. If $M$ and $N$ commute it is the identity, and if they overlap only a little it moves only the pieces near the overlap. Each of $R$ and $U$ moves 8 cubies, but their commutator moves 7. More delicate commutators move only three pieces, which is what a solver needs at the end of a solution, when most of the cube is already solved.

A conjugate is a move of the form $X M X^{-1}$: a setup move $X$, then $M$, then the setup undone. It does the work of $M$ on whichever pieces $X$ brought into $M$'s working area. For example, $R' D' R D$ moves the corners $DBL$, $DBR$, $DFR$ and $UFR$ (with three edges). The conjugate $U (R' D' R D) U'$ moves $DBL$, $DBR$, $DFR$ and $UBR$ instead. The setup move $U$ carries the cubie at $UBR$ into the position $UFR$, where $R' D' R D$ acts on it. A conjugate has the same cycle structure as the move it conjugates, and hence the same order. For permutations this is the relabelling rule proved in Symmetric Groups and Permutations: conjugating a cycle renames the objects in it. Conjugation is studied further with normal subgroups.

Check your understanding. Which four corners does $U' (R' D' R D) U$ move?

$DBL$, $DBR$, $DFR$ and $UFL$. The setup move is now $U'$, which turns the up face the other way and so carries the cubie at $UFL$ into the position $UFR$. The script confirms the answer.

God's number

How many turns can a position need? The distance of a position from the solved cube is the least number of face turns that reaches it, counting a quarter turn or a half turn of any face as one turn (the half-turn metric). The largest distance of any position, the diameter of the group's Cayley graph, is known among cubers as God's number.

A lower bound follows from counting. Call a sequence of face turns reduced if it never turns the same face twice in a row, and never turns the second face of an opposite pair before the first. (Turns of opposite faces commute, so their order can be fixed.) Every move is produced by some reduced sequence. The script counts 19,973,266,111,335,481,264 reduced sequences of at most 17 turns, fewer than $\lvert G \rvert$. So some position needs at least 18 turns; Rokicki and coauthors (2013, §2) report that this counting bound was understood by 1980.

In 1995 Michael Reid showed that the superflip needs 20 turns (Rokicki et al., 2013, §2). It is the position with every cubie in place and all twelve edges flipped, which condition 3 allows since 12 is even. The superflip has order 2. The script checks that it commutes with every face turn, hence with every move. So it lies in the center of $G$, the set of elements that commute with everything (Subgroups and Cyclic Groups). It is reached by the 20-turn sequence

$$U \, R2 \, F \, B \, R \, B2 \, R \, U2 \, L \, B2 \, R \, U' \, D' \, R2 \, F \, R' \, L \, B2 \, U2 \, F2,$$

which the script confirms.

The matching upper bound took three decades. Rokicki, Kociemba, Davidson and Dethridge (2013) proved that every position can be solved in 20 face turns or fewer, so God's number is 20. Their proof had three steps.

  • It partitioned the $4.3 \times 10^{19}$ positions into the cosets of the subgroup in the table above.
  • It reduced the work by the symmetries of the cube.
  • It solved the remaining cosets with about one billion seconds of donated computer time.

Where it leads

What we have learned

The moves of the cube form a nonabelian group of permutations of 48 facets, generated by six quarter turns. Only turns of opposite faces commute. A move's order is the least common multiple of its cycle lengths, each multiplied by 3 or 2 when the cycle returns twisted or flipped. That gives 105 for $RU$, and 1260 at most. Three invariants (equal corner and edge parity, total twist 0, total flip 0) decide which assemblies are reachable. With a Schreier-Sims computation they give $\lvert G \rvert = 43{,}252{,}003{,}274{,}489{,}856{,}000$, one assembly in twelve. That is why a twisted corner cannot be fixed.

The first of the three invariants, the parity of a permutation, was taken on trust here. Why is every permutation either even or odd, and never both? The next article, Symmetric Groups and Permutations, develops the cycle notation used above and proves it.

References

  • Joyner, W. D. (1997). Mathematics of the Rubik's Cube. Lecture notes, United States Naval Academy, Spring semester 1996 to 1997. §4.5 (the Rubik's cubes as permutation puzzles; Singmaster notation; the generators as permutations of facets); Chapter 5 (Singmaster's statement that the largest order of an element of the cube group is 1260); Chapter 10 (the cube moves as permutations and orientations of corners and edges; Theorem 202, the second fundamental theorem of cube theory, credited to Ann Scott; explicit moves twisting two corners and flipping two edges). Later published as Adventures in Group Theory: Rubik's Cube, Merlin's Magic and Other Mathematical Toys (2nd ed., Johns Hopkins University Press, 2008). record · 3 pages
  • Rokicki, T., Kociemba, H., Davidson, M., and Dethridge, J. (2013). The diameter of the Rubik's cube group is twenty. SIAM Journal on Discrete Mathematics, 27(2), 1082 to 1105. https://doi.org/10.1137/120867366. §1 (every position solvable in 20 face turns in the half-turn metric; about $4.3 \times 10^{19}$ positions); §2 (history: the counting lower bound of 18 known by 1980, Reid's 1995 proof that the superflip needs 20 turns); §4 (the subgroup generated by $U$, $D$ and the half turns of the other faces, of order 19,508,428,800, and its 2,217,093,120 cosets). record · 3 pages