Written by dustbringer on 03 December 2022 . View source.

Counting circular arrangements of objects

In high-school mathematics you've probably come across the term combinatorics. In its most basic form, combinatorics is about counting the number of ways you can arrange some objects in a particular fashion. For example, to arrange nn (distinct) objects in a line, there are n!=n(n1)2×1n! = n(n-1) \dots 2 \times 1 possible permutations. If there are repeated objects, we divide by the permutations of the identical objects. For example arranging the letters of BALLOONBALLOON in a line, the letters LL and OO both repeat twice, so there are 7!2!2!\frac{7!}{2!2!} permutations. On the other hand, if we wanted to arrange nn (distinct) objects in a circle, each arrangement can be rotated and it is considered "identical". So we arrange the items in a line and divide by the number of different rotations of these objects (to remove the overcounted arrangements) n!/n=(n1)!n!/n = (n-1)!.

What happens when we combine these ideas together? Say we take take nn objects, where some are repeating, and arrange them in a circle. An easy example: arrange the letters AABBAABB in a circle. How many ways can this be done? It's easy to write down every possibility, and we find that there are only two (considering rotation as equivalent):

However if we try to combine the two equations we used above, the number of permutations comes out to be

4!4×2!2!=32=1.5.\frac{4!}{4 \times 2!2!} = \frac{3}{2} = 1.5.

Not only is this not 22, but isn't even a whole number! We could try many different examples and attempt formulate a nice equation, but it's not exactly that simple! It turns out there is a nice theorem that gives a general procedure to solve this, but it requires some background in group theory.

tl;dr

In mathematics, Group theory is the study of symmetries, how they interact with each other, and how they interact with other objects. There is a theorem of group that counts the number of "different" elements in a set, given that elements are "not different" when are related by a symmetry (more precisely, a group action). We can apply this to concrete counting problems, by looking at e.g. rotations acting on objects arranged in a circle. This theorem can be extended to extract more information about arrangements, where the calculations are reduced to looking at coefficients of a polynomial.

Background

The following is a quick and brief proof-less introduction to the concepts we will need. The intention is to be a refresher for those who have seen groups before, however, if you are new to these concepts, there should be barely enough to understand (with time) how the counting theorem works.

Groups

Definition. A group is a set GG with a binary operation *, such that the following axioms hold.

  • (Identity) There is an element eGe \in G such that for any aGa \in G, ae=ea=aa * e = e * a = a.
  • (Associativity) For any three elements a,b,cGa,b,c \in G, (ab)c=a(bc)(a * b) * c = a * (b * c).
  • (Inverse) For any element aGa \in G, there exists an element bGb \in G for which ab=ba=ea * b = b * a = e, we write a1a^{-1} for this element.

We sometimes drop the *, and just write gh=ghgh = g * h, if the operation is clear from the context.

Example 1. An easy example of a group is Z/nZ={0,1,...,n1}\Z/n\Z = \{0,1,...,n-1\} where the operation is addition modulo nn. This is the cyclic group CnC_n. We can think of this as generated by 11, for example Z/4Z={1,1+1,1+1+1,1+1+1+1}\Z/4\Z = \{1,1+1,1+1+1,1+1+1+1\}, where 1+1+1+1=0 (mod 4)1+1+1+1=0 \ (\op{mod}\ 4).

Example 2. The symmetric group on nn elements SnS_n is a group where elements are the permutations of 1,2,...,n1, 2, ..., n. For two elements a,bSna,b \in S_n, abSnab \in S_n is the permutation obtained by applying bb then applying aa. For example the following table represents a permutation on the first 44 integers, taking 12311 \to 2 \to 3 \to 1 and 444 \to 4.

Input1234
Output2314

