Counting necklaces with Burnside's lemma Image: Shikoha Tautiko (CC BY-SA 4.0)

Counting necklaces with Burnside's lemma

Thread six beads, each black or white, onto a loop of string. There are \(2^6 = 64\) ways to choose the colours, but many of them are the same necklace: a necklace with one black bead is one necklace, not six, since turning it brings any of the six positions to the top. How many different necklaces are there? The answer is 14, and the lemma that produces it without listing anything is the main tool of Unit 10 of the masterclass. It was proved by Cauchy in 1845 and by Frobenius in 1887, and it is named after William Burnside, who included it in his book of 1897 and attributed it to Frobenius, which is why some authors call it the lemma that is not Burnside's.

What is being counted

The setting is a group acting on a set, the subject of Unit 10. Here the set \(X\) is the 64 colourings of six positions, and the group \(G\) is the six rotations of the loop, by 0, 1, 2, 3, 4, or 5 positions. A rotation turns each colouring into another colouring. Two colourings count as the same necklace when some rotation carries one to the other, and the set of all colourings reachable from a given one by rotation is called its orbit. The question "how many necklaces" is the question "how many orbits".

Orbits come in different sizes. The all-white colouring is fixed by every rotation, so its orbit has one element. The alternating colouring, black white black white black white, is carried to itself by rotation through two positions, so its orbit has only two elements. A colouring with one black bead has an orbit of six. Counting orbits by dividing 64 by 6 fails because the orbits are not all the same size; that is the whole difficulty, and the lemma gets round it.

The lemma

Burnside's lemma says: the number of orbits equals the average, over the elements \(g\) of the group, of the number of points of \(X\) left fixed by \(g\). In symbols,

\[ \text{number of orbits} = \frac{1}{|G|} \sum_{g \in G} |\mathrm{Fix}(g)|, \]

where \(\mathrm{Fix}(g)\) is the set of \(x\) with \(g \cdot x = x\). The proof counts the pairs \((g, x)\) with \(g \cdot x = x\) in two ways. Summing over \(g\) gives the right-hand side. Summing over \(x\) gives, for each \(x\), the size of its stabilizer, the subgroup of elements fixing it, and the orbit-stabilizer theorem says that the size of the stabilizer of \(x\) is \(|G|\) divided by the size of the orbit of \(x\). Adding \(|G|/|\mathrm{orbit}(x)|\) over all \(x\) in one orbit of size \(m\) gives \(m\) copies of \(|G|/m\), which is \(|G|\). So each orbit contributes exactly \(|G|\) to the count, and the total is \(|G|\) times the number of orbits. Dividing by \(|G|\) is the lemma.

The six beads

Apply it. The rotation by 0 positions fixes all 64 colourings. The rotations by 1 and by 5 positions carry every bead to its neighbour, so a colouring fixed by them has all beads the same colour: 2 fixed colourings each. The rotations by 2 and by 4 positions split the six positions into two cycles of three, positions 1, 3, 5 and positions 2, 4, 6, and a fixed colouring must be constant on each cycle: \(2^2 = 4\) each. The rotation by 3 positions splits the six positions into three cycles of two and fixes \(2^3 = 8\) colourings. The total is \(64 + 2 + 4 + 8 + 4 + 2 = 84\), and dividing by 6 gives 14. Anyone who doubts it can draw the 14 and check; the list runs from all white through the one-black, two-black (three of them), three-black (four of them), four-black (three), five-black, and all black.

The pattern in that calculation is general. A rotation by \(k\) positions out of \(n\) splits the positions into \(\gcd(n, k)\) cycles, each of length \(n/\gcd(n, k)\), so it fixes \(c^{\gcd(n,k)}\) colourings in \(c\) colours. Grouping the rotations by the value \(d = \gcd(n, k)\), there are \(\varphi(n/d)\) rotations for each divisor \(d\) of \(n\), where \(\varphi\) is Euler's function from Unit 7, and the number of necklaces of \(n\) beads in \(c\) colours is

\[ \frac{1}{n} \sum_{d \mid n} \varphi(n/d)\, c^{d}. \]

For \(n = 6\) and \(c = 2\) the divisors are 1, 2, 3, 6, and the sum is \(\varphi(6) \cdot 2 + \varphi(3) \cdot 4 + \varphi(2) \cdot 8 + \varphi(1) \cdot 64 = 4 + 8 + 8 + 64 = 84\). For two colours and \(n = 1, 2, 3, \ldots\) the formula gives 2, 3, 4, 6, 8, 14, 20, 36, 60, 108, which is sequence A000031 in the On-Line Encyclopedia of Integer Sequences. If the necklace may also be turned over, so that reflections count too, the group grows to the dihedral group \(D_n\) of Unit 5, the sum acquires terms for the reflections, and the six-bead count drops from 14 to 13, because exactly one pair of necklaces are mirror images that no rotation relates.

Painting a cube

The same method handles any object with symmetry. How many ways are there to paint the six faces of a cube with three colours, two cubes counting as the same if one can be turned into the other? The rotation group of the cube has 24 elements, the subject of a counting in Unit 10, and they fall into five kinds. The identity fixes all \(3^6 = 729\) colourings. The six quarter turns about face axes cycle four side faces and fix the two end faces, so a fixed colouring is constant on the four sides: \(3^3 = 27\) each. The three half turns about face axes swap the sides in two pairs: \(3^4 = 81\) each. The eight rotations by a third of a turn about the long diagonals cycle the faces in two triples: \(3^2 = 9\) each. The six half turns about axes through midpoints of opposite edges swap the faces in three pairs: \(3^3 = 27\) each. The sum is \(729 + 6 \cdot 27 + 3 \cdot 81 + 8 \cdot 9 + 6 \cdot 27 = 1368\), and dividing by 24 gives 57 distinguishable painted cubes. With two colours the same sum gives 10, which can be checked by hand in a few minutes with a die and a pencil.

Where the counting goes next

Chemists count isomers this way: the number of distinct molecules with a given formula is a count of colourings of a skeleton up to the skeleton's symmetry, and George Pólya's paper of 1937, which refined Burnside's lemma into a generating function that keeps track of how many beads of each colour are used, was written with chemical applications in the title. The same theorem counts the distinct ways of wiring a switch network, the graphs on a given number of vertices up to relabelling, and the distinct positions of a puzzle up to its symmetries, which is how the solvers of the Rubik's Cube cut their search by a factor of 48 before computing God's number.

In the masterclass the lemma is proved in Unit 10, after the orbit-stabilizer theorem that drives the proof, and applied to necklaces, bracelets, and the cube. The counting of the cube's rotations, \(6 \times 4 = 24\) from the orbit-stabilizer theorem applied to a face, is the same unit's worked example. The research spotlight of Unit 10 presents László Babai's work on the graph isomorphism problem, which is the question of deciding, rather than counting, when two labelled structures are the same up to symmetry, and which is still not known to be solvable in polynomial time. For the man whose name is on the lemma, the MacTutor biography of Burnside explains how a Cambridge rowing coach became the founder of group theory in Britain. The curriculum lists all sixteen units.

Study algebra properly

The Algebra Masterclass: weekly units, quizzes, a final exam, and a certificate.
About the program