15.4: Pólya's Theorem
Before getting to the full version of Pólya's formula, we must develop a generating function as promised at the beginning of the chapter. To do this, we will return to our example of Section 15.1.
15.4.1 The cycle index
Unlike the generating functions we encountered in Chapter 8, the generating functions we will develop in this chapter will have more than one variable. We begin by associating a monomial with each element of the permutation group involved. In this case, it is \(D_8\), the dihedral group of the square. To determine the monomial associated to a permutation, we need to write the permutation in cycle notation and then determine the monomial based on the number of cycles of each length. Specifically, if \(\pi\) is a permutation of \([n]\) with \(j_k\) cycles of length \(k\) for \(1≤k≤n\), then the monomial associated to \(\pi\) is \(x_1^{j_1}x_2^{j_2} \cdot \cdot \cdot x_n^{j_n}\). Note that \(j_1+2j_2+3j_3+ \cdot \cdot \cdot +nj_n=n\). For example, the permutation \(r_1=(1234)\) is associated with the monomial \(x_4^1\) since it consists of a single cycle of length 4. The permutation \(r_2=(13)(24)\) has two cycles of length 2, and thus its monomial is \(x_2^2\). For \(p=(14)(2)(3)\), we have two 1-cycles and one 2-cycle, yielding the monomial \(x_1^2x_2^1\). In Figure 15.10 , we show all eight permutations in \(D_8\) along with their associated monomials.
Figure 15.10. Monomials arising from the dihedral group of the square
Now let's see how the number of 2-colorings of the square fixed by a permutation can be determined from its cycle structure and associated monomial. If \(\pi(i)=j\), then we know that for \(\pi\) to fix a coloring \(C\), vertices \(i\) and \(j\) must be colored the same in \(C\). Thus, the second vertex in a cycle must have the same color as the first. But then the third vertex must have the same color as the second, which is the same color as the first. In fact, all vertices appearing in a cycle of \(\pi\) must have the same color in \(C\) if π fixes \(C!\) Since we are coloring with the two colors white and gold, we can choose to color the points of each cycle uniformly white or gold. For example, for the permutation \(v=(12)(34)\) to fix a coloring of the square, vertices 1 and 2 must be colored the same color (2 choices) and vertices 3 and 4 must be colored the same color (2 choices). Thus, there are \(2 \cdot 2=4\) colorings fixed by \(v\). Since there are two choices for how to uniformly color the elements of a cycle, letting \(x_i=2\) for all i in the monomial associated with \(\pi\) gives the number of colorings fixed by \(\pi\). In Figure 15.10 , the “Fixed colorings” column gives the number of 2-colorings of the square fixed by each permutation. Before, we obtained this manually by considering the action of \(D_8\) on the set of all 16 colorings. Now we only need the cycle notation and the monomials that result from it to derive this!
Recall that Burnside's Lemma states that the number of colorings fixed by the action of a group can be obtained by adding up the number fixed by each permutation and dividing by the number of permutations in the group. If we do that instead for the monomials arising from the permutations in a permutation group \(G\) in which every cycle of every permutation has at most \(n\) entries, we obtain a polynomial known as the cycle index \(P_G(x_1,x_2,…,x_n)\). For our running example, we find
\(P_{D_8}(x_1,x_2,x_3,x_4)=\dfrac{1}{8}(x_1^4+2x_1^2x_2^1+3x_2^2+2x_4^1)\).
To find the number of distinct 2-colorings of the square, we thus let \(x_i=2\) for all i and obtain \(P_{D_8}(2,2,2,2)=6\) as before. Notice, however, that we have something more powerful than Burnside's lemma here. We may substitute any positive integer \(m\) for each \(x_i\) to find out how many nonequivalent \(m\)-colorings of the square exist. We no longer have to analyze how many colorings each permutation fixes. For instance, \(P_{D_8}(3,3,3,3)=21\), meaning that 21 of the 81 colorings of the vertices of the square using three colors are distinct.
15.4.2 The full enumeration formula
Hopefully the power of the cycle index to count colorings that are distinct when symmetries are considered is becoming apparent. In the next section, we will provide additional examples of how it can be used. However, we still haven't seen the full power of Pólya's technique. From the cycle index alone, we can determine how many colorings of the vertices of the square are distinct. However, what if we want to know how many of them have two white vertices and two gold vertices? This is where Pólya's enumeration formula truly plays the role of a generating function.
Let's again consider the cycle index for the dihedral group \(D_8\):
\(P_{D_8}(x_1,x_2,x_3,x_4)=\dfrac{1}{8}(x_1^4+2x_1^2x_2^1+3x_2^2+2x_4^1)\).
Instead of substituting integers for the \(x_i\), let's consider what happens if we substitute something that allows us to track the colors used. Since \(x_1\) represents a cycle of length 1 in a permutation, the choice of white or gold for the vertex in such a cycle amounts to a single vertex receiving that color. What happens if we substitute \(w+g\) for ?\(x_1\)? The first term in \(P_{D_8}\) corresponds to the identity permutation \(ι\), which fixes all colorings of the square. Letting \(x_1=w+g\) in this term gives
\((w+g)^4=g^4+4g^3w+6g^2w^2+4gw^3+w^4\),
which tells us that \(ι\) fixes one coloring with four gold vertices, four colorings with three gold vertices and one white vertex, six colorings with two gold vertices and two white vertices, four colorings with one gold vertex and three white vertices, and one coloring with four white vertices.
Let's continue establishing a pattern here by considering the variable \(x_2\). It represents the cycles of length 2 in a permutation. Such a cycle must be colored uniformly white or gold to be fixed by the permutation. Thus, choosing white or gold for the vertices in that cycle results in two white vertices or two gold vertices in the coloring. Since this happens for every cycle of length 2, we want to substitute \(w^2+g^2\) for \(x_2\) in the cycle index. The \(x_1^2x_2^1\) terms in \(P_{D_8}\) are associated with the flips \(p\) and \(n\). Letting \(x_1=w+g\) and \(x_2=w^2+g^2\), we find
\(x_1^2x_2^1=g^4+2g^3w+2g^2w^2+2gw^3+w^4\),
from which we are able to deduce that p and n each fix one coloring with four gold vertices, two colorings with three gold vertices and one white vertex, and so on. Comparing this with Figure 15.2 shows that the generating function is right on.
By now the pattern is becoming apparent. If we substitute \(w^i+g^i\) for \(x_i\) in the cycle index for each \(i\), we then keep track of how many vertices are colored white and how many are colored gold. The simplification of the cycle index in this case is then a generating function in which the coefficient on \(g^sw^t\) is the number of distinct colorings of the vertices of the square with \(s\) vertices colored gold and \(t\) vertices colored white. Doing this and simplifying gives
\(P_{D_8}(w+g,w^2+g^2,w^3+g^3,w^4+g^4)=g^4+g^3w+2g^2w^2+gw^3+w^4\).
From this we find one coloring with all vertices gold, one coloring with all vertices white, one coloring with three gold vertices and one white vertex, one coloring with one gold vertex and three white vertices, and two colorings with two vertices of each color.
As with the other results we've discovered in this chapter, this property of the cycle index holds up beyond the case of coloring the vertices of the square with two colors. The full version is Pólya's enumeration theorem:
Let \(S\) be a set with \(|S|=r\) and \(\mathcal{C}\) the set of colorings of \(S\) using the colors \(c_1,…,c_m\) . If a permutation group \(G\) acts on \(S\) to induce an equivalence relation on \(\mathcal{C}\) , then
\(P_G ( \displaystyle \sum_{i=1}^m c_i, \sum_{i=1}^m c_i^2, \cdot \cdot \cdot, \sum_{i=1}^m c_i^r)\)
is the generating function for the number of nonequivalent colorings of \(S\) in \(\mathcal{C}\) .
If we return to coloring the vertices of the square but now allow the color blue as well, we find
\(P_{D_8}(w+g+b,w^2+g^2+b^2,w^3+g^3+b^3,w^4+g^4+b^4)=b^4+b^3g+2b^2g^2+bg^3+g^4+b^3w+2b^2gw+2bg^2w+g^3w+2b^2w^2+2bgw^2+2g^2w^2+bw^3+gw^3+w^4\).
From this generating function, we can readily determine the number of nonequivalent colorings with two blue vertices, one gold vertex, and one white vertex to be 2. Because the generating function of Pólya's Enumeration Theorem records the number of nonequivalent patterns, it is sometimes called the pattern inventory .
What if we were interested in making necklaces with 500 (very small) beads colored white, gold, and blue? This would be equivalent to coloring the vertices of a regular 500-gon, and the dihedral group \(D_{1000}\) would give the appropriate transformations. With a computer algebra system such as Mathematica ®, it is possible to quickly produce the pattern inventory for such a problem. In doing so, we find that there are
\(36360291795869936842385267079543319118023385026001623040346035832580600191583895484198508262979388783308179702534404046627287796430425271499270313565347234741708546745333417930824781980702852692187253642441292279756575936040804567103229 \approx 3.6 \times 10^{235}\)
possible necklaces. Of them,
\(252949184234046077349041318620101048779141729407880866280363896567824471388337043268753932294423230859058382000714795759057317766605088026968640797415175535033372572682057214340157297357996345021733060 \approx 2.5 \times 10^{200}\)
have 225 white beads, 225 gold beads, and 50 blue beads.
The remainder of this chapter will focus on applications of Pólya's Enumeration Theorem and the pattern inventory in a variety of settings.