# BASE CUBE RULES

In working with the cubes and tesseracts, I have made observations that were of interest to me at the time but may contribute little to the understanding of these figures. A lot of effort went into developing the Base Cube Compatibility Rules in my effort to enumerate all possible magic cubes. Only the simplest of these rules are presented. This turned out to be a dead end as it was much easier to just let the computer determine the possibilities for a next base cube based on a simple assumption. For both the cube generator and tesseract generator it is always assumed that it will be possible to find a next base cube that can be added to an intermediate grouping of base cubes until the magic cube is completed. I am certain that this is a good assumption for the cubes but it is not foolproof for the tesseract. Despite that, the assumption still provides a high likelihood of completing a tesseract successfully.

As the concept for a generalized approach to build cubes of any dimension has taken shape the need for a method to determine compatible base lines has arisen. The approach taken has much in common with that used to combine base figures to make magic figures. It is described under compatible base line rules.

## BASE CUBE COMPATIBILITY RULES

It is possible to derive rules to determine the base cubes that are incompatible. Rules for incompatible groupings of base cubes occur for groupings of 2, 4, 6, and 8 base cubes. There are no rules associated with combinations of 3, 5, 7, or 9 base cubes. I have no rationale for why this occurs. Stated a different way, there are no combinations of 3 base cubes that are incompatible that are not due to incompatible pairs within the group of three. There are combinations of 4 base cubes that are incompatible and are not due to incompatible pairs. There are no incompatibilities within groups of five base cubes that are not accountable as incompatibilities among the pairs within the group or among one of the sub groups of four.

### Compatibility Rules for Two Base Cubes

All 96 base cubes constructed using base lines have the addition properties of nasik magic cubes except that the magic constant is 4 and there are equal numbers of 0's and 1's. When two base cubes are added after multiplying one of them by 2, the resulting cube again has all the addition properties of nasik magic cubes except the magic constant is now 12 and there are equal numbers of 0's, 1's, 2's, and 3's. Most combinations of two base cubes will also have equal numbers of 0's, 1's, 2's, and 3's. This is even integral distribution and is used as a test for compatibility of the combined cubes. If there is an uneven distribution of the four numbers, then the two base cubes are incompatible. A nasik magic cube cannot be built with two incompatible base cubes no matter which other base cubes are chosen.

In trying to develop rules it became clear that the C base lines could be grouped into two families based on observed compatibilities. These families are C0, C3, C5, C6 and C1, C2, C4, C7. There are two rules for the combination of two base cubes. These can be observed readily in the base cube build mode of the cube generator.

1. A base cube can only be used once in a magic cube. This is a general rule for all base figures. It is the reason most of the possible order-4 base square combinations do not give valid magic squares. Of the 256 possible combinations of four base squares only 24 are combinations of the four different base squares. All others contain at least one duplication of a base square.
2. If two base cubes have the same dimensional order of A, B, and C codes, and both have the same B base line, then the C base lines must be from the same family as defined above. Selecting the first base cube in the base cube build mode will always dim the base cube selected as well as four other selections. These four selections will always have the same dimensional order as the base cube picked and their C's will be not be in the family of the selection.

### Compatibility Rules for Four Base Cubes

It is easy to write rules for the incompatibilities between two base cubes. A program was written to determine if there were any incompatible groups of three base cubes after excluding the incompatible pairs. None were found. The program was extended to evaluate groups of four base cubes again excluding incompatible pairs. The large number of incompatible groups could be organized into eight categories for which rules could be written.

The eight rules for the combination of four base cubes are more complex. To deal with this complexity the pattern of the base line grid in the base cube build mode must be explained. The dimensional arrangements of the base cubes are listed from top to bottom as CAB=0, CBA=1, BCA=2, ACB=3, ABC=4, and BAC=5. This order needs to be viewed as a repeating pattern. The grouping places the position of the C's in pairs of rows (0 and 1), columns (2 and 3) and pillars (4 and 5). The A's are similarly paired. The B pairs are offset by 3. The even numbered orders are in forward alphabetic order. To go from 0 to 2 to 4 to 0 etc. the last letter in the sequence is moved to the front. The odd numbered orders are in backward alphabetic order. Letters are again moved from back to front. Base lines with B0's are on the left half of the screen, B1's on the right.

