The Mathematics Behind a Rubik’s Cube: Permutations and Combinations
- bpcnewsletter
- Dec 19, 2018
- 3 min read
By Jesse Ding
When looking at a Rubik’s Cube, what do you think of it? Was it created in order to torment people? How do people solve it? Or do you wonder just how many ways you can arrange the puzzle? It’s not an easy concept to grasp. Simply put, the Rubik’s Cube is a puzzle you can hold in your hands, but has so many permutations that you cannot fit them into your mind.
You might have caught that word I said in that last paragraph: permutation. To explain; let’s go with the basics. Let’s say we have 3 marbles, and if put into 3 empty slots, how many ways can we arrange these marbles? For the first slot, we have three choices for the potential marble. The second slot has two possible marbles. The final slot only has one possible marble left. This results in the expression 3 x 2 x 1, which equals 6 ways to arrange these three marbles.
Now, you may be asking, why is it called permutation and not combination? We throw around the term “Combination” all around, but sometimes it’s used in a completely wrong context. For example, we say “Combination Lock”, let’s say the password was 123, saying that the lock is a “Combination Lock”, it implies that if we put in 213, 321 and any other permutation of the numbers 1, 2 and 3 would allow us to unlock the lock. In reality, we should refer to it as a “Permutation Lock”, as a very certain order of the numbers can unlock the lock. So the difference is that when talking about permutation, the order in which you order a certain set of elements is important, whereas combinations don’t care how the set of elements is ordered.
Now, to up the level, how many permutations and combinations of a hand of 5 cards can you have? Excluding jokers, there are 52 cards in a deck, thus, there are 52 cards that are possible for the first slot of the 5 cards, 51 for the second, 50 for the third, 49 for the fourth and 48 for the fifth. This results in the expression of 52 x 51 x 50 x 49 x 48, which is equal to 311,875,200. That’s how many permutations there are. To calculate the number of combinations, we must erase all of the permutations in which the set of 5 contain the same cards, but are arranged in different orders. In order to do this, we factorialize the number of slots––the mathematical operation in which we multiply the number being used by increments of whole numbers until 1. For example, n factorial is equal to n(n-1)(n-2)... until the last number is 1. This is written in the notation of using an exclamation mark. Thus, for this example, we have 5 factorial (5!) or 5 x 4 x 3 x 2 x 1, which is equal to 120. Then, we divide the number of permutations by 120 and we receive the number of 2,598,960: this represents the number of combinations a 5 card hand we can have.📷
To finally tackle the question, we need to understand the laws of the Rubik’s Cube. The images on the right demonstrate impossible states of the Rubik’s Cube: meaning that it’s impossible to get to these states by doing regular turns on the Rubik’s cube. First, there are 8 corners and 12 edges of a Rubik’s cube, since there are 2 possible orientations for the edges, we write 2^12, next, there are 3 orientations of a corner, and since there are 8 corners, it would be 3^8. So now, so far we have the expression 2^12 x 3^8. Next, we need to calculate all of the possible locations of the pieces. Since there are 8 edges and 8 slot positions, it would be 8! The same thing for the edges, there are 12 of them and 12 positions, thus it would be 12!. Our expression will now look like this, 2^12 x 3^8 x 12! x 8! This number is astronomically large, 5.19x10^20. However, this is the number of states the Rubik’s Cube can have when ignoring the rules above. In order to correct this, we first need to find how many of these impossible states there are: for simplicity, I’ll just give the answer; it’s 12. Now, we take the expression we just left off of and divide it by 12. This results in the final number of 4.3252x10^19. This is the total number of permutations that are possible on a Rubik’s Cube. Cool right?
Comments