Prerequisites: Permutations and arrangements
Introduction
The Pólya enumeration theorem is usually used to solve counting problems involving “essentially different” objects.
This article may involve group theory
This article may involve group theory. It gives brief explanations of the group-theoretic concepts it uses, so that readers unfamiliar with them can understand and apply the Pólya enumeration theorem. For rigorous statements and discussions of group theory, see the sections on basic concepts of abstract algebra, group theory, and others.
“Symmetry groups”, “symmetric groups”, and “permutation groups”
This article inevitably uses the names of all three kinds of groups. Although they may be easy to confuse, they refer to different concepts. Given a geometric structure, its symmetry operations are the geometric transformations that make it coincide with itself, and its symmetry group is the set of those operations. The symmetric group is the set of all permutations of a given set. A permutation group is a subgroup of a symmetric group, consisting of some, not necessarily all, permutations. Later we explain how to represent the symmetry group of a given geometric structure as a permutation group and use it in counting problems.
Burnside's lemma
Related reading: Burnside's lemma
The Pólya enumeration theorem is an application and generalization of Burnside's lemma. Before introducing it, we briefly review Burnside's lemma.
To extract the general pattern, first consider a simple example.
Necklace coloring
We have a necklace of four beads. Each bead can be red or blue. How many essentially different bead colorings are there? (Two colorings are considered the same if one can be rotated to coincide with the other.)
Solution and analysis
This problem is simple enough to solve by enumeration. There are beads, each with possible colors, so there are possible necklace colorings. Group together colorings obtainable from one another by rotation; there are groups, as shown below. (The code for an individual coloring records the colors clockwise starting from the lower-left bead, with for blue and for red; colorings in the same group have the same background color.)
This example shows that to count essentially different colorings, the key is to know how many distinct colorings correspond to each equivalence class. In other words, we need to determine the size of every group in the figure.
Colorings in the same group are precisely those that can be transformed into one another by rotations. There are rotations, namely
representing rotations respectively. A rotation by leaves the necklace unchanged.
First consider the group containing . Applying these four operations gives
The four colorings are distinct, so this group has elements.
Now consider the group containing . Applying the same four operations gives
The result of rotating twice is the same as not rotating, and the result of rotating three times is the same as rotating once. Therefore this group has elements.
Finally, consider the groups containing and . All four operations give each of them back unchanged, so each group has only element.
Let denote a coloring, and let denote the set of color codes obtainable by applying operations to . The example suggests that the action of on has a kind of “periodicity”.
Let be the total number of operations. This “periodicity” means that if distinct operations in transform into itself, then the results for under these operations repeat times. Thus, for , there are distinct results, which is the size of the group containing .
In this example, only the zero rotation fixes , so its group has size ; both and the two-step rotation fix , so its group has size ; every rotation fixes , so its group has size .
Below, let denote the number of operations that transform into itself, so is the above. The size of the group containing is . To count the groups of colorings, enumerate all possible colorings ; for a coloring with group size , denoted , assign the weight . Then the number of groups is
The form of this expression is not convenient to use. Let be the result of applying an operation to a coloring using . Then the set described above is , so exchanging the order of summation gives
Here is the Iverson bracket. In the result after exchanging the sums, is the set of colorings that, under operation , remain unchanged, with such a coloring denoted ; in short, it is the set of fixed points of .
We can now write the number of groups as
In other words, the number of groups is the average number of fixed points of the rotations.
As an application of this result, recompute the number of necklace colorings. The fixed points of the rotations are:
| Operation | Fixed points |
|---|---|
Therefore, the number of groups is
This recovers the result above.
The example suggests the following general result for solving such counting problems. For convenience, we focus on coloring problems here, though the result also applies to other situations; examples appear at the end.
A coloring problem starts with a structure and colors each of its vertices, producing different colorings. The structure has symmetries, so colorings that appear different can be transformed into one another by symmetry operations. Such colorings are called essentially the same. The problem is to determine the number of essentially different colorings.
Following the analysis of the example, first determine the symmetry operations of the given structure. The set of these operations, , is called the spatial symmetry group of the structure. In practice, it is usually unnecessary to know the definition of a group; it is enough to enumerate all spatial symmetry operations without omission or duplication. The structures of several common spatial symmetry groups are analyzed later, where the definition of a group is explained.
Let the set of all colorings be , and let an individual coloring be . The result of applying operation to a coloring is . Thus all results obtainable by applying an operation to form , which is called the orbit of group acting on . Different colorings in the same orbit are what “essentially the same” means in these problems. Therefore, the number of essentially different colorings is equal to the number of distinct orbits.
The analysis of the example generalizes to the general case.
Burnside's lemma
Given an action of a group on a set , the number of distinct orbits is
Here, is the set of fixed points under the action of .
Its proof is almost exactly the analysis of the example above. The example used the observation that the results of the action of group on one element have a kind of “periodicity”, so the number of repetitions equals the number of operations that transform into itself. This fact is correct in general, but because the structure of group may be complicated, its “periodicity” may not be as direct as in the example. A rigorous statement of this fact requires the orbit-stabilizer theorem from group theory.
In applications, it is enough to enumerate all symmetry operations and give the number of fixed points corresponding to each operation. Here is a slightly more complicated application.
Cube coloring
Color a cube with three colors and find the number of essentially different colorings (two colorings that become the same after a spatial rotation are considered identical).
Solution
A cube has faces, and each face has coloring choices, so there are colorings in total, that is, . Let the spatial symmetry group of the cube be .
We now analyze all operations in . For convenience, call the six faces front, back, top, bottom, left, and right:
- Identity: Every coloring is fixed, so ;
- A rotation about the line through the centers of two opposite faces: there are choices of opposite faces and choices of rotation direction, so this type gives permutations. If the axis passes through the centers of the front and back faces, the top, bottom, left, and right faces must have the same color for the coloring to remain fixed. There are independently colored regions, so ;
- A rotation about the line through the centers of two opposite faces: there are choices of opposite faces, and the rotation direction does not matter, so this type gives permutations. If the axis passes through the centers of the front and back faces, the top and bottom faces must have the same color, and the left and right faces must have the same color. There are independently colored regions, so ;
- A rotation about the line through the midpoints of two opposite edges: there are choices of opposite edges, and the rotation direction again does not affect the permutation, so this type gives permutations. If the opposite edges are the boundaries of the front/top pair and the bottom/back pair, the front and top faces must have the same color, the bottom and back faces must have the same color, and the left and right faces must have the same color. There are independently colored regions, so ;
- A rotation about the line through two opposite vertices: there are choices of opposite vertices and choices of rotation direction, so this type gives permutations. If the opposite vertices are the upper-right vertex of the front face and the lower-left vertex of the back face, the front, top, and right faces must have the same color, and the back, bottom, and left faces must have the same color. There are independently colored regions, so .
Therefore, the number of essentially different colorings is
The Pólya enumeration theorem
The statement of Burnside's lemma does not use the fact that is the set of all colorings of a structure. In fact, Burnside's lemma is not limited to coloring problems. For coloring problems, the Pólya enumeration theorem provides a more precise calculation. It can be viewed as the application of the general Burnside's lemma to coloring problems.
The improvement over Burnside's lemma is that the Pólya enumeration theorem provides a concrete method for calculating the size of the fixed-point set in coloring problems.
This is intuitive from the cube-coloring example. For each symmetry operation of a cube, the size of its fixed-point set has the form , where is the number of colors and is the number of regions that can be colored independently under operation . This observation also holds in general, but we need to make clear how to calculate, for a given , the value .
Choosing a coloring of a structure means, mathematically, choosing a map from the set of colorable objects in the structure (such as beads in a necklace or faces of a cube) to the set of colors, namely . Thus the set of colorings is . The spatial symmetry group of the structure acts on the structure and therefore naturally acts on the set as well. Each such symmetry operation is a bijection on , namely a permutation. 1
Now analyze the structure of the fixed-point set . Given as a permutation of , the example shows that if a position in , denoted , can, after finitely many applications of , be moved to a position , then a fixed point must satisfy . In the language of orbits from the previous section, positions and lie in the same orbit under the action of 2, so they must be colored the same. In the language of permutations, for permutation , the cycle decomposition shows that positions and lie in the same cycle, so they must be colored the same. Different cycles in the cycle decomposition need not have the same color and can be colored independently. Thus the number of independently colorable regions is , namely the number of cycles in the cycle decomposition of .
It follows that the number of fixed points of operation is . Substituting this conclusion into Burnside's lemma gives the unweighted version of the Pólya enumeration theorem.
Pólya enumeration theorem (unweighted version)
Given an action of a group on a set and a color set , the number of distinct colorings is
where is the number of colors and is the number of cycles in the cycle decomposition of the permutation representation of an element .
Meaning of the group
There is a slight abuse of notation here. If group acts on , the action on the coloring set should be defined separately, but the distinction is omitted here.
As a simple application of the Pólya enumeration theorem, recompute the example from earlier.
Another solution to the necklace-coloring problem
Number the four beads . The elements of in the example have the following permutation representations, all written as cycle decompositions:
- Zero rotations , with cycles in total (the omitted -cycles should be noted);
- One rotation , with cycle;
- Two rotations , with cycles;
- Three rotations , with cycle.
Therefore, the number of essentially different colorings is
Another solution to the cube-coloring problem
The preceding analysis effectively gave the cycle representations of each type of permutation, although it did not write them explicitly in numerical notation, so we do not repeat that analysis here. We illustrate only the case of a rotation about the line joining the midpoints of opposite edges. Number the front, back, top, bottom, left, and right faces in that order. The corresponding permutation is , so . Other types of permutation can be analyzed similarly, and the final counting expression is exactly the same as above.
Weighted generalization
The unweighted Pólya enumeration theorem can count all essentially different coloring problems, but it is insufficient for more detailed questions. For example, if the number of times each available color may be used is specified in the coloring problem above, the Pólya counting formula cannot be applied directly. In practice, this requires deriving the result again using Burnside's lemma; expressing the resulting conclusions as generating functions gives the weighted version of the Pólya enumeration theorem.
Necklace coloring (with restrictions)
We have a necklace of four beads, each of which can be red or blue. Exactly two red beads and two blue beads are available. How many essentially different bead colorings are there? (Two colorings are considered the same if one can be rotated to coincide with the other.)
Solution and analysis
Apply Burnside's lemma. With two red and two blue beads, there are colorings. The spatial symmetry group consists of rotations by steps. Their fixed-point sets are:
- Zero rotations : all colorings are fixed;
- One rotation : a fixed point would require all beads to have the same color, so there are no fixed points;
- Two rotations : there are two independently colored regions, both of size . They must be colored red and blue respectively, so the fixed-point set has size ;
- Three rotations : this is the same as one rotation, so there are no fixed points.
Therefore, by Burnside's lemma, the number of essentially different colorings is
The example gives the following calculation method. For problems with restrictions on the numbers of different colors, we again color the cycles of each permutation in the spatial symmetry group, but the numbers of colors used must be exactly the specified numbers. Such combinatorial problems usually have no closed-form solution. Except for special cases that can be calculated by combinatorial methods, they need to be solved as a knapsack problem.
Generating functions can provide the answers to these counting problems. Given a permutation , suppose its cycle type is , meaning that it has cycles of length . If each cycle can be colored in one of colors, then the generating function
The coefficient of the monomial is the count in which the -th color is used times. The combinatorial meaning of the expression in parentheses is as follows: for a cycle of length , the number of colorings that use instances of color is , while the count is in all other cases. This exactly describes the requirement that all positions in the same cycle have the same color.
Given the generating function for colorings under a permutation , applying Burnside's lemma to each monomial gives the counts of essentially different colorings for every color combination. Since a generating function is linear in its monomials, the generating function for the number of essentially different colorings is
Expanding this expression, the coefficient of each monomial gives the number of essentially different colorings for the specified color combination.
In the discussion above, the generating function for coloring each cycle has no special significance and can be replaced by another generating function. Thus we obtain the following general version of the Pólya enumeration theorem.
Cycle index of a permutation group
Given a permutation group , the cycle index of group is defined as
where is the number of cycles in the cycle decomposition of permutation that have length ; that is, is the cycle type of permutation .
Pólya enumeration theorem (weighted version)
Given an action of a group on a set , suppose the generating function for the coloring methods at each point is . Then the generating function for the essentially different colorings of is
where is the cycle index of group .
Here, if the generating function for coloring a single position is , then the generating function for coloring a cycle of length is . This reflects the fact that if a coloring is a fixed point of a given permutation, all positions in the same cycle must have the same color. Evaluating the generating function at gives the unweighted version of the Pólya enumeration theorem above.
The statement of the theorem uses the concept of the cycle index of a permutation group. It is independent of any particular coloring problem and describes the structure of a permutation group.
Another solution to the restricted necklace-coloring problem
The cycle index of the rotation symmetry group is , and the generating function for coloring a single point is . Thus the generating function for all colorings is
The desired count is the coefficient of , namely essentially different colorings. Incidentally, this expression also gives the counts under other restrictions.
Applications
The weighted version of the Pólya enumeration theorem plays an important role in combinatorial counting problems. Here we briefly discuss its applications; for a more general discussion, see formal methods for combinatorial problems.
Diamond necklace
We have a necklace with four identical beads, and any number of diamonds can be set into each bead. If there are four diamonds, how many essentially different ways are there to set them? (Two settings are considered the same if one can be rotated to coincide with the other.)
Solution and analysis
The spatial symmetry group of the necklace is still the same as above. Without restricting the total number of diamonds, the generating function for the setting at one position is
Applying the weighted Pólya enumeration theorem, the generating function for all diamond settings is
Thus the desired number of settings is the coefficient of , namely . As a check, enumeration gives
Each group of four digits gives the number of diamonds set into each bead.
This example shows that the weighted version of the Pólya enumeration theorem can solve a much broader class of problems than coloring counts. It provides a method for extending the count at a single point to the count of essentially different configurations on an entire structure. Coloring problems are only a special case of this class.
Common spatial symmetry groups
One difficulty in Pólya-counting problems is analyzing the structure of permutation groups. Here we briefly discuss common spatial symmetry groups and describe them using their cycle indices. Note that for the spatial symmetry group of the same structure, different sets of objects being acted on give different group actions, and therefore different permutation representations. For example, the action of the spatial symmetry group of a cube on its vertices, edges, and faces gives the vertex, edge, and face permutation groups of the cube, respectively. The numbers of vertices, edges, and faces differ, so these permutation groups and their corresponding cycle indices naturally differ as well. Thus, when solving a specific problem, the objects on which the group acts must not be overlooked.
Relationship between spatial symmetry groups and permutation groups
Although the two concepts are very similar, they are not the same object. In group-theoretic language, given a spatial symmetry group and its action on a set , the permutation representation of the action is a homomorphism from group to the symmetric group , denoted . In combinatorial counting, this representation is often faithful, meaning , so the homomorphism is an embedding of group into group . The permutation group in this article is the image of this embedding, namely , and it is isomorphic to the spatial symmetry group itself. Therefore, for the spatial symmetry group of the same structure, different choices of the group action can give different permutation groups and hence different cycle indices (isomorphic permutation groups need not have the same cycle index).
Given a structure, its spatial symmetry group is the set of all operations that can transform it into itself. It necessarily satisfies the following conditions:
- Applying two symmetry operations successively to a given structure can be viewed as applying another symmetry operation; that is, the set of symmetry operations is closed under composition;
- composition of symmetry operations is associative;
- there is an identity symmetry operation; leaving the given structure unchanged is itself regarded as an operation;
- every operation has an inverse operation that can cancel the effect of the given operation.
Groups are the abstraction of concepts satisfying all these conditions. The study of group structures is the main subject of group theory. The analysis here focuses on spatial symmetry groups and mainly uses geometric viewpoints. The common examples given below should provide readers with general approaches to analyzing such problems.
Cyclic groups
For a regular -gon, the spatial symmetry group formed by all rotations is called the cyclic group (cyclic group), denoted . Let the operation of counterclockwise rotation by be . The elements of group can be written as
Here means applying operation times, namely counterclockwise rotation by , while is the identity transformation.
Whether we consider the action of the cyclic group on all vertices or all edges of a regular -gon, its permutation representation is the same. Analyze the permutation representation of the action on the set of all vertices as an example. Its cycle index is
Here is the Euler totient function from number theory.
If we count only rotations, the spatial symmetry group of a necklace of length is .
Analysis
Number the vertices in counterclockwise order as . Then . The set of vertices in the cycle containing vertex is
Clearly, if and only if
This means that every cycle containing a vertex has length . Therefore permutation has cycles of equal length. Combining like terms in the cycle-index expression, for a given , the condition holds for values, and their number is ; all of them correspond to monomials of the form . Thus we obtain the cycle-index expression above.
Dihedral groups
For a regular -gon, the operations consisting of all rotations and reflections across symmetry axes also form a spatial symmetry group, called the dihedral group (dihedral group), denoted . Let the operation of counterclockwise rotation by be , and let the operation of reflection across a given symmetry axis (for example, the line from the center to a vertex) be . Then the operations of group can be written as
Here is still a rotation. Although means first performing rotations and then reflecting across the given symmetry axis, it can equivalently be viewed as reflection across another symmetry axis. Therefore, group has identity transformation, rotations, and reflections in total. Its actions on the vertex set and edge set also have the same permutation representation. Its cycle index is
Analysis
The analysis of the rotations in group , namely including the identity transformation, is the same as for cyclic group . The key is to analyze the remaining reflections, separating the cases according to the parity of the number of vertices .
When , every reflection axis connects a vertex to the midpoint of the opposite edge, and there are such axes. After each reflection, the vertex on the axis remains fixed and all other vertices are exchanged in pairs, giving fixed point (a -cycle) and -cycles.
When , there are two types of symmetry axes. Half connect opposite vertices. Reflection across such an axis fixes the two vertices on the axis and exchanges all remaining vertices in pairs, giving fixed points (two -cycles) and -cycles. The other half connect the midpoints of opposite edges. Reflection across such an axis exchanges all vertices in pairs, giving -cycles.
This analysis gives the cycle-index expression above.
Symmetric groups
The set of all permutations of elements forms a group called the symmetric group of degree (symmetric group), denoted . It describes all symmetries that these vertices can have. It is also the permutation representation of the action of these symmetry operations on the vertex set.
According to the analysis in Permutations and arrangements, its cycle index is
The count of permutations with cycle type used here is
It satisfies the recurrence relation
The starting point of the recurrence is . The combinatorial meaning of this recurrence is that, to construct a permutation of length , we can first choose the cycle containing point and let its length be , and then construct a permutation on the remaining vertices.
Given a complete graph with vertices, its spatial symmetry group is precisely . The cycle index of its action on the set of all vertices is given by above. However, its permutation representation on the set of all edges is different. For example, the sizes of the sets differ: the total number of edges is . The edge case requires additional analysis. Here we give a simple example; the general case can be found in the exercises.
Counting undirected simple graphs
Count the number of undirected simple graphs with vertices up to isomorphism.
Solution
This is equivalent to coloring the complete graph with vertices using two colors and counting essentially different colorings. The spatial symmetry group is , and we now analyze the cycle index of its edge permutation group .
- Identity ( operation): the edges also remain fixed, so the corresponding monomial is ;
- Swapping two vertices ( operations): suppose and are swapped. Edges and remain fixed, while edges and are exchanged, and edges and are exchanged, so the corresponding monomial is ;
- A three-vertex cycle ( operations): suppose the cycle is . The edges between these vertices cycle accordingly, and the edges connecting them to the fourth vertex , namely , also cycle accordingly, so the corresponding monomial is ;
- Swapping two pairs of vertices ( operations): suppose vertices and are swapped, and vertices and are swapped. Edges and remain fixed, while edges and are exchanged, and edges and are exchanged, so the corresponding monomial is ;
- A four-vertex cycle ( operations): suppose the cycle is . The edges between adjacent vertices cycle accordingly, while the edges between opposite vertices are exchanged, so the corresponding monomial is .
Therefore, the cycle index of the edge permutation group is
By the Pólya enumeration theorem, the number of undirected simple graphs with vertices up to isomorphism is
Polyhedral groups
A polyhedral group is the spatial symmetry group of a regular polyhedron. There are only five regular polyhedra: the regular tetrahedron, cube, regular octahedron, regular dodecahedron, and regular icosahedron. If the adjacency relations among vertices, edges, and faces are preserved while vertices and faces are exchanged, we obtain the dual regular polyhedron. The regular tetrahedron is dual to itself, the cube is dual to the regular octahedron, and the regular dodecahedron is dual to the regular icosahedron. The duality relation simplifies the discussion of their spatial symmetry groups.
Counting only rotations that can be performed in three-dimensional space, there are only three spatial symmetry groups.
-
Tetrahedral group, that is, the spatial symmetry group of a regular tetrahedron:
-
Identity;
- Rotations by and about the line through a vertex and the center of the opposite face;
- A rotation about the line through the midpoints of opposite edges.
There are symmetry operations in total.
The cycle indices of its corresponding permutation groups are as follows.
-
Vertex and face permutation groups: ;
- Edge permutation group: .
-
Octahedral group, that is, the spatial symmetry group of the cube (and the regular octahedron):
-
Identity;
- Rotations by and about the line through opposite vertices;
- A rotation about the line through the midpoints of opposite edges;
- Rotations by , , and about the line through the centers of opposite faces.
There are symmetry operations in total.
The cycle indices of the permutation groups of the corresponding cube are as follows.
- Vertex permutation group: ;
- Edge permutation group: ;
- Face permutation group: .
The permutation groups of the regular octahedron are analogous; only the roles of vertices and faces need to be exchanged.
-
Icosahedral group, that is, the spatial symmetry group of the regular dodecahedron (and the regular icosahedron):
-
Identity;
- Rotations by and about the line through opposite vertices;
- A rotation about the line through the midpoints of opposite edges;
- Rotations by , , , and about the line through the centers of opposite faces.
There are symmetry operations in total.
The cycle indices of the permutation groups of the corresponding regular dodecahedron are as follows.
- Vertex permutation group: ;
- Edge permutation group: ;
- Face permutation group: .
The permutation groups of the regular icosahedron are analogous; only the roles of vertices and faces need to be exchanged.
The cycle indices given here are for permutation groups acting separately on vertices, edges, faces, and other individual types of objects. If different types of objects are to be colored simultaneously, a joint cycle index must be written.
Exercises
Coloring problems
These problems only require analyzing the structure of permutation groups and applying the Pólya enumeration theorem.
- Luogu P4980 Template: Pólya theorem
- Luogu P2561 [AHOI2002] Black and White Tiles
- TRANSP - Transposing is Fun
- TRANSP2 - Transposing is Even More Fun
- Luogu P3307 [SDOI2013] Necklace
When the allowed color combinations are restricted, the number of ways to color the cycles needs to be found using knapsack DP or combinatorial methods.
Graph-counting problems
The Pólya enumeration theorem can be applied to graph-counting problems. The difficulty in these problems lies in enumerating the edge permutation group of a graph.
- SGU 282. Isomorphism
- Luogu P4727 [HNOI2009] Counting graph isomorphisms
- Luogu P4128 [SHOI2006] Colored graph
Another class of graph-counting problems to which the Pólya enumeration theorem applies requires directly manipulating generating functions.
- LOJ 6538 Alkyl counting, enhanced edition, enhanced edition
- LOJ 6512 “Yali Training 2018” Alkane counting
- Luogu P6597 Alkene counting
- Luogu P5818 [JSOI2011] Counting isomers