Episode 4 • Mathematics & Puzzles

The Math Behind Rubik's Cube

42 minutes May 16, 2026 Group Theory, Speedcubing, Combinatorics
Audio coming soon — read the full episode below

Episode Outline

  1. The invention story: a Budapest professor and his wooden block (1974)
  2. The first month: Rubik couldn't solve his own creation
  3. Counting to 43 quintillion: the combinatorics explained
  4. Group theory and the Rubik's Cube group
  5. God's Number: proving 20 moves is always enough
  6. Optimal solving methods: CFOP, Roux, ZZ
  7. The speedcubing explosion: from hobby to Olympic-scale sport
  8. Cubing beyond 3×3: the wild world of big cubes
  9. What the Cube teaches about mathematics education

A Teaching Tool That Became a Global Obsession

In 1974, a 29-year-old Hungarian architecture professor named Ernő Rubik sat at his desk in Budapest trying to solve a very specific problem. He wanted his students to understand three-dimensional space — the way objects rotate, how parts relate to a whole when movement is involved. Textbooks weren't cutting it. Models weren't cutting it. He needed something students could hold in their hands and manipulate directly.

So he built a wooden block. Twenty-six smaller cubes, held together by an internal mechanism he had to invent from scratch, each capable of rotating independently while remaining connected to the whole. He covered the faces in colored paper — six colors, one per side. And he turned it.

Within a few twists, the colors mixed. And then Ernő Rubik spent the next month trying to unmix them.

He had not realized, in designing his teaching tool, that he had created one of the most mathematically complex objects in human history. The cube that would bear his name contains 43,252,003,274,489,856,000 possible configurations — 43 quintillion, 252 quadrillion. If you could visit one new configuration every second since the Big Bang, you still wouldn't have seen them all.

Counting the Universe Inside a Cube

Let's talk about where that number comes from, because the combinatorics are genuinely beautiful.

A standard 3×3×3 Rubik's Cube has three types of pieces: 8 corners, 12 edges, and 6 centers (which don't actually move relative to each other). The centers determine the color of each face. Everything else can move.

The 8 corner pieces can be arranged in 8! (40,320) different ways. But each corner can also be oriented in 3 different ways, giving 3⁸ (6,561) orientation combinations. However, the cube's physics constrain this: you can't twist a single corner without also affecting others. The total corner contributions are 8! × 3⁷.

The 12 edge pieces can be arranged in 12! ways, each orientable in 2 positions, again with physical constraints limiting the total to 12! × 2¹¹.

Multiply it all together, account for the fact that only half of all permutations are physically reachable (you can't achieve an odd permutation by turning faces), and you land at exactly:

The Number

43,252,003,274,489,856,000 — that's (8! × 3⁷ × 12! × 2¹⁰) / 12, or about 4.3 × 10¹⁹. Every single one of those states is reachable from any other. Every single one is solvable.

Group Theory: The Real Language of the Cube

Mathematicians recognized almost immediately that the Rubik's Cube was a perfect physical instantiation of a concept called a group — one of the most fundamental structures in abstract algebra.

A group is a set of elements combined with an operation that satisfies four properties: closure (combining any two elements gives another element in the set), associativity, the existence of an identity element (doing nothing), and the existence of inverses (every move can be undone).

The set of all possible sequences of moves you can make on a Rubik's Cube, combined with the operation of "do one after the other," forms a group. Mathematicians call it the Rubik's Cube group, and it's a subgroup of the symmetric group S₄₈ (the group of all permutations of the cube's 48 colored stickers).

This connection to group theory isn't just an intellectual curiosity. It's the reason the cube is solvable in a systematic way. Every solving algorithm exploits group-theoretic properties: conjugates (ABA⁻¹ sequences that isolate specific piece effects), commutators (ABA⁻¹B⁻¹ sequences that produce minimal changes), and coset decompositions that break the full group into manageable sub-problems.

"The cube is an abstract structure made concrete. When you hold it and turn it, you're doing algebra with your hands." — David Singmaster, mathematician and author of "Notes on Rubik's Magic Cube" (1980)

What David Singmaster Did for the Cube

David Singmaster, a British mathematician, was among the first to analyze the cube formally. In 1979 — while the cube was spreading globally but before most mathematicians had studied it — he published "Notes on Rubik's Magic Cube," which introduced the notation system we still use today. R, L, U, D, F, B for right, left, up, down, front, back faces, with apostrophes for counterclockwise moves and numerals for double turns. Every speedcubing algorithm, every YouTube tutorial, every competitive solve uses Singmaster's notation.