The bitwise exclusive OR, XOR, function combinations of two C's in the same family are frequently useful. For this purpose only the C subscript is used, not the entire base line. Pairs of C's in the same families can only have XOR combinations of 0, 3, 5, or 6. When used below the XOR function only refers to combinations of the C base lines. When dimming is mentioned in the examples given below it is only referring to base cubes excluded by the rule being discussed. There will usually be other lights dimmed due to the rules for two base cubes.

1. Four base cubes cannot have the same dimensional order and the same B base lines. For example, select C0B0A0, C3B0A0, and C5B0A0. The C6B0A0 selection will dim since it would be the fourth base cube with the same dimensional order and the same B base lines if it were selectable.
2. Three base cubes have the same dimensional order and the first two have the same B base lines and the third has the other B base line. The fourth base cube cannot have the same B base line as the third and also have the XOR combination of its C base line and the base line of the third base cube equal the XOR combination of the C's for the first two base cubes. For example, select B0C0A0, B0C3A0, and B1C1A0. The B1C2A0 selection will dim. (XOR of 0 and 3 equals the XOR of 1 and 2) The other base cubes which dim are all due to incompatibility of two base cubes.
3. Base cube 1 and base cube 2 have the same dimensional order and the same B base lines. Base cube 3 has the same C dimensional position as the first two base cubes but the B and A0 dimensional positions are reversed. Base cube 4 cannot have the same dimensional order and B base line as base cube 3 and also have the XOR combination of its C base line and the base line of the third base cube equal the XOR combination of the C's for the first two base cubes. For example, select A0B0C0, A0B0C5 , and B1A0C3 . The B1A0C6 selection will dim. (XOR of 0 and 5 equals the XOR of 3 and 6)
4. Base cube 1 and base cube 2 have the same dimensional order and their B's are the same. The XOR of the C's in base cube 1 and base cube 2 equals 5. If the dimensional order of the first two base cubes is even (as described above) and the dimensional order of the third base cube is two higher (including wrap around if necessary) or if the dimensional order of the first two is odd and the third is two lower, then base cube 4 cannot have different B base lines and the same dimensional order as base cube 3 as well as have a C base line equal to or in a different family than the C base line in base cube 3. For example, select C0B0A0, C5B0A0 , and B1A0C0. The B0A0C0, B0A0C1, B0A0C2, B0A0C4, and B0A0C7 selections will dim. Less dramatically selecting C0B0A0, B1A0C0, and B0A0C0 will only dim C5B0A0 by the same rule. The other base cubes dimmed in this case can be ascribed to the two base cube rules.
5. This rule is very similar to rule 4 above. The only difference is that the dimensional orders for base cubes 3 and 4 have the same A0 dimensional positions as base cubes 1 and 2, but the B and C dimensional positions are switched. For example, select C7A0B0 , C2A0B0, and B0A0C2 . The B1A0C0, B1A0C2, B1A0C3, B1A0C5, and B1A0C6 selections will dim.
6. Base cube 1 and base cube 2 have the same dimensional order and their B's are different. Their C's are the same or they are in different families. Base cube 3 has the same B dimensional position as the first two base cubes but the C and A0 dimensional positions are reversed. Base cube 4 cannot have different B base lines and the same dimensional order as base cube 3 and also have a C base line equal to or in a different family than the C base line in base cube 3. For example, select B0C2A0 , B1C5A0, and B1A0C3. The B0A0C1, B0A0C2, B0A0C3, B0A0C4, and B0A0C7 selections will dim.
7. Similar to rule 6 above except the dimensional orders for base cubes 3 and 4 have the same A0 dimensional positions as base cubes 1 and 2, but the B and C dimensional positions are switched. In addition, the C base lines for base cubes 3 and 4 can be the same but they may not have an XOR combination equal to 5 or be in the same family. For example, select A0B1C6 , A0B0C2, and A0C4B0. The A0C1B0, A0C0B1, A0C1B1, A0C3B1, A0C5B1, and A0C6B1 selections will dim.
8. This rule can be written several ways and involves cubes in four different dimensional orders. One possible description follows. Base cube 1 is in forward alphabetic order. Base cubes 1 and 2 have the same C dimensional positions but different A0 and B dimensional positions. The dimensional order of the third base cube is two higher than the first (including wrap around if necessary). 1. Base cubes 1 and 2 have C's in different families, or 2. base cube 3 contains B0 and base cube 1 XOR base cube 2 equals 6, or 3. base cube 3 contains B1 and base cube 1 XOR base cube 2 equals 3. If the above in any combination is true, then either base cubes 1 and 4 cannot have the same B base line or the following arrangements do not occur. The arrangements are 1. base cubes 3 and 4 are in different families, or 2. base cube 2 contains B0 and base cube 1 XOR base cube 2 equals 6, or 3. base cube 2 contains B1 and base cube 1 XOR base cube 2 equals 3. For example, select B0C4A0 , A0C6B0, and A0B1C4. The B0A0C0, B0A0C2, B0A0C3, B0A0C5, and B0A0C6 selections will dim.

