From charlesreid1

 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Counting Permutations=
==Number of permutations of 3x3==
==Number of permutations of 3x3==


Line 6: Line 4:


* 3 possible rotations of 8 corners, 7 corners determine the 8th = <math>3^7</math>
* 3 possible rotations of 8 corners, 7 corners determine the 8th = <math>3^7</math>
* 2 possible rotations of 12 edges, 11 edges determine the 12th = <math>2^{12}</math>
* 2 possible rotations of 12 edges, but only 11 edges can be flipped independently; the orientation of the 12th edge is forced by the other 11 = <math>2^{11}</math>
* 8 different corner pieces to be distributed to 8 locations = <math>8!</math>
* 8 different corner pieces to be distributed to 8 locations = <math>8!</math>
* 12 different edge pieces to be distributed to 12 locations = <math>12!</math>
* 12 different edge pieces to be distributed to 12 locations = <math>12!</math>
* Half of the cube permutations (those requiring an odd permutation of edges/corners) cannot be reached without disassembling the cube = <math>\frac{1}{2}</math>


Furthermore, some of these possibilities are not possible. Only half of the parity cases can occur on the 3x3 cube, due to the fact that the centers are fixed, cutting the number of ways of distributing the corners and edges in half.
'''Correction (June 2026):''' The edge-orientation factor was previously listed as <math>2^{12}</math>. Only 11 of the 12 edges can be flipped independently; the final edge's orientation is determined by the parity of the other 11. This constraint is separate from the <math>\tfrac{1}{2}</math> factor already applied for the even-permutation requirement. Fixing this brings the count from ~86 quintillion down to the correct value of ~43 quintillion, matching the widely published number (e.g., Wikipedia). The same distinction (separating the independent-flip constraint from the even-permutation parity factor) also applies to the central edges of the 5×5 cube; see the correction note in that section below.


Total number of permutations of a 3x3 cube:
Total number of permutations of a 3x3 cube:


<math>
<math>
N = 3^{7} \times 2^{11} \times \dfrac{ 8! \times 12! }{ 2 } = 43,252,003,274,489,856,000 \sim 10^{19}
N = 3^{7} \times 8! \times 2^{11} \times 12! \times \frac{1}{2} = 43252003274489856000 \sim 4.32520 \times 10^{19}
</math>
</math>


or about 43 quintillion permutations.
or about 43 quintillion permutations.


==Number of permutations of 4x4==
==Number of permutations of 4×4==


