All projects

Mathematics

The Arrowed Rubik's Cube

Draw an arrow on each centre of a Rubik’s cube and ask whether one centre can be turned by a quarter turn while everything else stays solved. It cannot, and the reason is a two-line parity argument. This page proves exactly which arrow patterns are possible, finds every one of them with the three words of the demo, and counts the positions of this arrowed cube: 2048 times as many as the ordinary cube.
  • Group theory
  • Permutations

In simple words

The middle square of each face of a Rubik's cube never leaves its face. It only spins in place, and because it is one plain colour, nobody notices. Draw an arrow on it and suddenly you can see the spin. Now try to solve the cube with every arrow pointing the right way.

Here is the surprise: you can never turn just one arrow by a quarter turn while everything else is solved. Every quarter turn of a face spins one arrow and, at the same time, moves four corners around in a loop, and the two always go together. So arrows can only be fixed two quarter turns at a time. Press Run below. After 105 repetitions of “turn the top, turn the right” every sticker is back home, yet two arrows are still turned.

A question from childhood

When I was young I was fascinated by my Rubik's cube, though not by solving it fast. I knew how to solve it, and the race for speed around me did not interest me much. Other questions did. How many positions are there? And what about the centres? They never leave their faces, they only spin in place. I imagined an arrow on each centre and tried to turn a single one by a quarter turn while every sticker stayed where it belonged. However long I tried, I could not. Years later I learned that the cube with marked centres is known as the supercube, and that my failure had nothing to do with skill. It is a theorem, and its proof fits in two lines. This page tells the story with the arrows drawn in.

Positions as group elements

Write U,R,F,D,L,BU, R, F, D, L, B for clockwise quarter turns of the up, right, front, down, left and back faces, U′U' for the counterclockwise turn and U2U^2 for the half turn. Every sequence of turns rearranges the stickers, and two sequences are equal when they rearrange them in the same way. With that rule the sequences form a group GG, the cube group, and each element of GG is one reachable position, the position it produces from the solved cube. Counting positions means counting group elements. The eight corners can be arranged in 8!8! ways and twisted in 373^7 (the last twist is forced), the twelve edges arranged in 12!12! ways and flipped in 2112^{11} (the last flip is forced), and only half of these combinations are reachable, because the corner and edge arrangements are always both even or both odd [1][2]:

∣G∣=8!⋅37⋅12!⋅2112=43 252 003 274 489 856 000≈4.3×1019.|G| = \frac{8!\cdot 3^7\cdot 12!\cdot 2^{11}}{2} = 43\,252\,003\,274\,489\,856\,000 \approx 4.3\times10^{19}.

Every one of these positions can be solved in at most 20 face turns, a bound settled by computer in 2010 and published in 2013 [3]. The picture-hanging puzzle is another toy whose secret is a group, there a free group.

Arrows on the centres

Face turns never move a centre, they only spin it. Record how often each centre has been turned,

c=(cU, cR, cF, cD, cL, cB)∈(Z4)6,\mathbf c = (c_U,\,c_R,\,c_F,\,c_D,\,c_L,\,c_B)\in(\mathbb Z_4)^6 ,

counting quarter turns clockwise, modulo 4: a UU adds 1 to cUc_U, a U′U' subtracts 1 and a U2U^2 adds 2. Because the centres stay in place, these counts simply add up, in whatever order the turns come, so the map φ\varphi that sends a sequence to its vector c\mathbf c is a homomorphism onto the abelian group C=(Z4)6C=(\mathbb Z_4)^6. An arrowed position is then a pair (c,g)(\mathbf c, g), the arrows together with the stickers, and the arrowed group G→G^{\rightarrow} is the set of pairs that sequences of turns can reach. Which pairs are these?

The parity rule

Let sgn⁡g\operatorname{sgn} g be 0 when position gg arranges the corners by an even permutation and 1 when the permutation is odd. Then every reachable arrowed position obeys

cU+cR+cF+cD+cL+cB  ≡  sgn⁡g(mod2).c_U + c_R + c_F + c_D + c_L + c_B \;\equiv\; \operatorname{sgn} g \pmod 2 .

