Gamers logo

Mathematics Behind a Rubik's Cube

How many combinations are there?

By Hardik JagtapPublished 2 years ago 6 min read
Like
Mathematics Behind a Rubik's Cube
Photo by Fletcher Pride on Unsplash

The Rubik's cube has always been considered a challenging puzzle which has wrestled with the minds of hundreds of thousands of people! The creator, Erno Rubik did not intend to make this a puzzle, but instead a piece of architecture to model and preach 3 dimensions to his students. This amazing invention lead to the now renowned sport, 'speed cubing'.

But why is this puzzle so interesting? How is mathematics involved? Just like most other puzzles, this cube revolves around patterns which can be deciphered using mathematics. This simple 56mm cube which can fit in your pocket has the ability to be conformed into billions and billions of different scrambles! But how?

Before we go any further, let's break down the fundamental structure of a Rubik's cube. There are 3 different types of pieces that make up this puzzle, a corner piece, an edge piece and a centre piece. A 3x3 (the standard 3x3x3 cube) has a total of 12 edge pieces and 8 corner pieces. As a side note, all cube shaped puzzles will have 8 corner pieces as a cube has 8 corners, however the amount of edge pieces of a 'n x n x n' puzzle will vary. To find the amount of edge pieces on a cube, simply use:

(number of edges on one layer x 3)

For example, one side of a 5x5 has 3 edge pieces. Since there are 4 sides on one face, there are 12 edge pieces on a cube. 12 x 3 = 36 meaning there are 36 edge pieces which is correct.

If you've ever used a Rubik's cube, then you would know that there are multiple ways you can turn it. Here is a chart that shows all the possible ways to turn a cube:

The key aspect of mathematics behind this puzzle is multiplication, more specifically factorials. Factorials are when you start with a number and continuously multiply all the numbers under it until you reach 1. The symbol for factorials is an exclamation mark, '!'. An example of a factorial is '10!'. 10! = 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1.

Now that we know the basics of what this cube is and how it functions, we can start looking into the mathematical concepts behind this puzzle. Firstly, let’s talk about where all the pieces can be placed. Since there are 12 different edge pieces, this means that there are 12 different slots for the edge pieces to be inserted in. We can represent this scenario as 12! We can apply a similar concept when dealing with corners. Since there are 8 corner pieces, there are 8 corner locations for these pieces to go. Therefore, we can do 8! Since these pieces can be changed relative to another, we need to multiply both these numbers:

Is this all? No, we have only accounted for the location of these pieces. As mentioned before, an edge piece has 2 different sides and a corner piece has 3 different sides. Therefore, these different sides give different scrambles so we need to include these variations. Let’s break down the possible variations for edge pieces.

Since there are 12 edge pieces with 2 sides, this means that each piece can have a total of 2 states. We can represent this information using 2^12. Multiplying this to our main equation will give us a total of:

Now, we can use this same idea for all the variations for corner pieces. Since there are 8 corner pieces with 3 different sides, there will be 3 variations for each corner piece. We can represent this equation by:

And we are done! We now have all possible scrambles on a Rubik’s cube! Right? No, this quantity is assuming that the cube is unsolvable. An unsolvable cube would something like this:

No matter what you do, unless you flip the corner, you can not solve this cube using any moves or algorithms. So, how do we find the amount of legal scrambles?

We can firstly start by eliminating the amount of illegal scrambles. Let’s break down how the positions of corners work. As displayed in the image above, a single corner can not be twisted by itself as this is unsolvable. As a result, we need to eliminate on of the possibilities. This can be done by instead of having 3^8, it is 3^7 x 1. This ‘1’ means that there is only one possible orientation this corner can be in, which is solved. The same concept can be used when referring to the orientation of edges. Since only one edge can not be flipped, one of the edge orientations will have to change. Instead of being 2^12, it will be 2^11 x 1. Now, we have one more change we have to make before we receive our answer. You can not have 2 corners in the wrong spot as this is unsolvable. Just like we did before, we need to eliminate these 2 positions. This can be done like so:

8 x 7 x 6 x 5 x 4 x 3 x 1 x 1

The last two ones represent how these two corner pieces can only be located at two certain spots. Any other spot will be wrong. So, what is our calculation which will give our answer?

There are a total of 519024039293878272000 illegal scrambles and 43252003274489856000 legal scrambles. Although this is fairly simple, we can not apply this rule to every single cube. This is because some cubes do not have centres such as the 4x4.

A formula has been created by a man named Chris Hardwick which find the amount of permutations for any n x n x n cube. This formula is as follows:

3 is subbed in instead of ‘n’. This formula gives all the possible permutations following legal scrambles. The term ‘mod’ is the remainder found after dividing by 2. For example, if the equation is 3 mod 2, it would be the remainder of 3/2 which 1. The L brackets in the equation are called floor functions. They round to the nearest lower number. Using this formula, we can acquire the number of legal permutations for a 3x3 which is:

Now that we have this equation, let’s see the affects of this on a much larger cube. The largest cube created and crowned the world record is the 33 x 33 x 33 cube. If we put this into our function in Mathematica, we have… a really big number.

References:

("How do I calculate the combinations of a Rubik's Cube?", 2021)

Your Bibliography: (2021). Retrieved 5 November 2021, from http://speedcubing.com/chris/cubecombonumber.jpg

("Download free STL file Rubik cube • 3D print design ・ Cults", 2021)

("How to Solve a 4x4 Cube- The Rubik's Revenge", 2021)

("Mathematics of the Rubik's Cube - Permutation Group", 2021)

https://www.mathsisfun.com/definitions/modulo-operation.html#:~:text=The%20modulo%20(or%20%22modulus%22,with%20a%20remainder%20of%202

https://study.com/academy/lesson/brackets-in-math-types-examples-quiz.html

("Mod—Wolfram Language Documentation", 2021)

https://www.mathworks.com/matlabcentral/answers/445290-what-does-the-l-shaped-bracket-mean

("Floor (|_..._|)—Wolfram Language Documentation", 2021)

https://www.youtube.com/watch?v=1A4f91yMVhA&t=77s

("33x33x33 Rubik's Cube - World Record", 2021)

("Character Counter / Letter Count / Characters Calculator", 2021)

("YongJun (YJ) MGC 5x5 Magnetic Speed Cube", 2021)

("Ernó Rubik: 'The Cube gives me hope people can solve their problems and survive'", 2021)

(Magazine, 2021)

I found the HARDEST Rubik's Cube Scramble - YouTube

vintage
Like

About the Creator

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2024 Creatd, Inc. All Rights Reserved.