On a 4x4 cube, we use the same technique as the 3x3, counting permutations due to both placement and orientation of each type of piece. Now each face has four corner pieces, four double edges for eight edge pieces, and four corners. Counting:
On a 4×4 cube (Rubik's Revenge), there are 8 corners, 24 edges, and 24 centers. Unlike the 3×3, the 4×4 has no fixed centers; all 24 orientations of the solved cube are equivalent.


Placing cubies:
'''Correction (June 2026):''' Three errors in the original 4×4 count have been fixed:


* Placement: 8 corners being placed, for total of <math>8!</math>
# '''Edge wing placement:''' The original count used <math>\left(\frac{24!}{12!}\right)^2</math>, treating the 12 left-wing and 12 right-wing edge pieces as each independently occupying 24 positions. However, after the 12 left wings are placed, only 12 slots remain for the right wings. All 24 edge pieces are distinguishable, so the correct factor is simply <math>24!</math> (all 24 edge pieces arranged in 24 positions). This overcounted by a factor of about 2.7 million.
* Placement: 12 left-double-edge pieces that can go in 24 possible double-edge locations, for a total of <math>\dfrac{24!}{12!}</math>
# '''Center indistinguishability:''' The original count used <math>24!</math> for centers, but the four center pieces of each color are visually identical. The correct factor is <math>24! / (4!)^6</math> (dividing by <math>24^6</math>, as there are <math>4! = 24</math> ways to arrange the four pieces of each of the 6 colors). This overcounted by a factor of <math>24^6 \approx 1.9 \times 10^8</math>.
* Placement: 12 right-double-edge pieces that can go in 24 possible double-edge locations, for a total of <math>\dfrac{24!}{12!}</math>
# '''Missing orientation reduction:''' Because the 4×4 has no fixed centers, all 24 orientations of the solved cube are equivalent. The original count did not divide by 24.
* Placement: 24 center squares, which can be arranged in any configuration, for a total of <math>24!</math>


Orienting cubies:
Counting each factor:


'''Corners:'''
* Placement: 8 corners being placed, for a total of <math>8!</math>
* Orientation: 3 orientations are possible on the 8 corners, placement of 7 determines the last, for total of <math>3^7</math>
* Orientation: 3 orientations are possible on the 8 corners, placement of 7 determines the last, for total of <math>3^7</math>
* Orientation: interestingly, the position of a double-edge piece uniquely determines its orientation. If a left-double-edge piece is placed in a left-double-edge position, it will be oriented "right-side up". If a left-double-edge piece is placed in a right-double-edge position, it will be oriented "upside-down". And likewise for right-double-edge positions. That means that if a double edge cubie is made part of a double edge, it has only two possible positions on that double edge. Therefore, there are 0 degrees of freedom due to orientation of double edge pieces.
* Orientation: Like the double-edge pieces, the center squares get 0 degrees of freedom due to orientation. Distributing 24 center squares among 24 center square positions uniquely determines the state of those center squares.


The grand total, then, is:
'''Edges:'''
* The 24 edge pieces are all distinguishable (each has a unique color pair, and corresponding edges are mirror images of each other). Any permutation is possible: <math>24!</math>
* Edge pieces cannot be flipped due to their internal shape; orientation is determined by the position occupied.
 
'''Centers:'''
* There are 24 center pieces. The four centers of each color are indistinguishable: <math>24! / (4!)^6</math>
 
'''Orientation factor:'''
* Because there are no fixed centers, all 24 orientations of the solved cube are equivalent. Divide by 24.
 
The total is:


<math>
<math>
T = 3^7 \times 8! \times \left( \dfrac{24!}{12!} \right)^2 = 147947189226886589978930309391974400000 \sim 10^{38}
T = \frac{8! \times 3^7 \times 24!^2}{24^7} \approx 7.40 \times 10^{45}
</math>
</math>


(TODO: fix above number, missing 24 factorial due to 4 x 6 = 24 center squares)
The full number is 7 401 196 841 564 901 869 874 093 974 498 574 336 000 000 000 (about 7.4 quattuordecillion).
 
This matches the published figure (e.g., Wikipedia's ''Rubik's Revenge'' article, and Singmaster's ''Cubic Circular'' Issues 3 & 4, 1982).


==Number of permutations of 5x5==
==Number of permutations of 5×5==


On a 5x5 cube, we apply the above techniques. We have fixed centers, so we don't consider those a type. The other cubie types are face cubies, corner cubies, and tredges, composed of tredge centers (the middle piece of the three pieces that make up a tredge) and tredge wings (the two end pieces of the three pieces that make up a tredge). There are 8 corner cubies, 9 face cubies on each face (and since 1 is fixed, actually 8 per face) for a total of 48 face cubies that can move, and 12 triple edges, for a total of 12 tredge centers, 12 tredge left wing pieces, and 12 tredge right wing pieces.
On a 5×5 cube (Professor's Cube), there are 8 corners, 12 central edges, 24 winged edges, and 54 centers (of which the 6 face-center pieces are fixed).


We run through enumeration of all the ways of placing each piece at a location on the cube, then multiply by the possible orientations, and reduce by the number of cube states that can't be reached.
'''Correction (June 2026):''' The original 5×5 count contained several errors, many of the same type as those fixed in the 4×4 section:


Placing cubies:
# '''Winged edge placement:''' The original count used <math>\left(\frac{24!}{12!}\right)^2</math> for the 12 left-wing and 12 right-wing tredge pieces, treating each set as independently occupying 24 positions. As with the 4×4, after the 12 left wings are placed, only 12 slots remain for the right wings. All 24 winged edge pieces are distinguishable (mirror-image pairs), so the correct factor is simply <math>24!</math>. This overcounted by a factor of about 2.7 million.
# '''Face cubies treated as all distinguishable:''' The original count used <math>48!</math> for the 48 movable face cubies. In reality, these consist of two sets of 24 center pieces (24 "edge centers" and 24 "corner centers"), each containing four visually identical pieces per color. The correct factor is <math>24!^2 / (4!)^{12} = 24!^2 / 24^{12}</math>.
# '''Central edge orientation:''' The original count used <math>2^{12}</math> for the 12 central edges. As with the 3×3 cube, only 11 central edges can be flipped independently (<math>2^{11}</math>). Additionally, the even-permutation constraint ties the central edges to the corners, requiring a division by 2. Combined: <math>2^{11} / 2 = 2^{10}</math>.


* Placement: 8 corners being placed, for a total of <math>8!</math>
Unlike the 4×4, the 5×5 has fixed centers (the six face-center pieces), so no division by 24 for orientation equivalence is needed.
* Placement: 48 face cubies being placed into 48 slots, any configuration, for a total of <math>48!</math>
 
* Placement: 12 tredge left wings that can go into 24 possible double-edge locations for a total of <math>\dfrac{24!}{12!}</math>
Counting each factor:
* Placement: 12 tredge right wings that can go into 24 possible double-edge locations for a total of <math>\dfrac{24!}{12!}</math>
* Placement: 12 tredge centers that can go into 12 possible tredge center locations for a total of <math>12!</math>


Orienting cubies:
'''Corners:'''
* Placement: <math>8!</math> (any permutation, including odd, is possible)
* Orientation: <math>3^7</math> (7 corners determine the orientation of the 8th)


* Orientation: 3 possible orientations of the 8 corners, but the placement of 7 of the corners determines the last, for a total of <math>3^7</math>
'''Edges:'''
* Orientation: the 48 face cubies have zero degrees of freedom because they have only one face and therefore no orientation.
* Winged edges: 24 distinguishable pieces in 24 positions → <math>24!</math>
* Orientation: the 24 triple edge wing cubies, like on the 4x4 cube, have no degrees of freedom due to orientation. This is because the position of the cubie and whether it is left or right wing piece determine its orientation.
** Winged edges cannot be flipped; orientation is determined by the position occupied.
* Orientation: the 12 triple edge (tredge) center cubies can be oriented in 2 ways each, <math>2^{12}</math> (note this is different from the case of 12 edges on the 3x3, where one single edge piece cannot be inverted by itself, so 11 edge cubies fix the state of the 12th cubie; on a 5x5, a single tredge center cubie can be inverted by itself.)
* Central edges: 12 distinguishable pieces → <math>12!</math>
** 11 can be flipped independently; the 12th is constrained by parity → <math>2^{11}</math>
** Even-permutation constraint with corners → <math>\div 2</math>
** Combined: <math>12! \times 2^{10}</math>


(Side note: how/why did we know to treat the tredge wings separately, instead of just tossing them all in a mix of 24 wing pieces that go into 24 locations? Because we know that in the solved state, solved tredges always consist of a left wing piece and a right wing piece.)
'''Centers:'''
* 6 fixed face-center pieces (no permutations)
* 24 edge-center pieces + 24 corner-center pieces, each set with 4 indistinguishable pieces per color → <math>24!^2 / (4!)^{12} = 24!^2 / 24^{12}</math>


This makes the grand total:
The total is:


<math>
<math>
T = 3^7 \times 8! \times 48! \times \left( \dfrac{24!}{12!} \right)^2 \times 12! \times 2^{12} = ...
T = \frac{8! \times 3^7 \times 12! \times 2^{10} \times 24!^3}{24^{12}} \approx 2.83 \times 10^{74}
</math>
</math>
The full number is 282 870 942 277 741 856 536 180 333 107 150 328 293 127 731 985 672 134 721 536 000 000 000 000 000 (about 283 trevigintillion on the short scale, or 283 duodecillion on the long scale).
This matches the published figure (e.g., Wikipedia's ''Professor's Cube'' article, and Singmaster's ''Cubic Circular'' Issues 3 & 4, 1982).


=Counting Cycles=
=Counting Cycles=

Latest revision as of 03:58, 20 June 2026

Number of permutations of 3x3

To count number of permutations of 3x3, count permutations due to both the placement and orientation of each type of piece (corners and edges; centers are fixed):

  • 3 possible rotations of 8 corners, 7 corners determine the 8th = $ 3^7 $
  • 2 possible rotations of 12 edges, but only 11 edges can be flipped independently; the orientation of the 12th edge is forced by the other 11 = $ 2^{11} $
  • 8 different corner pieces to be distributed to 8 locations = $ 8! $
  • 12 different edge pieces to be distributed to 12 locations = $ 12! $
  • Half of the cube permutations (those requiring an odd permutation of edges/corners) cannot be reached without disassembling the cube = $ \frac{1}{2} $

Correction (June 2026): The edge-orientation factor was previously listed as $ 2^{12} $. Only 11 of the 12 edges can be flipped independently; the final edge's orientation is determined by the parity of the other 11. This constraint is separate from the $ \tfrac{1}{2} $ factor already applied for the even-permutation requirement. Fixing this brings the count from ~86 quintillion down to the correct value of ~43 quintillion, matching the widely published number (e.g., Wikipedia). The same distinction (separating the independent-flip constraint from the even-permutation parity factor) also applies to the central edges of the 5×5 cube; see the correction note in that section below.

Total number of permutations of a 3x3 cube:

$ N = 3^{7} \times 8! \times 2^{11} \times 12! \times \frac{1}{2} = 43252003274489856000 \sim 4.32520 \times 10^{19} $

or about 43 quintillion permutations.

Number of permutations of 4×4

On a 4×4 cube (Rubik's Revenge), there are 8 corners, 24 edges, and 24 centers. Unlike the 3×3, the 4×4 has no fixed centers; all 24 orientations of the solved cube are equivalent.

Correction (June 2026): Three errors in the original 4×4 count have been fixed:

  1. Edge wing placement: The original count used $ \left(\frac{24!}{12!}\right)^2 $, treating the 12 left-wing and 12 right-wing edge pieces as each independently occupying 24 positions. However, after the 12 left wings are placed, only 12 slots remain for the right wings. All 24 edge pieces are distinguishable, so the correct factor is simply $ 24! $ (all 24 edge pieces arranged in 24 positions). This overcounted by a factor of about 2.7 million.
  2. Center indistinguishability: The original count used $ 24! $ for centers, but the four center pieces of each color are visually identical. The correct factor is $ 24! / (4!)^6 $ (dividing by $ 24^6 $, as there are $ 4! = 24 $ ways to arrange the four pieces of each of the 6 colors). This overcounted by a factor of $ 24^6 \approx 1.9 \times 10^8 $.
  3. Missing orientation reduction: Because the 4×4 has no fixed centers, all 24 orientations of the solved cube are equivalent. The original count did not divide by 24.

Counting each factor:

Corners:

  • Placement: 8 corners being placed, for a total of $ 8! $
  • Orientation: 3 orientations are possible on the 8 corners, placement of 7 determines the last, for total of $ 3^7 $

Edges:

  • The 24 edge pieces are all distinguishable (each has a unique color pair, and corresponding edges are mirror images of each other). Any permutation is possible: $ 24! $
  • Edge pieces cannot be flipped due to their internal shape; orientation is determined by the position occupied.

Centers:

  • There are 24 center pieces. The four centers of each color are indistinguishable: $ 24! / (4!)^6 $

Orientation factor:

  • Because there are no fixed centers, all 24 orientations of the solved cube are equivalent. Divide by 24.

The total is:

$ T = \frac{8! \times 3^7 \times 24!^2}{24^7} \approx 7.40 \times 10^{45} $

The full number is 7 401 196 841 564 901 869 874 093 974 498 574 336 000 000 000 (about 7.4 quattuordecillion).

This matches the published figure (e.g., Wikipedia's Rubik's Revenge article, and Singmaster's Cubic Circular Issues 3 & 4, 1982).

Number of permutations of 5×5

On a 5×5 cube (Professor's Cube), there are 8 corners, 12 central edges, 24 winged edges, and 54 centers (of which the 6 face-center pieces are fixed).

Correction (June 2026): The original 5×5 count contained several errors, many of the same type as those fixed in the 4×4 section:

  1. Winged edge placement: The original count used $ \left(\frac{24!}{12!}\right)^2 $ for the 12 left-wing and 12 right-wing tredge pieces, treating each set as independently occupying 24 positions. As with the 4×4, after the 12 left wings are placed, only 12 slots remain for the right wings. All 24 winged edge pieces are distinguishable (mirror-image pairs), so the correct factor is simply $ 24! $. This overcounted by a factor of about 2.7 million.
  2. Face cubies treated as all distinguishable: The original count used $ 48! $ for the 48 movable face cubies. In reality, these consist of two sets of 24 center pieces (24 "edge centers" and 24 "corner centers"), each containing four visually identical pieces per color. The correct factor is $ 24!^2 / (4!)^{12} = 24!^2 / 24^{12} $.
  3. Central edge orientation: The original count used $ 2^{12} $ for the 12 central edges. As with the 3×3 cube, only 11 central edges can be flipped independently ($ 2^{11} $). Additionally, the even-permutation constraint ties the central edges to the corners, requiring a division by 2. Combined: $ 2^{11} / 2 = 2^{10} $.

Unlike the 4×4, the 5×5 has fixed centers (the six face-center pieces), so no division by 24 for orientation equivalence is needed.

Counting each factor:

Corners:

  • Placement: $ 8! $ (any permutation, including odd, is possible)
  • Orientation: $ 3^7 $ (7 corners determine the orientation of the 8th)

Edges:

  • Winged edges: 24 distinguishable pieces in 24 positions → $ 24! $
    • Winged edges cannot be flipped; orientation is determined by the position occupied.
  • Central edges: 12 distinguishable pieces → $ 12! $
    • 11 can be flipped independently; the 12th is constrained by parity → $ 2^{11} $
    • Even-permutation constraint with corners → $ \div 2 $
    • Combined: $ 12! \times 2^{10} $

Centers:

  • 6 fixed face-center pieces (no permutations)
  • 24 edge-center pieces + 24 corner-center pieces, each set with 4 indistinguishable pieces per color → $ 24!^2 / (4!)^{12} = 24!^2 / 24^{12} $

The total is:

$ T = \frac{8! \times 3^7 \times 12! \times 2^{10} \times 24!^3}{24^{12}} \approx 2.83 \times 10^{74} $

The full number is 282 870 942 277 741 856 536 180 333 107 150 328 293 127 731 985 672 134 721 536 000 000 000 000 000 (about 283 trevigintillion on the short scale, or 283 duodecillion on the long scale).

This matches the published figure (e.g., Wikipedia's Professor's Cube article, and Singmaster's Cubic Circular Issues 3 & 4, 1982).

Counting Cycles

Length of Cycles on 3x3

One of the interesting features of a Rubik's Cube is that, starting from a solved cube, if any sequence of moves is repeated long enough on the cube, will eventually result in the cube returning to the solved state.

The simplest example is a single move (like U): after executing U four times, the cube is returned to the solved state.

It is a little less trivial with a sequence of moves like U'R'UR or LU, but these also eventually result in returning the cube to its solved state after 6 repetitions of the sequence U'R'UR or 105 repetitions of the LU sequence.


Flags