### Compatibility Rules for Six and Eight Base Cubes

Once the incompatible groups of four were determined, it was possible to write a program that would exclude them from evaluation. Groups of five base cubes were then evaluated to determine incompatibilities after excluding both pairs and groups of four that were incompatible. None were found. Many groups of incompatible groups of six base cubes were found. Many rules later it was determined that there were no incompatible groups of seven but many incompatible groups of eight. There are also no groups of nine that are incompatible. The latter was determined using an approach used by Keith.

Rules for combinations of six base cubes are often very complex involving interactions among all six base cubes. There are also over 30 of them. I have written them into code to exclude them in analysis of seven and higher base cube combinations, but they are difficult to describe. They will not be described here except for one. Select any column in the base code array and then select five of the base codes in that column. The last one will then be dimmed along with the members of the other family in that row.

I took a cursory look at incompatibilities of eight base cubes. The prospect of developing rules was daunting and it was not even attempted. It would be nice to find a mathematical approach that predicts which base cubes are compatible. The approach outlined above is too complex to be considered useful. The process used by the cube generator is fast and accurate, but it is a brute force approach, not a mathematical solution. There is probably an approach buried in the binary code of the cubes but I have yet to find it.

## COMPATIBLE BASE LINE RULES

I have not specifically looked for incompatibility rules for tesseracts and higher but the rules for two base cubes can be generalized to all dimensions. The first rule is obvious, a base n-dimensional figure cannot be used twice in the same n-dimensional magic figure. To generalize the second rule it is necessary to understand why there are two families of C base lines. If the bits in a C base line are individually doubled and a second C base line added then the resulting C base line combination will contain 0's, 1's, 2's, and 3's. If the C base lines are in the same family as described above then there will be two 0's, two 1's, two 2's and two 3's in the combination. There will be an uneven distribution in combinations not involving the same families. A three way combination of family members will always result in a base line combination with all numbers from 0 to 7 whereas with an interloper present it will not.

For tesseracts and higher the concept of discrete families does not exist but the concept of combining base lines still works. The D0 and D15 pair has four each of 0's, 1's, 2's, and 3's when combined as two times one line plus the second. The D0 and D15 base lines are also both compatible with other D base lines, but the list for each is different. This leads to a more generalized grouping of base lines as compatible groups.

The generalized version of the second rule for n-dimensional figures follows. If the dimensional order of all the base lines of two base n-dimensional figures are the same and all the base lines, except for the highest lettered base line, are the same, then the two base n-dimensional figures are compatible only if a combination of those two highest lettered base lines, as described above, results in even distribution of the 0's, 1's, 2's, and 3's.

After multiplying one line by four, a second by two and adding both to a third, a compatible group of three base lines is determined as above except that the resulting base line must have equal amounts of each of the numbers from 1-7. A compatible group of four base lines requires uniform integral distribution for the range 0-15, etc. For an n-dimensional figure a compatible group of n base lines must have n numbers.

It needs to be noted that the compatible groups rules are designed as an aid for generating n-dimensional magic figures with a relatively restricted pattern. It is possible to make many magic figures of the type described on this site that have no compatible base line groups.