Calculating the Permutations of 4D Magic Cubes

by Eric Balandraud

This paper details the process of coounting the exact number of unique positions that 4D magic cubes of varying edge lengths are reachable from their pristine positions.

There are four types of hyper-cubies: those with 1, 2, 3, or 4 hyper-stickers. We'll refer them here as 1-colored, 2-colored, etc.


For the 3x3x3x3, we can count
  • 16 4-colored,
  • 32 3-colored, and
  • 24 2-colored
  • The 8 1-colored elements are immobile and will allow us to locate the position of every other element.

    There are two steps to this process. The first one consists of counting the possible positions the cube can be constructed with regardless of positions that are unreachable from the pristine cube. The second step factors out the unreachable positions. Not all the permutations of the 24 2-colored and the 32 3-colored are possible. Only the permutations that have the same parity on the 2-colored and the 3-colored. To check that, it is enough to consider the basic moves of one face. So the number of positions reachable by just the 2-colored pieces is All the even permutations of the 4-colored, and the odd ones are impossible, It can be checked on the basic moves, so we count The second step, now that the maximum number of positions are determined, notice that the 2-colored pieces can have two positions on one place, but the position of the last one is fully determined by the positions of the 23 others, giving Every 3-colored can have 3! positions on one place, except for the last one, which can only have 3 positions, giving Finally, the 4-colored, can have 4!/2 positions on one place, except for the last one, which can have only 4 position giving All these counts, are independant of each other so the positions of the 3x3x3x3 is the product of all thiese numbers. Therefore the number of reachable positions for the 3x3x3x3 is exactly whose decimal expansion is or aproximately 10^120.


    The 4x4x4x4 has:
  • 16 4-colored,
  • 64 3-colored,
  • 96 2-colored, and
  • 64 1-colored
  • One additional subtility with the 4x4x4x4 is that there aren't any pieces at the 2D face centers from which to orient our calculations. we therefore need to fix an element to locate all the others, let's fix a 4-colored (it can also be done with a 3-colored).

    The even permutations of the 4 colored are possible, so And they can have 4!/2 positions but the last, only 4, so Note that we have fix one of them, so it differs from the counts of the 3x3x3x3.

    This time, all the permutations are even for the 3-colored, so (Note that on the 4x4x4, the 2-colored accepts odd permitations)

    The 3-colored have 3 positions, on a place, and the last is fully determined by the 63 preceeding, so Note that this differs from the 3x3x3x3, and that two 3-colored that have identical colors can't be in the same position and orientation.

    The 2-colored accept only even permutations, but as they come in indistinguisable pairs, we count only the visually
    different positions, giving or 2^95, because the position of the last is determined by the others.

    The same problem appears for the visually different positions of the 1-colored, so giving a grand total of whose decimal expansion is or aproximately 10^334

    You can verify this by fixing one of the 3-colored at the beginnig yielding a different formula, but the same result.


    The 5x5x5x5 has there different families of 1-colored, 2-colored and 3-colored: for a grand total of whose decimal expansion is Over 10^700. Quite a number!

    Return to MagicCube 4D
    Return to the Superliminal home page