Mathematics of the Rubik's Cube

There are some serious questions about the mathematics of the Rubik's Cube. Fortunately most of these have been answered like what is the minimum amount of moves needed to solve it from any starting position or what is the number of possible permutations, and the list goes on.

After it had been invented nobody could solve it and they weren't even sure that a human being is able to unjumble it at all. It took a month to find the first solution of the Magic Cube despite almost every student was searching for it at the Budapest College of Applied Arts where the inventor, Rubik Erno was a professor back in 1974.

Number of permutations

Once I met somebody who has never played with the Rubik's Cube. He was sure about that he is able to solve it because it seemed so easy for him. "I just rotate the faces randomly until it is solved" - he said.

Well, it is not really so simple. There are so many possible states of a 3x3x3 Rubik's Cube you could never finish solving it just turning the faces randomly. Even a 2x2x2 Pocket Cube has 3.674.160 possible permutations. This strategy wouldn't work neither for a 2x2x2 cube.

The classic 3x3x3 has much more possible patterns: approximately 43 quintillion (exactly 43 quintillion, 252 quadrillion, 3 trillion, 274 billion, 489 million, 856 thousand). To illustrate this number, if we had as many 6 centimeter large Rubik's Cubes as there are permutations, we could cover the surface of the Earth 300 times.

number of rubiks cube permutations

For a 7x7x7 Cube this number is about 1.95 * 10160 roughly 19.5 duoquinquagintillion.

God's Number

God's Number shows the smallest number of moves needed to solve the 3x3x3 Rubik's Cube from any random starting position.

Since July of 2010 we know that this number is 20, so every position can be solved in twenty moves or less, considering one move a 90o or 180o twist of any face. This number was calculated thanks to Google who donated 36 CPU-years of idle computer time, solving every position of the Rubik's Cube in less than 21 moves. This means that we have found the solution of the "Superflip" scramble in 20 moves:

The first estimation of the God's Number was 52 moves in July 1981. Then this number was gradually decreasing. 42 in 1990, 29 in 2000, 22 in 2008, reaching the final number of 20.

We've written a separate article about the God's Number. Click here to read it!

Permutation Group

Mathematically the Rubik's Cube is a permutation group. It has 6 different colors and each color is repeated exactly 9 times, so the cube can be considered as an ordered list which has 54 elements with numbers between 1 and 6, each number meaning a color being repeated 9 times. We can rotate the 6 faces of the cube so we can define 6 basic operations or permutations which rearrange the ordered list in a certain way. Repeating and combining these permutations we can define new permutations, which rearrange the list in an other way. On the picture below you can see how a D rotation rearranges the elements of our list.

permutation group rubiks cube mathematics

Now lets see why the Rubik's Cube is a permutation group. In math a permutation group is a group whose elements are permutations of ordered list, and whose group operation is the permutations which rearrange the set in a certain way. The group of all permutations of a set is the symmetric group.

