Swammerdami
Squadron Leader
Imagine a rotatable square, with each corner colored black or white. (Make it a "lazy susan" with four places for a food dish atop a dining table if you wish.) Partial rotations are outlawed; the square can be rotated only by exactly 90°, 180°, 270°, or 360°.
Rather than making little square graphics, we'll just list the four corners in the order (north, east, south, west) or (n,e,s,w).
This structure is called a permutation group. The group has four elements; each element is a permutation that can be denoted by its cycle structure:
I've shown the cyclic structure of each permutation: we will get to these later. x1 denotes a singleton-cycle, and x1·x1·x1·x1 denotes four singletons. This can also be written x14, but sometimes the old-fashioned form is more convenient.
So how many ways are there to color the four corners black or white? 24 = 16 is the obvious answer but we don't want to count two colorings as distinct if they one can be changed to the other by one of our four permutations. Here are the different ways to color the corners, shown in (n,e,s,w) order:
So ... We've shown how many distinct ways there are to 2-color the 4 corners of a rotating square, but we did it with manual inspection. If we are asked how many ways to 3-color the 8 corners of a rotating cube, we would NOT want to try a manual enumeration! This thread will discuss how to do such an enumeration automatically. We'll start by working this toy example, the rotating square.
By summing the cycle structures of the four permutations, we first form the cyclic index polynomial:
. . . . Z = (x14 + x22 + 2·x41) / 4
(We divide by 4, the total number of elements in the permutation group. In a sense, Z is the average cycle structure! )
The 'xk' are formal variables; we can play with them in various ways! For example
. . . . xk = Bk + Wk
With these substitutions, and some routine algebraic manipulations Z = (x14 + x22 + 2·x41) / 4 becomes
. . . . Z = (BBBB + BWWW + 2·BBWW + WBBB + WWWW)
And indeed this is precisely the list of equivalence classes we found above. (BWBW has been replaced with BBWW, but the commutative law of multiplication is too nice to pass up!)
Let's try a simpler substitution for our variables, but now with 3 colors instead of 2.
. . . . xk = 3
Do the work; I think you'll find
. . . . Z = Z3 = (9 + 6 + 81) / 4 = 24
Let's double-check this result. Are there exactly 24 ways to color with the 3 colors B, W, G?
BBBB times 3 colors; GBBB times 6 ordered color-pairs; BBGG and BGBG each times 3 unordered color-pairs; BBRG and BBGR and BRBG each times 3 colors. Yes, that totals 24!
I'll write a little more on this topic if nobody beats me to it! I confess it may have been decades since I last felt an urgent need or desire to count equivalence classes this way, but I was reminded of this fun method by the thread on counting groups.
Rather than making little square graphics, we'll just list the four corners in the order (north, east, south, west) or (n,e,s,w).
This structure is called a permutation group. The group has four elements; each element is a permutation that can be denoted by its cycle structure:
- ((e)(s)(w)) — identity — x1·x1·x1·x1
- ((nesw)) — 90° clockwise rotation — x4
- ((ns)(ew)) — 180° rotation — x2·x2
- ((nwse)) — 90° counter-clockwise rotation — x4
I've shown the cyclic structure of each permutation: we will get to these later. x1 denotes a singleton-cycle, and x1·x1·x1·x1 denotes four singletons. This can also be written x14, but sometimes the old-fashioned form is more convenient.
So how many ways are there to color the four corners black or white? 24 = 16 is the obvious answer but we don't want to count two colorings as distinct if they one can be changed to the other by one of our four permutations. Here are the different ways to color the corners, shown in (n,e,s,w) order:
- BBBB
- WBBB : BWBB BBWB BBBW
- WWBB : BWWB BBWW WBBW
- BWBW: WBWB
- BWWW : WBWW WWBW WWWB
- WWWW
So ... We've shown how many distinct ways there are to 2-color the 4 corners of a rotating square, but we did it with manual inspection. If we are asked how many ways to 3-color the 8 corners of a rotating cube, we would NOT want to try a manual enumeration! This thread will discuss how to do such an enumeration automatically. We'll start by working this toy example, the rotating square.
By summing the cycle structures of the four permutations, we first form the cyclic index polynomial:
. . . . Z = (x14 + x22 + 2·x41) / 4
(We divide by 4, the total number of elements in the permutation group. In a sense, Z is the average cycle structure! )
The 'xk' are formal variables; we can play with them in various ways! For example
. . . . xk = Bk + Wk
With these substitutions, and some routine algebraic manipulations Z = (x14 + x22 + 2·x41) / 4 becomes
. . . . Z = (BBBB + BWWW + 2·BBWW + WBBB + WWWW)
And indeed this is precisely the list of equivalence classes we found above. (BWBW has been replaced with BBWW, but the commutative law of multiplication is too nice to pass up!)
Let's try a simpler substitution for our variables, but now with 3 colors instead of 2.
. . . . xk = 3
Do the work; I think you'll find
. . . . Z = Z3 = (9 + 6 + 81) / 4 = 24
Let's double-check this result. Are there exactly 24 ways to color with the 3 colors B, W, G?
BBBB times 3 colors; GBBB times 6 ordered color-pairs; BBGG and BGBG each times 3 unordered color-pairs; BBRG and BBGR and BRBG each times 3 colors. Yes, that totals 24!
I'll write a little more on this topic if nobody beats me to it! I confess it may have been decades since I last felt an urgent need or desire to count equivalence classes this way, but I was reminded of this fun method by the thread on counting groups.