MAGIC CUBE CONCEPTS

Higher dimensional magic figures can be built using obvious extensions of the properties of the order-4 pan-magic squares. There are additional factors to consider as each new dimension is added. Some are related to the new dimensions while others are related to the increasing size of the base lines and resulting exponential increase in size of the figure.

Cube base lines

As described in Basic Concepts the cube is constructed by combining three 8-bit base lines, one for each dimension. In one dimension is the A0 base line which like the A0 base line in the square has alternating 0's and 1's. This is the 8-bit equivalent of 85. It can also be described as a repetition of the A0 base line from the square to fill the 8 bits. In the second dimension is one of the B base lines converted to an 8-bit code equivalent of 51 or 102. Again equivalent to repeating the two square B base lines.

The third dimension contains one of the new C base lines: 15, 30, 45, 60, 75, 90, 105, or 120 converted to an 8-bit number. These codes are easily generated by entering the 4-bit equivalents of 0-7 in the first four bits of the 8-bit base lines. The inverse of the first four bits are entered into the last four bits of the base line.

Weaving cube base lines

With the A0 base line in the first dimension, two possible B base lines in the second dimension, and eight possible C base lines in the third dimension, 16 possible base cubes are described. There is no reason that the A0 base line be confined to the first dimension, etc. In fact a valid cube could not be made if that were so. There are six, 3!, possible dimensional arrangements of the A, B, and C base lines into first second and third dimensions, resulting in 16x6 or 96 possible base cubes.

A three way exclusive OR combines the base lines into a base cube. This is done be combining two of the base lines and then combining the result with the third. The end result is that cells where three 0's or two 1's are combined become 0's. Cells where one 1 or three 1's are combined become 1's. This can also be looked as mod 2 of the addition of the three codes at that position. All rows, columns, pillars, 2-D diagonals and 2-D broken diagonals, 3-D diagonals and broken diagonals, etc add to 4 for all the resulting base cubes. Because of the initial 0 in all of the base lines used for the construction of the base cube there will always be a zero at the 0, 0, 0 position of the base cube.

As discussed in the weaving base lines section of Basic Construction any square cross section of the base cubes made by the prescribed approach will have the appearance of simple woven cloth. This is not true of the base cubes of other perfect magic cubes. Although difficult to envision the cubes can be considered to be woven in three dimensions resulting in a rectangular prism pattern of 0's and 1's.

Proof of base cube addition properties

The addition properties are inherent in the selection of the base lines. Since all base lines have four 1's and all rows, columns, and pillars of the base cube are either a base line or its inverse then all rows, columns and pillars must add to 4. For the 2-D diagonals if one of the base lines of the square is a C base line then one half of the diagonal is the inverse of the other since the second half of the C base line is the inverse of the first half and the other base line, either A0 or B type, has halves that are identical. This always results in four 1's in the diagonal or broken diagonal. If the square has A0 and B base lines then each quarter of the diagonal is the inverse of the adjacent quarter, again resulting in four 1's in the whole diagonal. The 3-D diagonals must incorporate a C base line, therefore one half of the diagonal is the inverse of the other half.

Other addition patterns also have their origins in the base cubes. For instance the corners of the 2x2x2 base cube will always contain four 1's. If one picks a 2x2 square in the dimensions defined by the B and C base lines, then the adjacent 2x2 square in the direction of the A0 code will be its inverse. For the corners of a 3x3x3 cube one starts with the 3x3 square in the dimensions defined by the A0 and C base lines. The first and third bits of the B base lines are inverses so that the 3x3 square shifted by 2 in the B base lines direction will be an inverse. Thus the corners of the 3x3x3 must always have four 1's. The corners of the 4x4x4 cubes again rely on shifting in the A0 direction, and the corners of the 5x5x5 cubes are inverted in the C direction.

Combining base cubes to make order-8 pan-2,3-agonal magic cubes

There are 512 numbers in the 8x8x8 figure. This is 29. To build the magic cube in the prescribed manner will therefore require combining nine base cubes. With 96 base cubes there should be 969 possible magic cubes with a zero at position 0, 0, 0. With the caveat that a base cube cannot be used twice this value is reduced somewhat to 96!/87!. There are, however, only 6,436,518,100,992,000 by actual count. This is only about 0.93% of the potential cubes. The other potential cubes do not generate appropriate magic cubes because not all numbers from 0-511 are present and some numbers are repeated, i.e. the cubes have uneven integral distribution.

All the base cubes have uniform integral distribution, which for base cubes means 256 zero's and 256 one's. For the squares all combinations of the four different base squares also have uniform integral distribution, i.e. all the resulting magic squares have one of every number from 0 to 15. For the cube, however, not all combinations of different base cubes give uniform integral distribution. Some pairs of base cubes will not give uniform integral distribution after making a 2 X base cube I plus base cube II calculation. That is there will not be 128 of all of the numbers 0-3 in the resulting intermediate magic cube. The incompatibility can occur at any stage of the building process. Only ~5% of pairs of base cubes are incompatible but ~99% of 9 base cube combinations are. Additional information on incompatible pairs can be found in Base Cube Rules.

If uniform integral distribution is lost after any base cube addition it cannot be regained by adding any other base cube. The resulting cube will be missing some numbers and will repeat others. The cube will, however, add to the appropriate magic constant in all directions because the addition and multiplication rules require it. What this means is that any combination of nine base cubes will have all the appropriate addition properties of a perfect magic cube. The combination may not, however, be a perfect magic cube because all the numbers from 0-511 are not present and some are present in more than one position. Validation of magic cubes made in the above way by checking the additions does not work. If valid base cubes are used, the only verification needed is to confirm uniform integral distribution, i.e. confirm that all numbers from 0 to 511 are present somewhere in the cube.

