The Rubik's cube is a group
Why a puzzle toy is a clean lesson in group theory: invariants, commutators and God's number.
The Rubik’s cube looks like a puzzle about colours. It is really a puzzle about moves.
Moves form a group
Every sequence of turns is an element. Doing one sequence after another is composition. Every move can be undone, and doing nothing is the identity. That is exactly a group, and most of what makes the cube hard or easy follows from that one observation.
How many positions?
The corners can be arranged in ways and twisted in ways (the last corner’s twist is forced by the others). The edges can be arranged in ways and flipped in ways (the last flip is forced). Finally, the permutation of the corners and the permutation of the edges must have the same parity, which halves the count. The number of positions is
Not every arrangement of the pieces is reachable. Taking the cube apart gives possible reassemblies, twelve times as many, so a cube put back together at random is solvable only one time in twelve.
Invariants: what never changes
Write for the twist of corner , for the flip of edge , and for the permutations of corners and edges. Every face turn preserves three quantities:
These invariants explain the “impossible” positions people meet after reassembling a cube: no sequence of turns can fix a single twisted corner, because no turn can change the total twist.
Commutators do the real work
If and are two move sequences, then the commutator undoes almost everything, except where and interact. Choose and so that they overlap in only one or two pieces, and the result moves only those pieces. Most solving algorithms are commutators, or conjugates of the form : move the pieces into position, act on them, move everything back. Once this clicks, the cube stops being a list of sequences to memorise and becomes something you can design.
God’s number
Every position can be solved in at most moves, counting a half turn as one move. This was proved in 2010 by Tomas Rokicki, Herbert Kociemba, Morley Davidson and John Dethridge, who split the positions into cosets and checked them with about 35 CPU-years of computing time donated by Google. Counting only quarter turns, the answer is (2014). Human methods are far from optimal: a typical speedsolve with the CFOP method takes roughly – moves.
Why I like it
The cube is the cleanest example I know of a pattern that keeps coming back in mathematics and computer science: describe the moves, find what they preserve, then build small tools that change exactly one thing.