Calculating the Number of Permutations of the Rubik’s Cube

Chaitanya Animesh
3 min readDec 12, 2018

--

Ever thought of the number of possible permutations a 3x3x3 Rubik’s Cube can have? Let’s find out!

I am fascinated with the Rubik’s Cube and thought that it would be fun to calculate the number of permutations of the Rubik’s Cube. The original classic 3x3x3 Rubik’s Cube has 6 faces, each having a different color namely red, orange, blue, green, yellow and white. We will be calculating the number of possible permutations of the 3x3x3 Rubik’s Cube obtainable by legal moves. A legal move means turning any one of the six faces by 90 degrees or its multiples.

There are 6 centers, each of a distinct color, which are fixed. Then there are 12 edges and 8 corners, which are movable and hence, the cause of the permutations of the Rubik’s Cube. So, we need to focus on and analyze the corners and the edges in order to find out the number of permutations.

Side view of a Classical 3x3x3 Rubik’s Cube and it’s Color Schema

Let us first start with the corners. As mentioned above, there are 8 corners in a Rubik’s Cube. So, the number of ways to arrange these 8 corners is 8! i.e. 40,320. Now, a corner is composed of 3 different colors. So, what is the number of possible configurations of a corner? If you are thinking 3!, then hold on. Actually, for a corner, the position of each color is fixed relative to the other colors. Let me delineate. Consider the corner in the above photo with Green-White-Red configuration. This corner will never have a Green-Red-White configuration (in some permutation of the cube) meaning Green remains at its place while Red and White colors exchange their positions. So, each corner has actually 3 different possible configurations (White-Red-Green and Red-Green-White being the other two configurations for our corner). And, the next part where we need to pay attention is that we can only orient 7 corners independently. The orientation of the eighth corner will get fixed automatically depending on the orientations of the remaining seven corners. Hence, the number of permutations arising from the 8 corners is- 8! x 3⁷.

Now let us move to the edges. There are 12 edges in a Rubik’s Cube. So, the number of ways to arrange these 12 edges is 12! i.e. 479001600. Each edge is made of two different colors and hence, can have two different configurations. And again, similar to the case of corners, we can only orient 11 of the 12 edges independently. The twelfth edge will get oriented automatically. Hence, the number of permutations arising from the 12 edges is- 12! x 2¹¹.

Are we finished? Actually no. We need to consider one last thing which may or may not seem conspicuous. When we talk about arranging the 8 corners or the 12 edges, we need to take into account an important thing and that is we cannot swap two corners or two edges in isolation without affecting the neighboring pieces. We will never have a cube in a solved state with except only two of its edges or corners swapped. But we have actually counted these impossible states as well. So, we will actually have only half of the permutations we have calculated.

Therefore, the total number of possible permutations of the Rubik’s cube is:

(1/2) * (8! x 3⁷) * (12! x 2¹¹) = 43,252,003,274,489,856,000.

43 quintillion 252 quadrillion 3 trillion 274 billion 489 million 856 thousand! That’s a mind-boggling number!

And before ending, let me share an interesting fact with all of you. Given any one of the 43,252,003,274,489,856,000 states, it is possible to return to the solved state in 20 moves or less! That’s why 20 is called God’s Number!

--

--

Chaitanya Animesh

MS CS @ UCSD | JP Morgan Chase & Co | IIT (BHU), Varanasi | Cricket Liver | Twitter- https://twitter.com/chaitanyanimesh