A useful way to write this is with cycle notation. The above table corresponds to the element (123)(4)S4(123)(4) \in S_4, where (123)(123) and (4)(4) are cycles. In fact every permutation of nn elements can be written as a product of disjoint cycles (i.e. the numbers inside the cycles don't overlap). We often do not write cycles of length 11 because they offer no new information. For convenience, we write the identity permutation (1)(2)...(n)(1)(2)...(n) as id\op{id}.

The counting theorem uses subgroups of SnS_n, which you can think of as smaller groups living inside SnS_n. The group CnC_n, from Example 1, actually appears as a subset of SnS_n, for example whose elements are powers of (123...n)(123...n) (generated by this cycle). From now on, this is how we will think about CnC_n.

Group Actions

Definition. Let SS be a set and GG a group. A group action of GG on SS is an operation gsSg \cdot s \in S for gGg \in G and sSs \in S, satisfying the following properties.

  • (Identity) If eGe \in G is the identity element, then es=se \cdot s = s for all sSs \in S.
  • (Compatibility) For g,hGg,h \in G, g(hs)=(gh)sg \cdot (h \cdot s) = (gh) \cdot s for all sSs \in S.

Example. Let G=S4G = S_4 and let SS be the set tuples representing arrangements of the letters a,b,c,da,b,c,d in a line (without repetition). An easy group action could be for gS4g \in S_4 and sSs \in S, gsg \cdot s is permuting entries in the tuple by gg. For example if g=(123)(4)g = (123)(4) and s=(a,b,c,d)s = (a,b,c,d) then gs=(c,a,b,d)g \cdot s = (c,a,b,d), because gg take the element in position 11 to position 22, the element in position 22 to position 33, and so on.

Definition. Let GG be a group acting on a set SS.

  • Let sSs \in S. The orbit of ss is the set of every possible element in SS obtained from GG acting on xx, that is
    Gx={gx:gG},G \cdot x = \{g \cdot x: g \in G\},
    which is sometimes written Orb(x)\op{Orb}(x). The stabilizer of ss is the set of elements of GG that fix ss, that is
    Stab(x)={gG:gs=s}.\op{Stab}(x) = \{g \in G : g \cdot s = s\}.
  • Let gGg \in G. The fixed set of gg is the set of every element of SS that is fixed by gg, that is
    Sg={sS:gs=s},S^g = \{s \in S: g \cdot s = s\},
    which is sometimes written Fix(x)\op{Fix}(x).

The set of orbits is typically written as S/G={Orb(s):sS}S / G = \{\op{Orb}(s): s \in S\}.

Example. Let G=C4S4G = C_4 \subseteq S_4 be the group generated by one 44-cycle (cycle length 44) in S4S_4. Think of C4C_4 as generated by (1234)(1234), whose elements are

ElementCycle Decomposition
(1234)(1234)(1234)(1234)
(1234)2(1234)^2(13)(24)(13)(24)
(1234)3(1234)^3(1432)(1432)
(1234)4(1234)^4(1)(2)(3)(4)(1)(2)(3)(4)

Let SS be the set 44-tuples representing arrangements of the letters a,b,c,da,b,c,d in a line (with repetition). Let C4C_4 act on SS as in the previous example. Let s=(a,b,c,c)Ss = (a,b,c,c) \in S then the orbit of ss is

Gs={(a,b,c,c),(c,a,b,c),(c,c,a,b),(b,c,c,a)}.G \cdot s = \{(a,b,c,c), (c,a,b,c), (c,c,a,b), (b,c,c,a)\}.

The stabilizer of ss is

Stab(s)={id,(34)}.\op{Stab}(s) = \{\op{id}, (34)\}.

Let g=(123)C4g = (123) \in C_4, then the fixed set of gg is

Sg={(a,a,a,a),(a,a,a,b),...,(d,d,d,c),(d,d,d,d)}={(x,x,x,y):x,y{a,b,c,d}}.\begin{aligned} S^g &= \{(a,a,a,a), (a,a,a,b), ..., (d,d,d,c), (d,d,d,d)\} \\ &= \{(x,x,x,y): x,y \in \{a,b,c,d\}\}. \end{aligned}

Proposition. Let GG be a group acting on a set SS. The orbits of sSs \in S partition SS, that is

sSOrb(s)=S.\bigsqcup_{s \in S} \op{Orb}(s) = S.

Proof. Clearly SS is a union of its orbits, because sOrb(s)s \in \op{Orb}(s). The disjointness follows from the invertibility of elements in GG.

Proposition. (Orbit-Stabilizer Theorem) Let GG be a (finite) group acting on a set SS, then for any sSs \in S

Stab(s)=GGs.|\op{Stab}(s)| = \frac{|G|}{|G \cdot s|}.

Proof. Omitted. See Wikipedia.

Burnside's Lemma

This lemma (not actually by Burnside) tells you how many orbits of a group action there are.

Theorem. (Burnside's Lemma) Let GG be a (finite) group acting on a set SS, then

S/G=1GgGSg.|S/G| = \frac{1}{|G|} \sum_{g \in G} |S^g|.

This theorem says that the number of orbits is the average of the fixed sets of SS.

Proof. We have that

gGSg=gG{sS:gs=s}={(g,s):gG,sS,gs=s}=sSStab(s)=sSGGs(Orbit-Stabilizer Thm)=GsSGs.\begin{aligned} \sum_{g \in G} |S^g| &= \sum_{g \in G} |\{s \in S: g \cdot s = s\}| \\ &= |\{(g,s) : g \in G, s \in S, g \cdot s = s\}| \\ &= \sum_{s \in S} |\op{Stab}(s)| \\ &= \sum_{s \in S} \frac{|G|}{|G \cdot s|} & \text{(Orbit-Stabilizer Thm)} \\ &= |G| \sum_{s \in S} |G \cdot s|. \end{aligned}

Recall that SS can be partitioned into all orbits, so we can instead sum over orbits AS/GA \in S/G,

gGSg=GsSGs=GAS/GsA1Gs=GAS/GsA1A=GAS/G1=GS/G,\begin{aligned} \sum_{g \in G} |S^g| &= |G| \sum_{s \in S} |G \cdot s| \\ &= |G| \sum_{A \in S/G} \sum_{s \in A} \frac{1}{|G \cdot s|} \\ &= |G| \sum_{A \in S/G} \sum_{s \in A} \frac{1}{|A|} \\ &= |G| \sum_{A \in S/G} 1 \\ &= |G| |S/G|, \end{aligned}

and the result follows.


This theorem by itself can already be used to solve our problem. Remember that we wanted to arrange the letters AABBAABB in a circle. We can take G=C4G = C_4 to as our group action, so that each arrangement and all its rotations can be summed up as one orbit. We wanted to know how many of these "different" arrangements (or orbits) there are, which Burnside's lemma tells us. If we let SS be all the tuples representing arrangements of AABBAABB in a line, then the number of orbits under C4C_4 is the number of "different" arrangements of AABBAABB in a circle.

Listing out all the arrangements of the letters of AABBAABB, we get

S={AABB,ABAB,ABBA,BABA,BAAB,BBAA}.S = \{AABB, ABAB, ABBA, BABA, BAAB, BBAA\}.

Since C4C_4 is generated by (1234)(1234), its elements are

C4={id,(1234),(13)(24),(1432)}.C_4 = \{\op{id}, (1234), (13)(24), (1432)\}.

For an arrangement to be fixed by a cycle, the letters at each position changed by the cycle must be the same. Then we can see that

  • Sid=SS^{\op{id}} = S,
  • S(1234)=S^{(1234)} = \varnothing,
  • S(13)(24)={ABAB,BABA}S^{(13)(24)} = \{ABAB, BABA\} (because an arrangment is fixed by (13)(24)(13)(24) only when the letter at positions 1,31,3 are equal, and the letters at positions 2,42,4 are equal),
  • S(1432)=S^{(1432)} = \varnothing.

So the possible number of arrangements is

S/C4=1C4(Sid+S(1234)+S(13)(24)+S(1432))=14(6+0+2+0)=2.\begin{aligned} |S/C_4| &= \frac{1}{|C_4|} (|S^{\op{id}}| + |S^{(1234)}| + |S^{(13)(24)}| + |S^{(1432)}|) \\ &= \frac{1}{4} (6 + 0 + 2 + 0) \\ &= 2. \end{aligned}

This is exactly what we wanted! In fact Burnside's lemma is enough for any version of our problem, but we continue further to explore a theorem by Pólya that generalises this.

Before moving on, note that if we let the set SS be the set of all 4-element arrangements of the letters A,BA,B (with replacement), then Burnside's lemma tells us the number of ways to arrange A,BA,B on a circle (with replacement). Particularly, orbits of the arrangements of AABBAABB is a subset of the set of orbits S/C4S/C_4. Pólya's theorem builds on this by describing the number of circle arrangements of every 4-letter combination of AA's and BB's inside S/C4.S/C_4.

Pólya's Enumeration Theorem

Preliminaries

On any permutation group (on finite elements), we can encapsulate its information in a polynomial.

Definition. Let gSng \in S_n be a permutation on nn elements, and let ci(g)c_i(g) be the number of ii-cycles in the disjoint cycle decomposition of gg. The cycle index of a permutation group GSnG \subseteq S_n is the polynomial

ZG(t1,t2,...,tn)=1GgGt1c1(g)t2c2(g)tncn(g).Z_G(t_1,t_2,...,t_n) = \frac{1}{|G|} \sum_{g \in G} t_1^{c_1(g)} t_2^{c_2(g)} \dots t_n^{c_n(g)}.

Example. Let G=C6G = C_6 be generated by the 66-cycle g=(123456)g = (123456). Then we have decompositions

ElementCycle DecompositionValue of ci()c_i(\cdot)
gg(123456)(123456)c6(g)=1c_6(g) = 1
g2g^2(135)(246)(135)(246)c3(g2)=2c_3(g^2) = 2
g3g^3(14)(25)(36)(14)(25)(36)c2(g3)=3c_2(g^3) = 3
g4g^4(153)(264)(153)(264)c3(g4)=2c_3(g^4) = 2
g5g^5(165432)(165432)c6(g5)=1c_6(g^5) = 1
g6g^6(1)(2)(3)(4)(5)(6)(1)(2)(3)(4)(5)(6)c1(g6)=6c_1(g^6) = 6

where all the other values of ci(gj)c_i(g^j) are 00. The cycle index is

ZC6(t1,...,t6)=16(t61+t32+t23+t32+t65+t15)=16(2t6+2t32+t23+t15).Z_{C_6}(t_1,...,t_6) = \frac{1}{6} (t_6^1 + t_3^2 + t_2^3 + t_3^2 + t_6^5 + t_1^5) = \frac{1}{6} (2t_6 + 2t_3^2 + t_2^3 + t_1^5).

This polynomial contains information about the types of elements in the group. For example 2t322t_3^2 says there are two elements which are the product of two cycles of length 33: g2=(135)(246)g^2 = (135)(246) and g4=(153)(264)g^4 = (153)(264). (The number of cycles in the decomposition isn't unrelated to the fact that gcd(6,2)=2=gcd(6,4)\gcd(6,2) = 2 = \gcd(6,4) but is not too important.)

Definition. Let CC and DD be sets, then CDC^D is the set of functions f:DCf: D \to C.

Proposition. If GG were a (finite) group acting on DD, then there is a GG-action on CDC^D defined by

(gf)(d)=f(g1d)(g \cdot f)(d) = f(g^{-1} \cdot d)

for any fCDf \in C^D and dDd \in D. We use the convention of naming the sets CC and DD because they correspond to colouring and domain. So each function fCDf \in C^D can be thought of assigning to each element of DD a colour in CC.

The main feature of Pólya's theorem is that it distinguishes between 'weights' of particular combinations of colours.

Definition. Let w:CRw: C \to \R be a function that assigns to each colour cCc \in C a weight w(c)Rw(c) \in \R. For fCDf \in C^D, define the weight of ff

W(f)=dDw(f(d)).W(f) = \prod_{d \in D} w(f(d)).

Proposition. Let f1,f2CDf_1,f_2 \in C^D be in the same GG-orbit, then W(f1)=W(f2)W(f_1) = W(f_2).

Proof. By definition there exists some gGg \in G such that f1(x)=(gf2)(x)=f2(g1x)f_1(x) = (g \cdot f_2)(x) = f_2(g^{-1} \cdot x). Then

W(f1)=dDw(f1(d))=dDw(f2(g1d))=dDw(f2(d))=W(f2).W(f_1) = \prod_{d \in D} w(f_1(d)) = \prod_{d \in D} w(f_2(g^{-1} \cdot d)) = \prod_{d \in D} w(f_2(d)) = W(f_2).

where the third equality follows from the invertibility of elements in GG. Then GG-actions are permutations on DD, so summing over every element of DD is the same as summing over every element of g1D={g1d:dD}g^{-1} \cdot D = \{g^{-1} \cdot d: d \in D\}.


Due to this property, we can assign a weight to entire orbits FCD/GF \in C^D/G, where W(F)=W(f)W(F) = W(f) for any fFf \in F.

Example. Consider the example of arranging 66 objects in a circle, where each object can be one of two letters AA or BB. (This will also motivate how we will use the weights for the problem of arranging elements in a circle.) Let D={1,2,3,4,5,6}D = \{1,2,3,4,5,6\} be the positions on the circle and C={A,B}C = \{A,B\} be the letters they could be assigned, and let C6C_6 act on CDC^D as above. Define ww so that w(A)=aw(A) = a and w(B)=bw(B) = b, where a,ba,b are numbers in R\R. Consider the function f1f_1 mapping 1,2,3A1,2,3 \mapsto A and 4,5,6B4,5,6 \mapsto B, and f2f_2 mapping 1,3,5A1,3,5 \mapsto A and 2,4,6B2,4,6 \mapsto B. We have

W(f1)=w(f1(1))w(f1(2))w(f1(3))w(f1(4))w(f1(5))w(f1(6))=aaabbb=a3b3W(f_1) = w(f_1(1)) w(f_1(2)) w(f_1(3)) w(f_1(4)) w(f_1(5)) w(f_1(6)) = aaabbb = a^3b^3

and

W(f2)=ababab=a3b3.W(f_2) = ababab = a^3b^3.

Notice that, even though they have the same weight, these functions don't belong to the same orbit, since AAABBBAAABBB and ABABABABABAB are not rotations of each other. So these weights lose information about the functions, but tells us how many times each letter appears, but nothing about their order. This is perfect for what we want!

Theorem

In general context, we think of CC as "colours", and fCDf \in C^D as colour assignments to elements in DD, or "colourings of DD". The problem we care about is: How many of colourings have a certain weight?

Theorem. (Pólya's Enumeration Theorem) Let C,DC,D be finite sets, GG a finite group acting on DD, and w:CRw: C \in \R be a weight function. Then the pattern inventory is

FCD/GW(F)=ZG(cCw(c),cCw(c)2,...).\sum_{F \in C^D/G} W(F) = Z_G\left(\sum_{c \in C} w(c), \sum_{c \in C} w(c)^2, ...\right).

The sum FCD/GW(F)\sum_{F \in C^D/G} W(F) is sometimes called the (multivariate) generating function for the different colourings of DD (the coefficient of each monomial, as a polynomial in the elements of CC, is the number of colourings corresponding to the monomial). Note that we can use any group action.

Proof. Starting with FW(F)\sum_F W(F), consider the possible weights

Ω={ω:W(f)=ω for some fCD}.\Omega = \{\omega: W(f) = \omega \text{ for some } f \in C^D\}.

Recall that the GG-action on DD induces a GG-action on CDC^D, so we can reindex the sum in terms of Ω\Omega to get

FCD/GW(F)=ωΩωSω/G,\sum_{F \in C^D/G} W(F) = \sum_{\omega \in \Omega} \omega |S_\omega/G|,

where Sω={f:DCW(f)=ωS_\omega = \{f: D \to C | W(f) = \omega, so Sω/G={FCD/G:W(F)=ω}S_\omega/G = \{F \in C^D/G: W(F) = \omega\} is the set of orbits which have weight ω\omega. (Note this uses the induced GG-action on CDC^D, which is well defined because GG maps orbits to themselves, and function weights are preserved within the orbits.) Using Burnside's Lemma,

FCD/GW(F)=ωΩω(1GgGSωg)=1GgGωΩωSωg\sum_{F \in C^D/G} W(F) = \sum_{\omega \in \Omega} \omega \left(\frac{1}{|G|} \sum_{g \in G} |S_\omega^g| \right) = \frac{1}{|G|} \sum_{g \in G} \sum_{\omega \in \Omega} \omega |S_\omega^g|

where SωgS_\omega^g is the subset of SωS_\omega fixed by gg, and we can switch the sums because they are finite.

It remains to prove that for fixed gGg \in G,

ωΩωSωg=(cCw(c))c1(g)(cCw(c)2)c2(g).\sum_{\omega \in \Omega} \omega |S_\omega^g| = \left(\sum_{c \in C} w(c)\right)^{c_1(g)} \left(\sum_{c \in C} w(c)^2\right)^{c_2(g)} \dots.

Write gg as a product of disjoint cycles. If we think of the terms in the expansion of the right hand side as a series of choices: c1(g)c_1(g) choices of cCc \in C for factors of w(c)w(c), c2(g)c_2(g) choices of cCc \in C for factors w(c)2w(c)^2 etc. Then each term is some product of D|D| weights such that the corresponding colour combination is fixed by gg, and its coefficient is how many ways this can be chosen. (This thought process is similar to counting monomials in an expanded binomial to obtain the binomial coefficients.) We can check that these choices are the only ways to get a colouring ff fixed by gg. Notice that for such a colouring f(CD)gf \in (C^D)^g, its weight W(f)W(f) is defined exactly as its corresponding monomial above. Therefore the right hand product is exactly

f(CD)gW(f)=ωΩfSωgW(f)=ωΩfSωgω=ωΩωSωg.\sum_{f \in (C^D)^g} W(f) = \sum_{\omega \in \Omega} \sum_{f \in S_\omega^g} W(f) = \sum_{\omega \in \Omega} \sum_{f \in S_\omega^g} \omega = \sum_{\omega \in \Omega} \omega |S_\omega^g|.

This concludes the proof.


Corollary. If we choose all the weights to be 11, the number of GG-orbits of CDC^D is ZG(C,...,C)Z_G(|C|,...,|C|).

Proof. For any orbit FCD/GF \in C^D/G, W(F)=1W(F) = 1 because it is a product of weights, which are all 11. Then

FCD/GW(F)=FCD/G1=CD/G.\sum_{F \in C^D/G} W(F) = \sum_{F \in C^D/G} 1 = |C^D/G|.

By Pólya's Enumeration Theorem,

CD/G=FCD/GW(F)=ZG(cCw(c),cCw(c)2,...)=ZG(cC1,cC1,...)=ZG(C,...,C).\begin{aligned} |C^D/G| &= \sum_{F \in C^D/G} W(F) \\ &= Z_G\left(\sum_{c \in C} w(c), \sum_{c \in C} w(c)^2, ...\right) \\ &= Z_G\left(\sum_{c \in C} 1, \sum_{c \in C} 1, ...\right) \\ &= Z_G(|C|,...,|C|). \end{aligned}

This retrieves Burnside's lemma. (This is exactly Burnside's lemma if D=1|D| = 1.)

Intuition

Following the proof gives us some intuition into how the right hand polynomial can be interpreted. Let us consider the example of colouring DD with colours in CC, and suppose the weights are indeterminates C1,...,CnC_1, ..., C_n which uniquely correspond to each colour c1,...,cnc_1, ..., c_n respectively.

It is easy to understand the left hand side: each GG-orbit of CDC^D corresponds to a particular colouring we want to think of as "identical" when acted on by elements of GG. Given an orbit FCD/GF \in C^D/G, W(F)W(F) is a product of weights w(c)w(c) for some cCc \in C. So in the sum of W(F)W(F) over all orbits FF, the coefficient of a monomial C1d1CndnC_1^{d_1} \dots C_n^{d_n} (where d1++dn=Dd_1 + \dots + d_n = |D|) will be the number of different ways D|D| can be coloured with d1d_1 of c1c_1, d2d_2 of c2c_2 etc. This tells us the looking at the coefficients of this polynomial gives us the "counting" information we want.

In the proof, we took this left polynomial and grouped it into orbits of the same weight. Doing this, we found that the coefficient of each possible function weight ω\omega is the number of GG-orbits of SωS_\omega (functions in SS with weight ω\omega). Burnside's lemma tells us that this number is just the average size of fixed sets of SωS_\omega, so the task of finding the coefficient of ω\omega is reduced to finding the size of fixed sets of SωS_\omega.

This information is captured by the coefficients of the product,

(cCw(c))c1(g)(cCw(c)2)c2(g)\left(\sum_{c \in C} w(c)\right)^{c_1(g)} \left(\sum_{c \in C} w(c)^2\right)^{c_2(g)} \dots

where each term is a series of choices to colour parts of DD fixed by a cycle in gg, altogether the choices correspond to one colouring fixed by gg. Collecting the terms of equal weight, we obtain the number of colourings of that weight that is fixed by gg.

Note: we also see that Pólya's theorem is essentially just Burnside's lemma applied to each weight.

Example 1

Let's return to our original problem, this time with a slightly harder example: How many different circular arrangements of the letters of XXYYZZXXYYZZ are there?

In Pólya's Enumeration Theorem, let D={1,2,3,4,5,6}D = \{1,2,3,4,5,6\}, C={X,Y,Z}C = \{X,Y,Z\}, and ww assign weights Xx,YyX \mapsto x, Y \mapsto y and ZzZ \mapsto z. Let G=C6G = C_6 be generated by (123456)(123456) (we listed its elements in a previous example), and act on DD by permuting the elements, then GG also acts on CDC^D as described earlier. To get intuition on what this action looks like, consider g=(123456)C6g = (123456) \in C_6 and fCDf \in C^D mapping 1,2,3,4,5,61,2,3,4,5,6 to X,X,Y,Z,Y,ZX,X,Y,Z,Y,Z respectively. Then

(gf)(1)=f(g11)=f(6)=Z(g \cdot f)(1) = f(g^{-1} \cdot 1) = f(6) = Z
(gf)(2)=f(g11)=f(1)=X(g \cdot f)(2) = f(g^{-1} \cdot 1) = f(1) = X
(gf)(3)=f(g11)=f(2)=X(g \cdot f)(3) = f(g^{-1} \cdot 1) = f(2) = X
(gf)(4)=f(g11)=f(3)=Y(g \cdot f)(4) = f(g^{-1} \cdot 1) = f(3) = Y
(gf)(5)=f(g11)=f(4)=Z(g \cdot f)(5) = f(g^{-1} \cdot 1) = f(4) = Z
(gf)(6)=f(g11)=f(5)=Y(g \cdot f)(6) = f(g^{-1} \cdot 1) = f(5) = Y

so gfg \cdot f maps 1,2,3,4,5,61,2,3,4,5,6 to Z,X,X,Y,Z,YZ,X,X,Y,Z,Y. Here (123456)(123456) permuted the image of ff like it permutes the elements of DD: rotating X,X,Y,Z,Y,ZZ,X,X,Y,Z,YX,X,Y,Z,Y,Z \to Z,X,X,Y,Z,Y. This is just how we expect C6C_6 to act on colourings, and is actually true in general. The theorem says we can calculate the right hand polynomial and look at the coefficients. In our case, the polynomial is

ZC6(cCw(c),cCw(c)2,...)=ZC6(x+y+z,x2+y2+z2,...)=1C6gC6(x+y+z)c1(g)(x2+y2+z2)c2(g)...(x6+y6+z6)c6(g)=16((x6+y6+z6)1+(x3+y3+z3)2+(x2+y2+z2)3+(x3+y3+z3)2+(x6+y6+z6)1+(x+y+z)6)=16(2(x6+y6+z6)+2(x3+y3+z3)2+(x2+y2+z2)3+(x+y+z)6)\begin{aligned} &Z_{C_6}\left(\sum_{c \in C} w(c), \sum_{c \in C} w(c)^2, ...\right) \\ &= Z_{C_6}(x + y + z, x^2 + y^2 + z^2, ...) \\ &= \frac{1}{|C_6|} \sum_{g \in C_6} (x + y + z)^{c_1(g)} (x^2 + y^2 + z^2)^{c_2(g)} ... (x^6 + y^6 + z^6)^{c_6(g)} \\ &= \frac{1}{6} ((x^6 + y^6 + z^6)^1 + (x^3 + y^3 + z^3)^2 + (x^2 + y^2 + z^2)^3 \\ &\hspace{20px} + (x^3 + y^3 + z^3)^2 + (x^6 + y^6 + z^6)^1 + (x + y + z)^6 ) \\ &= \frac{1}{6} (2(x^6 + y^6 + z^6) + 2(x^3 + y^3 + z^3)^2 + (x^2 + y^2 + z^2)^3 + (x + y + z)^6) \end{aligned}

(using the values for C6C_6 generated by (123456)(123456) we calculated in a previous example). We could endure the suffering of expanding this out, or just look at the coefficients of the terms we want. The following is a useful generalisation of the binomial theorem.

Theorem. (Multinomial Theorem) The coefficient of x1k1xmkmx_1^{k_1} \dots x_m^{k_m} (where k1++km=nk_1 + \dots + k_m = n) in the expansion of (x1++xm)n(x_1 + \dots + x_m)^n is

(nk1,,km)=n!k1!km!.\binom{n}{k_1, \dots, k_m} = \frac{n!}{k_1! \dots k_m!}.

Proof. Similar to that of binomial theorem.

For our purposes, we consider the coefficient of x2y2z2x^2 y^2 z^2.

  • It does not appear in (x6+y6+z6)(x^6 + y^6 + z^6) and (x3+y3+z3)2(x^3 + y^3 + z^3)^2
  • This term appears in (x2+y2+z2)3(x^2 + y^2 + z^2)^3 as (x2)1(y2)1(z2)1(x^2)^1 (y^2)^1 (z^2)^1 which has coefficient (31,1,1)=3!=6\binom{3}{1,1,1} = 3! = 6.
  • It also appears in (x+y+z)6(x + y + z)^6 as x2y2z2x^2 y^2 z^2 which has coefficients (62,2,2)=6!2!2!2!=90\binom{6}{2,2,2} = \frac{6!}{2!2!2!} = 90

Therefore the coefficient of x2y2z2x^2 y^2 z^2 in the pattern inventory is

16(6+90)=16.\frac{1}{6}(6 + 90) = 16.

We can check this is correct via a simple script.

Remarks. You may have noticed that multinomial coefficients are exactly how we were taught to count the permutations of letters with possibly some repeating. So it makes sense that it comes up when counting arrangements of the same letters in a circle.

Example 2

Here is another example illustrating an easier case. Let D={1,2,3,4,5,6,7}D = \{1,2,3,4,5,6,7\}, C={X,Y,Z}C = \{X,Y,Z\}, and ww assign weights Xx,YyX \mapsto x, Y \mapsto y and ZzZ \mapsto z. Let G=C7G = C_7 be generated by g=(1234567)g = (1234567) so the elements are

ElementCycle DecompositionValue of ci()c_i(\cdot)
gg(1234567)(1234567)c7(g)=1c_7(g) = 1
g2g^2(1357246)(1357246)c7(g2)=1c_7(g^2) = 1
g3g^3(1473625)(1473625)c7(g3)=1c_7(g^3) = 1
g4g^4(1526374)(1526374)c7(g4)=1c_7(g^4) = 1
g5g^5(1642753)(1642753)c7(g5)=1c_7(g^5) = 1
g6g^6(1765432)(1765432)c7(g6)=1c_7(g^6) = 1
g7g^7(1)(2)(3)(4)(5)(6)(7)(1)(2)(3)(4)(5)(6)(7)c1(g7)=7c_1(g^7) = 7

where all the other values of ci(gj)c_i(g^j) are 00. As before, this group acts on DD by permuting the elements and also acts on CDC^D. Then the pattern inventory is

ZC7(x+y+z,...,x7+y7+z7)=17(6(x7+y7+z7)+(x+y+z)7).Z_{C_7} (x+y+z,..., x^7 + y^7 + z^7) = \frac{1}{7}(6(x^7 + y^7 + z^7) + (x + y + z)^7).

This tells us that there is 17(6+1)=1\frac{1}{7}(6 + 1) = 1 circular arrangement for each of X7,Y7,Z7X^7, Y^7, Z^7, and for other powers there are

17(7k1,k2,k3)=177!k1!k2!k3!=6!k1!k2!k3!\frac{1}{7} \binom{7}{k_1,k_2,k_3} = \frac{1}{7} \frac{7!}{k_1! k_2! k_3!} = \frac{6!}{k_1! k_2! k_3!}

circular arrangements for Xk1Yk2Zk3X^{k_1} Y^{k_2} Z^{k_3} (where k1+k2+k3=7k_1 + k_2 + k_3 = 7).

Notice that we have this kind of polynomial because all the non-identity cycle decompositions are 77-cycles. In fact this happens exactly when the number of elements is prime.

Proposition. Let pp be prime. Then for DD where D=p|D| = p, C={A1,...,An}C = \{A_1,...,A_n\}, G=CpG = C_p, the pattern inventory is

1G((p1)cCw(c)p+(cCw(c))p).\frac{1}{|G|} \left((p-1)\sum_{c \in C} w(c)^p + \left(\sum_{c \in C} w(c)\right)^p\right).

That is, there are

1p(pk1,...,kn)=(p1)!k1!...kn!\frac{1}{p}\binom{p}{k_1, ..., k_n} = \frac{(p-1)!}{k_1! ... k_n!}

circular arrangements for c1k1...cnknc_1^{k_1} ...c_n^{k_n}, where k1+...+kn=pk_1 + ... + k_n = p and 0k1,...,kn<p0 \leq k_1, ..., k_n < p.

This shows that the naïve formula we started with works for non-trivial colourings of a prime number of elements.

Formula

Is there a nice general formula we can extract from this theorem? Not really, but we can pull something together.

Briefly, what we need to know is the following. (The first three points find the pattern inventory, and the last point find the desired coefficient.)

  • How large is CmC_m? It has mm elements
  • How do elements of CmC_m decompose into disjoint cycles? How large are these cycles and how many cycles are there?
    • If CmC_m is generated by g=(12...m)g=(12...m), then letting d=gcd(m,k)d = \gcd(m,k) we get that gkg^k is a product of dd disjoint m/dm/d-cycles.
  • How many elements have same cycle size and cycle lengths?
    • In the context of the previous point, there are Nd=#{k:1km s.t. gcd(m,k)=d}N_d = \#\{k : 1 \leq k \leq m \text{ s.t. } \gcd(m,k) = d\} cycles 'similar' to gkg^k. This tells us how many times (c1m/d+c2m/d+...)d(c_1^{m/d} + c_2^{m/d} + ...)^d appears in the pattern inventory.
    • There is no 'nice' equation for this number (it could be expressed in terms of the Möbius function).
  • Which of these multinomials has our pattern x1k1x2k2...x_1^{k_1} x_2^{k_2} ...?
    • This can be done by checking iki=m\sum_i k_i = m and m/dkim/d \mathrel{|} k_i for all ii, for each multinomial (c1m/d+c2m/d+...)d(c_1^{m/d} + c_2^{m/d} + ...)^d.

So given a valid list of 'colours' x1k1x2k2...x_1^{k_1} x_2^{k_2} ..., the coefficient in the pattern inventory (i.e. the number of arrangements of these colours) looks something like

1mdm(m/d)ki,iNd(dk1m/d,k2m/d,...).\frac{1}{m} \sum_{\substack{d | m \\ (m/d) | k_i, \forall i}} N_d \binom{d}{\frac{k_1}{m/d}, \frac{k_2}{m/d}, ...}.

Additional Comments and Material

We only looked at cyclic groups CnC_n, but we could use any subgroup of SnS_n. For example if we think of reflections of our circular arrangements as "identical", then we can use the dihedral group DnD_n. The orbits under the dihedral group is exactly the distinct "circular arrangements" we want.

The theorem can also be applied for various different counting problems, by changing the weights and subgroup of SnS_n. For example, Pólya applied this theorem to count the number of isomers of hydrocarbons, which popularised its usage.

This post was based on the following. These are good reading if you want to explore this topic more.

Copyright © 2024 dustbringer