The proof is the two lines promised. Both sides are 0 for the solved cube. A quarter turn moves four corners around a 4-cycle, which is an odd permutation, and turns one centre by 1, so it changes both sides by one, and the two sides stay equal forever. A half turn is two quarter turns. Now suppose a single centre were turned a quarter turn with every sticker home. The left side would be 1 and the right side 0, which the rule forbids. That is the reason my childhood attempts failed. The same argument, applied to the 4-cycle of edges that every quarter turn makes as well, is the reason the corner and edge arrangements always share their parity.

Every allowed arrow pattern happens

The rule is the only obstacle. Take any sticker position gg and any arrows c\mathbf c that satisfy it. Some sequence reaches gg, with arrows φ\varphi of the right parity, so the difference between c\mathbf c and those arrows has an even sum. It is therefore enough to produce every even-sum pattern of arrows with all stickers home, and the demo already does it.

Its second word, (UR)n(UR)^n, needs 105 repetitions to bring the stickers back. Under URUR five corners travel around a 5-cycle and come back twisted, so they need 3×5=153\times5=15 rounds, a sixth corner stays in its place but twists, which takes 3, and seven edges travel around a 7-cycle without flipping. The stickers return after lcm⁡(15,3,7)=105\operatorname{lcm}(15,3,7)=105 repetitions, and by then each of the two centres has been turned 105 times,

φ((UR)105)=105 (eU+eR)=eU+eR(mod4),\varphi\big((UR)^{105}\big) = 105\,(\mathbf e_U+\mathbf e_R) = \mathbf e_U+\mathbf e_R \pmod 4 ,

the U and R arrows both a quarter turn away from home. By the symmetry of the cube the same holds for any two neighbouring faces XX and YY: (XY)105(XY)^{105} turns exactly those two arrows, which the site's tests check for all 24 ordered pairs. These twists are enough. A single centre turned by 180° follows from three of them, and a quarter turn of two opposite centres from two of them and one such half turn,

2eU=(eU+eR)+(eU+eF)−(eR+eF),eU+eD=(eU+eR)+(eR+eD)−2eR,2\mathbf e_U = (\mathbf e_U+\mathbf e_R)+(\mathbf e_U+\mathbf e_F)-(\mathbf e_R+\mathbf e_F),\qquad \mathbf e_U+\mathbf e_D=(\mathbf e_U+\mathbf e_R)+(\mathbf e_R+\mathbf e_D)-2\mathbf e_R ,

and any arrows c\mathbf c with an even sum split into such pieces,

c=∑X≠UcX (eX+eU)+(cU−∑X≠UcX) eU,\mathbf c = \sum_{X\neq U} c_X\,(\mathbf e_X+\mathbf e_U) + \Big(c_U-\sum_{X\neq U}c_X\Big)\,\mathbf e_U ,

where the last coefficient is even, so its term is a multiple of 2eU2\mathbf e_U. Put together, the arrowed cube is exactly

G→≅{(c,g)∈(Z4)6×G  :  ∑XcX≡sgn⁡g(mod2)},G^{\rightarrow} \cong \Big\{(\mathbf c, g)\in(\mathbb Z_4)^6\times G \;:\; \textstyle\sum_X c_X \equiv \operatorname{sgn} g \pmod 2\Big\},
∣G→∣=462 ∣G∣=2048 ∣G∣=88 580 102 706 155 225 088 000≈8.9×1022.|G^{\rightarrow}| = \frac{4^6}{2}\,|G| = 2048\,|G| = 88\,580\,102\,706\,155\,225\,088\,000 \approx 8.9\times10^{22}.

The factor 2048 has been quoted among puzzle enthusiasts for years [4]. The argument above proves it, and it uses nothing but the words of the demo. Two smaller groups sit inside. The pure centre twists, every sticker home, form the even-sum vectors of (Z4)6(\mathbb Z_4)^6, 2048 of them, and forgetting the arrows maps G→G^{\rightarrow} onto GG with exactly these twists as its kernel. The positions with every arrow home, the kernel of φ\varphi, are the even half of GG. Both views give the same count, 2048 ∣G∣=46 ∣G∣/22048\,|G| = 4^6\,|G|/2.

The three words of the demo