Master base line exclusive OR construction

It must be pointed out that there are valid base cubes that cannot be generated using base lines as described above. There are four 8 by 8 by 8 perfect magic cubes described on the home page and in Barnard's Cube that use alternate base cubes. This is not how they were originally constructed but they can be. These other cubes have all the same properties as the perfect magic cubes discussed here except for the master base lines.

There are more that 7.5 E+20 perfect magic cubes that can be made using alternate base cubes. These alternate base cubes are discussed in Other Perfect Cubes. It is also be possible to combine the alternate base cubes with the 96 derived using base lines to make still more perfect magic cubes. A quick way to determine if a magic cube is made using base lines is explained in Basic Construction. Translate the zero to a corner if it is not there. Then pick any number from the row, the column and the pillar of the lines starting with zero. Convert all three numbers to binary and do an exclusive OR on each of the eight bit's triplets. Convert the resulting eight bit number back to base ten and compare it to the number at the juncture of the three original numbers. If all numbers in the cubes are the same the cube was made using only base lines.

Multiplier shuffling

The nine base cubes of a valid perfect magic cube can be rearranged in any order. The concept behind this was described in the identically named section of Basic Concepts. Rearrangement of the base cubes of a valid magic cube will always yield a new valid magic cube. Every valid perfect magic cube is thus one of 9! easily determined different valid perfect magic cubes.

Plane Exchanging

Valid Plane Orders After Exchanges
01234567
01274563
01634527
01674523
05234167
05274163
05634127
05674123

In a perfect order-8 magic cube, any pair of planes that are spaced four apart may be exchanged to generate a different order-8 pan-2,3-agonal magic cube. When planes spaced four apart are exchanged in the base line cubes, The A and the B type base lines in the resulting cube are unchanged. The C type base lines are changed to another C type base line. Since there must be at least one C type base line in every dimension, exchange of planes will always change the cube. From any starting cube 8 different cubes can be generated with various combinations of this type of plane exchange in one planar direction. There are thus 512 different combinations when all three dimensions are considered.

There are also double exchanges that can be done to create different cubes. To do a double exchange, first split the cube in half perpendicular to an axis. Then in one half, perpendicular to that same axis, exchange two planes that are spaced two apart. In the other half exchange the corresponding two planes. This has the effect of changing both the C type base lines and the B type base lines to different C and B base lines, but there are still A, B, and C type base lines in every base cube so the resulting cube is still valid.

There are four different ways that a double exchange can be done in any one planar direction, but when combined with the single exchange described above this leads to only eight additional cube orders in one planar direction. However, these eight new cubes are actually the same as the first eight but in the reversed order. Since this is just a different aspect of the same cube they cannot be considered to be new cubes.

Quadruple exchanges are also possible. This is done by dividing the cube in quarters perpendicualr to one axis. The planes in each quarter are then exchanged. Doing this changes all the base lines to different base lines of the same type but it does not create cubes that are different than those created using exchanges of planes spaced four apart.

Shorthand descriptions of magic cubes

A shorthand method of identifying the many perfect magic cubes was introduced in the Basic Concepts section under "Base lines". For the magic cube the shorthand code would consist of nine groups of three base lines. For instance the code would be (C0B1A0, C0A0B0, B0C7A0, B0A0C0, A0C7B0, A0B1C5, C5A0B0, A0C2B0, B0C1A0) for the cube described in The Old Farmers Almanac. Another shorthand method would be to list just the numbers found in the master base lines since they can be used to generate the cube using an exclusive OR function as described above. For the cube above this would be; row: 0, 30, 97, 127, 388, 410, 485, 507 column: 0, 508, 346, 245, 83, 431, 265, 166 pillar: 0, 329, 150, 479, 40, 353, 190, 503.

The cube that appears in The Old Farmers Almanac is not identical to the cube described above. One must be added to all the values in the above cube so that the values are in the range 1-512 rather than 0-511.

A complication to a simple description is that there are 48 different aspects for the cube that appear visually different but are just simple manipulations of the cube. Benson and Jacoby5 suggest a possible way to group these 48 aspects under a single description. They suggest translating the one (or zero if used in range) to the lower left corner of the first square of the cube to correspond with Cartesian coordinates. I describe a way to group the aspects as well as the 9! different cubes obtained by multiplier shuffling in Magic Cube Guide as unique cubes. Neither of these approaches will easily describe the OFA cube as it is not easy to describe a path from the master cube to the specific example. Benson and Jacoby suggest that all such cubes be shown in their format and not in any of the other 48*512 visually different ways. My approach just offers a way to compare cubes from disparate sources and is not useable for a non base line cube.

Base cube magic constant

There are many sets of 8 numbers from the range of 0-511 that add to 2044. Most of these sets are just random groupings within the cube. Some of the patterns described by the eight number sets when translated throughout the cube always add to 2044. There are thousands of such patterns in the magic cubes that add to 2044 in all the possible cubes. Some patterns are very simple, such as the rows, columns, and pillars. Others are highly symmetrical such as the corners of various sized cubes. And many patterns are not simply described. Magic Constant Groups describes these groups. Some of the groups are also demonstrated in the magic constant checker in the cube generator.