chikaku

且听风吟

永远是深夜有多好。
github
email

Calculation of the number of states of a 3x3 Rubik's Cube

A few days ago, when discussing the "maximum number of steps required to solve a 3x3 Rubik's Cube in any state" (God's Number) with my colleagues during a meal, we extended the discussion to the calculation of the total number of possible states for a 3x3 Rubik's Cube. At that time, our consideration was quite rough, so after returning, I did some research and would like to record it here.

Calculation of the Number of States for a 3x3 Rubik's Cube#

image image

This is a regular 3x3 Rubik's Cube in its three-dimensional and unfolded forms. There are a total of six faces, namely six center pieces (which cannot be rotated and do not need to be considered for their states), eight corner pieces (each with three colored faces), and twelve edge pieces (each with two colored faces).

Number of Corner Piece States#

There are eight positions for corner pieces, so the number of position states is 8!8!. Each corner piece has three colored faces, but the number of color states is not 3!3!. Considering the corner piece at the bottom left of the red face in the unfolded form, the clockwise relative order of the three colored faces is fixed, i.e. [green-red-yellow]. It is impossible to have the following situation through any rotation: [yellow-red-green] (even if the cube is disassembled and reassembled). Therefore, each corner piece only has three possible color states: ABC, CAB, BCA.

There is one more thing to consider, which is that the states of corner pieces can affect each other. Once the positions and colors of seven corner pieces are fixed, the color of the eighth corner piece is determined. In other words, it is not possible to modify only the color state of the eighth corner piece without modifying the states of the other seven corner pieces. Therefore, the number of color states for the last corner piece is 1. The total number of corner piece states is (83)(73)...(23)(11)=8!37(8*3) * (7*3) ... (2*3) * (1*1) = 8! * 3_{}^{7}.

Number of Edge Piece States#

The analysis method for edge pieces is similar. There are twelve positions in total, so the number of position states is 12!12!. There are only two color states, AB and BA, and the color of the last edge piece is fixed. Therefore, the total number of edge piece states is 12!21112! * 2_{}^{11}.

Total Number of States#

Now that we have the number of corner piece states and edge piece states, directly multiplying them will result in some impossible states.

First, let's clarify one thing: It is not possible to exchange the positions of only two corner pieces (or two edge pieces) without modifying the states of other pieces, because when twisting the cube, each piece is rotated according to its face, which affects the surrounding pieces.

Assuming we correctly solve the cube to a valid state s1=...AB...s1 = ...AB..., where ABAB represents the position state of two corner pieces (or two edge pieces), it is obviously impossible to have the situation s1flip=...BA...s1_{flip} = ...BA... where only the position of ABAB is flipped without modifying the states of other pieces. However, among all the states obtained by directly multiplying, there is actually a set that includes each valid state and its flipped state:

{s1,s2,..,sn,s1flip,s2flip,..,snflip}\left \{ s1, s2, .., sn, s1_{flip}, s2_{flip}, .., sn_{flip} \right \}

Therefore, when calculating the total number of states, we need to divide it by 2. The final result is:

1/28!3712!211=432520032744898560001/2 * 8! * 3_{}^{7} * 12! * 2_{}^{11} = 43252003274489856000.

Reference: calculating-the-number-of-permutations-of-the-rubiks-cube

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.