Let's see the properties of this mathematic structure.

  • Associative - the permutations in the row can be grouped together: ex. (RB')L = R(B'L)
  • Neutral element - there is a permutation which doesn't rearrange the set: ex. RR'
  • Inverse element - every permutation has an inverse permutation: ex. R - R'
  • Commutative - Commutativity is not a necessary condition of the permutation group but notice that FB = BF but FR != RF
  • Degree of permutations - this is a number which shows how many times has to execute a permutation to get back to the original position of the cube. Every permutation has a finite degree. ex: 4 x F = 1, 6 x (R'D'RD), 336 x (UUR'LLDDB'R'U'B'R'U'B'R'U) = 1

If you don't understand what the letters mean in the previous explication please read the notation.

This was just a very short introduction in the Mathematics of the Rubik's Cube, you can find much more interesting material about this topic. If you're interested I recommend you to read the paper of W. D. Joyner - Mathematics of the Rubik's Cube.

Patrik Norqvist
The 2*2*3 in the denominator comes from that if 7 corners are solved the last one is aways solved . Also if 11 edges are solved the last one is always solved, and finally you cannot move just two edges without moving something else, thus if the first 10 edges are on the correct place (and all corners correct too), the last two edges will always be on the correct place. The nominator has only corners and edges, so the 24 orientations of the cube is not included in this number, the middles are in one single fixed position in this calculation.
Todd Elliott
Honest question, what is the actual number of possible arrangements. If you subtract the fact that orientation of the cube does not actually change the pattern, and we don't calculate the different orbits. Just include the possible patterns obtainable by multiplating legally a cube starting from a solved position
Mike Mounier
At a minimum the number would go down to ≈43 quintillion divided by 24, because there are 24 ways you can position the cube without rotating any of its faces. Hold a solved cube with white on top, green in front. While keeping the white on top, you can also view it with blue in front, or red, or orange . . . that's 4 ways to view it with white on top without actually turning any faces. Then, you can repeat the same 4 positions with each of the other 5 faces on top. So 6 possible faces on top, each viewable 4 different ways, equals 24 positions without turning any faces. If it's this, then dividing the ≈43 quintillion by 24 yields ≈1.8 quintillion. Someone may wish to lower this number by eliminating other things, but I personally consider ≈1.8 quintillion to be a better indication of maximum possible number of scrambles than the the full ≈43 quintillion.
Carlos Rossique Delmas
Mike Mounier, the calculations already take account all the six centers fixed, they don't move, to one position (ie white on top), so you don't need to divide by 24
Sam Lim
Carlos Rossique Delmas , Hmm... I think I can see the numerator being what it is -- the total number of permutations possible for the corner- and edge- cubes. What I don't quite understand is the denominator. I thought it would be 24 (4*3*2), not 12 (2*3*2), as 24 seems to be the number of ways to orient the cube with fixed centres?
Zhicheng Cai
Can the symmetric group be smaller? Let's say, right now we have a permuation group definition or modeling for 3x3x3 Rubik's cube, which is a subgroup of S_48. Is there a symmetric group S_n, where the rubik's cube group can be modeled as a subgroup of S_n, s.t., n < 48? If not, why?
Elle JB
As a Mathematician and Cuber, this is pretty cool!
Jozsef Kiraly
How can i calc out the 3x3x3's possible states?
I started solving the problem with getting the cube's rules, but i dont know, what i need to do with theese.
Gurmeet Singh
Király József There can be multiple ways. One easy way I can think of is as follows - To solve a cube, you can divide the process in four steps -
1) Position corners - for each of the 8 positions, we have to place a corner piece so total way = 8P8 = 8!
2) Position edges - for each of the 12 positions, we have to place an edge piece, but we can place only 10 of them as the last two are then fixed i.e., there is no algo to swap two edges without dispositionening any other edge or corner. So total way = 12P10 = 12!/2
3) Orient corners - any orientation for 7 corners is possible but it fixes the l...
Sebastian Hooker
All I want to see was what type of math was to solve the 3x3x3 cube
Tom Barnes
just to throw another interesting thought. if you have ever tried to solve a cube that had a picture on it, you would be aware of the orientation of the center squares. Not relevant for a regular cube. But if calculating all official permutations, then those would count. would be even more complicated in larger cubes as each internal square could have a different orientation. crazy.
Hevy Snatter
Sorry but i still don't understand the first rule: Assosiativity. In your example you state that (RB')L is equal to R(B'L). However if you try this out the Cube ends up with two different shapes. Can anybody please explain this to me since i need it for a school work.
Maslamah Mohamed Murshid
its just how you group the moves in an algorithm.
its like how 2x(3x5) and (2x3)x5 are both the same
Maslamah Mohamed Murshid
but you have to do the moves inthe order of writing. like in the above example, you should do it as R B' L no matter where the brackets are
Monthicha Kitnatthi
The 2*2*3 in the denominator comes from that if 7 corners are solved the last one is aways solved . Also if 11 egdes are solved the last one is always solved, and finally you cannot move just two edges without moving something else, thus if the first 10 edges are on the correct place (and all corners correct too), the last two edges will always be on the correct place. The nominator has only cornes and edges, so the 24 orientations of the cube is not included in this number, the middles are in one single fixed position in this calculation
I Agung Gede
Since we can always permutate the colors, shouldn't consider the group module these permuations?