Burnside's lemma / Pólya enumeration theorem¶
Burnside's lemma¶
Burnside's lemma was formulated and proven by Burnside in 1897, but historically it was already discovered in 1887 by Frobenius, and even earlier in 1845 by Cauchy. Therefore it is also sometimes named the Cauchy-Frobenius lemma.
Burnside's lemma allows us to count the number of equivalence classes in sets, based on internal symmetry.
Objects and representations¶
We have to clearly distinguish between the number of objects and the number of representations.
Different representations can correspond to the same objects, but of course any representation corresponds to exactly one object. Consequently the set of all representations is divided into equivalence classes. Our task is to compute the number of objects, or equivalently, the number of equivalence classes. The following example will make the difference between object and representation clearer.
Example: coloring of binary trees¶
Suppose we have the following problem.
We have to count the number of ways to color a rooted binary tree with
Here the set of objects is the set of different colorings of the tree.
We now define the set of representations.
A representation of a coloring is a function
At the same time we introduce a partition of this set into equivalence classes.
For example, suppose
Invariant permutations¶
Why do these two function
But formally this means that there exists an invariant permutation
So starting from the definition of objects, we can find all the invariant permutations, i.e. all permutations which do not change the object when applying the permutation to the representation.
Then we can check whether two functions
Finding all such invariant permutations with respect to the object definition is a key step for the application of both Burnside's lemma and the Pólya enumeration theorem. It is clear that these invariant permutations depend on the specific problem, and their finding is a purely heuristic process based on intuitive considerations. However in most cases it is sufficient to manually find several "basic" permutations, with which all other permutations can be generated (and this part of the work can be shifted to a computer).
It is not difficult to understand that invariant permutations form a group, since the product (composition) of invariant permutations is again an invariant permutation.
We denote the group of invariant permutations by
The statement of the lemma¶
For the formulation of the lemma we need one more definition from algebra.
A fixed point
Then Burnside's lemma goes as follows:
the number of equivalence classes is equal to the sum of the numbers of fixed points with respect to all permutations from the group
Although Burnside's lemma itself is not so convenient to use in practice (it is unclear how to quickly look for the value
Proof of Burnside's lemma¶
The proof of Burnside's lemma described here is not important for the practical applications, so it can be skipped on the first reading.
The proof here is the simplest known, and does not use group theory. The proof was published by Kenneth P. Bogart in 1991.
We need to prove the following statement:
The value on the right side is nothing more than the number of "invariant pairs"
To prove this formula we will compose a table with columns labeled with all functions
Thus the columns of the table decompose into equivalence classes.
Let us fix a class, and look at the columns in it.
First, note that these columns can only contain elements
Now fix an arbitrary element
Thus if we arbitrarily take one column from each equivalence class, and sum the number of elements in them, we obtain on one hand
Pólya enumeration theorem¶
The Pólya enumeration theorem is a generalization of Burnside's lemma, and it also provides a more convenient tool for finding the number of equivalence classes. It should be noted that this theorem was already discovered before Pólya by Redfield in 1927, but his publication went unnoticed by mathematicians. Pólya independently came to the same results in 1937, and his publication was more successful.
Here we discuss only a special case of the Pólya enumeration theorem, which will turn out very useful in practice. The general formula of the theorem will not be discussed.
We denote by
Evidence¶
This formula is a direct consequence of Burnside's lemma.
To get it, we just need to find an explicit expression for
Thus we consider a permutation
Application: Coloring necklaces¶
The problem "Necklace" is one of the classical combinatorial problems.
The task is to count the number of different necklaces from
In this problem we can immediately find the group of invariant permutations:
Let us find an explicit formula for calculating
Substituting these values into the Pólya enumeration theorem, we obtain the solution:
You can leave this formula in this form, or you can simplify it even more.
Let transfer the sum so that it iterates over all divisors of
where
Application: Coloring a torus¶
Quite often we cannot obtain an explicit formula for the number of equivalence classes. In many problems the number of permutations in a group can be too large for manual calculations and it is not possible to compute analytically the number of cycles in them.
In that case we should manually find several "basic" permutations, so that they can generate the entire group
Consider the example of the problem for coloring a torus.
There is a checkered sheet of paper
We again start with a piece of
Next it only remains to generate all permutations obtained as a product.
It is obvious that all such permutations have the form
Thus we can write the implementations to this problem.
using Permutation = vector<int>;
void operator*=(Permutation& p, Permutation const& q) {
Permutation copy = p;
for (int i = 0; i < p.size(); i++)
p[i] = copy[q[i]];
}
int count_cycles(Permutation p) {
int cnt = 0;
for (int i = 0; i < p.size(); i++) {
if (p[i] != -1) {
cnt++;
for (int j = i; p[j] != -1;) {
int next = p[j];
p[j] = -1;
j = next;
}
}
}
return cnt;
}
int solve(int n, int m) {
Permutation p(n*m), p1(n*m), p2(n*m), p3(n*m);
for (int i = 0; i < n*m; i++) {
p[i] = i;
p1[i] = (i % n + 1) % n + i / n * n;
p2[i] = (i / n + 1) % m * n + i % n;
p3[i] = (m - 1 - i / n) * n + (n - 1 - i % n);
}
set<Permutation> s;
for (int i1 = 0; i1 < n; i1++) {
for (int i2 = 0; i2 < m; i2++) {
for (int i3 = 0; i3 < 2; i3++) {
s.insert(p);
p *= p3;
}
p *= p2;
}
p *= p1;
}
int sum = 0;
for (Permutation const& p : s) {
sum += 1 << count_cycles(p);
}
return sum / s.size();
}