More importantly, Singmaster proved that a "superflip" — a state where all corners are in their correct positions and orientations but all edges are correctly placed but flipped — requires exactly 20 moves to solve. This gave mathematicians their first evidence that 20 might be the true upper bound.

God's Number: Proving 20 Is Always Enough

For decades, mathematicians and computer scientists wondered: what is the maximum number of moves required to solve any Rubik's Cube configuration? They called it "God's Number" — the move count available to an omniscient solver who always took the shortest possible path.

Lower bounds were easy to find. That superflip position Singmaster analyzed? It requires 20 moves. So God's Number must be at least 20. The hard part was proving that no position requires more than 20.

The cube has 43 quintillion positions. You cannot simply check every single one, even with fast computers. The search space is too large. For decades, the upper bound crept downward through clever mathematics: 52 moves (1981), 29 (1995), 26 (2007), 22 (2008). Tantalizingly close, but not quite there.

In 2010, a team led by mathematician Tomas Rokicki — with Google donating computer time equivalent to 35 CPU-years — finally proved it: every one of the 43 quintillion positions can be solved in 20 moves or fewer. God's Number is exactly 20.

The proof relied on a clever decomposition: they divided all positions into about 2.2 billion cosets, proved that any position within each coset was solvable in at most 20 moves, and then verified this computationally. A beautiful combination of theoretical mathematics and sheer computing power.

Solving the Cube: From Intuition to Algorithm

Knowing that 20 moves always suffice is mathematically satisfying but practically useless — the algorithm to find that optimal path is computationally expensive. Human solvers use different strategies.

The most popular beginner method, the Layer-by-Layer approach, solves one layer at a time using memorized algorithms for each case. It typically takes 80–120 moves. Slow, but learnable in a weekend.

Competitive speedcubers primarily use CFOP, developed by Czech speedcuber Jessica Fridrich in the late 1980s. CFOP stands for its four phases: Cross (building a cross on the bottom layer), F2L (First Two Layers solved simultaneously using 41 algorithms), OLL (Orienting the Last Layer, 57 algorithms), and PLL (Permuting the Last Layer, 21 algorithms). Expert CFOP solvers memorize over 100 algorithms and achieve move counts of 50–60 per solve.

The Roux method, developed by French cuber Gilles Roux, takes a more block-building approach with less algorithm memorization but more intuitive manipulation. ZZ, developed by Zbigniew Zborowski, reduces cube moves to a single axis for much of the solve, making it theoretically efficient but harder to learn.

Did You Know?

The CFOP method's "F2L" phase, done intuitively rather than algorithmically, is where the difference between a 10-second solver and a 5-second solver lives. Top cubers can pair corner-edge pairs in 2–3 moves consistently. The best in the world see this intuitively, without conscious calculation.

The Speedcubing Revolution

The first Rubik's Cube World Championship was held in Budapest in 1982. Minh Thai of the United States won with a time of 22.95 seconds. The audience was astonished.

Competitions went dormant for nearly two decades. Then, in 2003, Dan Knights organized the World Rubik's Games Championship in Toronto, drawing competitors from 15 countries. The World Cube Association (WCA) was founded the following year, and speedcubing exploded into a genuine international sport.

Today, WCA recognizes 17 official events — not just the standard 3×3, but blindfolded solving, one-handed solving, solving with feet (now discontinued), 2×2 through 7×7, Megaminx, Pyraminx, Skewb, Square-1, and more. World records fall every few months. The current 3×3 single world record of 3.13 seconds, set by Max Park in 2023, is almost incomprehensible — the human reaction time to start a timer is roughly 0.15 seconds.

At the top levels, speedcubing is as much about recognizing patterns instantaneously as it is about manual dexterity. The best cubers can identify the optimal F2L pair insertions before their hands finish the previous algorithm. They're running multiple mental processes in parallel while their fingers execute memorized sequences at 10+ moves per second.

Beyond 3×3: The World of Big Cubes

If the 3×3 has 43 quintillion states, how many does a 4×4 (the Rubik's Revenge) have? The number is approximately 7.4 × 10⁴⁵ — roughly a septillion times more than the 3×3. The 5×5 (Professor's Cube) tops 2.8 × 10⁷⁴.