The word (U2R2)n(U^2R^2)^n moves the stickers in eight 3-cycles and four 2-cycles, so it returns after lcm⁡(3,2)=6\operatorname{lcm}(3,2)=6 repetitions. Its arrows go home even sooner, because φ(U2R2)=2eU+2eR\varphi(U^2R^2)=2\mathbf e_U+2\mathbf e_R vanishes after any even number of repetitions, so at n=6n=6 both readouts turn green. The word (UR)n(UR)^n is the one above: stickers home at 105 with two arrows turned, and stickers and arrows home together only at lcm⁡(105,4)=420\operatorname{lcm}(105,4)=420. The word (U′R)n(U'R)^n moves two groups of three corners, each around a 3-cycle with a twist, and seven edges around a 7-cycle, so its stickers return after lcm⁡(9,7)=63\operatorname{lcm}(9,7)=63 repetitions, with

φ((U′R)63)=63 (−eU+eR)=eU−eR(mod4),\varphi\big((U'R)^{63}\big) = 63\,(-\mathbf e_U+\mathbf e_R) = \mathbf e_U-\mathbf e_R \pmod 4 ,

the U arrow at +90° and the R arrow at −90°. Run (UR)105(UR)^{105} and then (U′R)63(U'R)^{63}, and the two R turns cancel while the two U turns add: every sticker is home and the U centre alone has turned by 180°, after 336 quarter turns. Much shorter routes exist. The twelve face turns U R L U2 R′ L′ U R L U2 R′ L′U\,R\,L\,U^2\,R'\,L'\,U\,R\,L\,U^2\,R'\,L' do the same job.

Inside the code

The demo works on the 54 stickers directly. The move tables are not typed by hand, which is where such programs usually go wrong, but generated from the three-dimensional rotation of each layer:

// The moves are generated from geometry, not typed in. A clockwise quarter
// turn of face X rotates every sticker of X's layer by −90° about the outward
// normal k of X: positions and sticker normals alike.
const rotCW = (k, v) => add(scale(k, dot(k, v)), scale(cross(k, v), -1));
STICKERS.forEach((s, i) => {
  if (dot(s.pos, k) !== 1) return;                        // not in this layer
  const j = INDEX.get(key(rotCW(k, s.pos), rotCW(k, s.normal)));
  from[j] = i;                                            // sticker i lands on j
});

Applying a turn is then a permutation of the stickers plus one addition, and that addition is the whole of the arrow bookkeeping:

// A turn permutes the 54 stickers and adds to its centre's count, mod 4.
// That last line is the homomorphism φ of the text.
for (let q = 0; q < quarterTurns; q++) {
  scratch.set(cube.facelets);
  for (let i = 0; i < 54; i++) cube.facelets[i] = scratch[from[i]];
}
cube.centres[fi] = (cube.centres[fi] + quarterTurns) % 4;

The orders quoted on this page come from the cycle structure of the sticker permutation, with the same few lines that the tests use:

// The order of a move sequence is the lcm of the cycle lengths of its
// permutation: 105 for UR, whose stickers move in cycles of 15, 7, 7 and 3.
for (let i = 0; i < p.length; i++) {
  if (seen[i]) continue;
  let len = 0;
  for (let j = i; !seen[j]; j = p[j]) { seen[j] = true; len++; }
  order = (order / gcd(order, len)) * len;
}

Try it yourself

Choose a word, press Run and watch the two readouts: Stickers tells you whether every sticker is home, and Centre arrows lists the arrows that are not. Run stops at the next multiple of N, so pressing it again carries on to 2N, 3N and beyond, and with (UR)n(UR)^n you can watch the arrows come home at 420. The links below reload this page with a sequence already applied to the cube. First (UR)105, stickers home and two arrows turned. Then (U′R)63, with the arrows turned in opposite senses. Then the twelve turns that spin the U centre by 180°, and finally a single quarter turn of U: one arrow turned, and eight pieces out of place with it. Type your own sequences in the Move sequence box, where a final number repeats the whole sequence, and try to beat the parity rule. You will not.

References

  1. [1] D. Singmaster, Notes on Rubik’s ‘Magic Cube’ (Enslow, Hillside, NJ, 1981).
  2. [2] D. Joyner, Adventures in Group Theory: Rubik’s Cube, Merlin’s Machine, and Other Mathematical Toys, 2nd ed. (Johns Hopkins University Press, Baltimore, 2008).
  3. [3] T. Rokicki, H. Kociemba, M. Davidson, and J. Dethridge, The diameter of the Rubik’s cube group is twenty, SIAM J. Discrete Math. 27, 1082 (2013).
  4. [4] One-Answer Puzzle Theory Question Thread, SpeedSolving.com forum (the count 4⁶/2 = 2048 for the centres).