The 7×7 cube — the largest commonly manufactured cube — has approximately 1.95 × 10¹⁶⁰ possible states. To put that in perspective: the observable universe contains an estimated 10⁸⁰ atoms. The number of 7×7 states exceeds the square of that.

Big cube solving introduces new challenges that don't exist on the 3×3: parity errors. Because 4×4 and other even-layered cubes have no fixed centers, certain configurations arise that look nearly solved but require additional algorithms to fix. These "parities" are a rite of passage for every cuber moving beyond the 3×3.

What the Cube Teaches Us About Mathematics Education

Ernő Rubik's original instinct — that the cube could teach spatial reasoning — proved more than correct. Educational programs worldwide now use the Rubik's Cube as an entry point into group theory, combinatorics, and algorithmic thinking. The "You CAN Do the Rubik's Cube" program has reached millions of students in American schools alone.

There's something profound about learning mathematics through an object you can hold and twist. Abstract algebra becomes tangible when you can physically perform a group operation with your hands. The associativity of move sequences, the existence of inverses, the beauty of commutators — these cease to be abstract symbols and become something you experience.

Rubik himself, now in his 80s, has reflected often on what the cube became. He intended a teaching tool, got a puzzle, and inadvertently created an object that has introduced more people to serious mathematics than perhaps any textbook ever written.

"I didn't set out to create a puzzle. I wanted to express something that many people have difficulty imagining in three dimensions. But the puzzle was always there, hiding inside the structure." — Ernő Rubik, in "Cubed: The Puzzle of Us All" (2020)

Next time you pick up a Rubik's Cube — whether you solve it in seconds or just turn it thoughtlessly in your hands — remember that you're holding one of the most mathematically rich objects ever manufactured. Every scrambled position is a solvable equation. Every algorithm is a theorem. And somewhere underneath that satisfying click of turning layers, there's group theory waiting to be discovered.

Resources & Further Reading

Frequently Asked Questions

How many possible positions does a Rubik's Cube have?

A standard 3×3×3 Rubik's Cube has exactly 43,252,003,274,489,856,000 possible states — commonly rounded to 43 quintillion. If every person on Earth scrambled a cube every second since the Big Bang, they still wouldn't have reached all positions.

What is God's Number for the Rubik's Cube?

God's Number is 20 — the maximum number of moves needed to solve any scrambled Rubik's Cube configuration using the most efficient method. This was proven in 2010 by a team of mathematicians using 35 CPU-years of computing time donated by Google.

What branch of mathematics explains the Rubik's Cube?

Group theory is the primary mathematical framework. The set of all Rubik's Cube moves forms a mathematical group called the Rubik's Cube group, with operations (turns) that combine, have inverses (reverse turns), and satisfy associativity.

Who invented the Rubik's Cube and why?

Hungarian professor Ernő Rubik invented the cube in 1974 as a teaching aid to help his architecture students understand three-dimensional spatial reasoning. He didn't initially realize he had created a puzzle — it took him over a month to solve his own invention.

What is the current world record for solving a Rubik's Cube?

As of 2024, the official World Cube Association record for 3×3 single solve stands at 3.13 seconds, set by Max Park in 2023. The average of five solves record is around 4.09 seconds. Robot solvers have achieved times under 0.5 seconds.

Listener Q&A

Q: Is it true you can always solve a Rubik's Cube in 20 moves, and if so, why don't speedcubers use that method?
Yes, every position is solvable in 20 moves or fewer — but finding that optimal solution requires massive computation for each scramble. A computer running optimal search might take seconds or minutes per solve. Human speedcubers use sub-optimal methods (CFOP averages 50–60 moves) because those methods can be executed in 4–5 seconds by a trained human, versus the minutes it would take to compute an optimal solution.
Q: How hard is it for an adult to learn to solve a Rubik's Cube from scratch?
Most adults can learn the beginner layer-by-layer method in 1–3 hours of focused practice using a step-by-step guide. Solving under 2 minutes usually comes within a week or two of casual practice. Getting under 1 minute typically requires learning more efficient algorithms for the last layer. Sub-30 seconds requires dedicated practice with a speed method like CFOP.
Q: Can the cube be used to actually teach group theory in a classroom?
Absolutely, and many mathematicians recommend it. The cube makes abstract concepts like generators, group order, conjugates, and commutators physically tangible. Several universities now use it in abstract algebra courses, and David Joyner's book "Adventures in Group Theory" (Johns Hopkins UP) uses the cube and other puzzles as its central examples throughout.