Coloring the Square. Burnside’s lemma.

combinatoricsdiscrete mathematicspolya-counting-theory

Question from my last exam:

We paint the vertices of a square with five colors: A, B, C, D, and E. Two ways of painting are considered identical if one can be transformed into the other through an isometry of the square, possibly combined with swapping the colors $A \leftrightarrow B$ or $C \leftrightarrow D$. For example, the squares ${ }_{C A}^{A B}$, ${ }_{B A}^{C B}$, and ${ }_{A D}^{B A}$ are considered identical, but different from ${ }_{C A}^{B A}$. Find the number of different ways to paint the square.

Usually, when solving such problems, I had to create a table like the one below and manually count all the fixed points. Then, using Burnside's lemma, I had to calculate the average, which would be the result.

For example, for coloring the midpoints of opposite edges, we have $3+8$, because when using one color, we have $3$ options (the whole square is colored with A, C, or E), and for two colors, we have:

  • $A, B = B, A$ (where the first letter represents the color of the first pair of vertices, and the second letter represents the color of the second pair of vertices)
  • $C, D = D, C$
  • $A, C = B, C = A, D = B, D$
  • $C, A = C, B = D, A = D, B$
  • $A, E = B, E$
  • $E, A = E, B$
  • $C, E = D, E$
  • $E, C = E, D$

And the table looks like this:

Rotation Number of Fixed Points
Identity
$180^{\circ}$ (2x) (midpoints of opposite edges) $3+8$
$180^{\circ}$ (2x) (opposite vertices)
$90^{\circ}$ (center of the square)
$180^{\circ}$ (center of the square)
$270^{\circ}$ (center of the square)

Apparently, this time, it is not the expected method to solve the problem, and it's not surprising because it would take quite a lot of time and cases to consider. What is another way to count these colorings?

Best Answer

This can be done using Power Group Enumeration, where we cover the cycles of the slot permutation group with cycles of the group acting on the colors. We require the cycle indices of the two groups. We get for the slots (symmetries of the square) that they are:

  • identity, $a_1^4$,
  • horizontal / vertical flip, $2 a_2^2$,
  • diagonal flip, $2a_1^2 a_2$,
  • rotation, $90^\circ$: $a_4$,
  • rotation, $270^\circ$: $a_4$ and last,
  • a rotation by $180^\circ$: $a_2^2.$

This yields the the cycle index

$$Z(Q) = \frac{1}{8} (a_1^4 + 2 a_1^2 a_2 + 3 a_2^2 + 2 a_4).$$

The cycle index for the colors is by inspection

$$Z(C) = \frac{1}{4} (b_1^5 + 2 b_1^3 b_2 + b_1 b_2^2).$$

Examining all the pairs we get a contribution of

$b_1^5$ $2b_1^3 b_2$ $b_1 b_2^2$
$a_1^4$ $5^4 = 625$ $2\times 3^4 = 162$ $1^4 = 1$
$2a_1^2a_2$ $2\times 5^2 \times 5 = 250$ $4\times 3^2 \times (3 + 2) = 180$ $2\times 1^2 \times (1+2\times 2) = 10$
$3a_2^2$ $3\times 5^2 = 75$ $6\times (3+2)^2 = 150$ $3\times (1+2\times 2)^2 = 75$
$2a_4$ $2\times 5 = 10$ $4\times (3+2) = 20$ $2\times (1+2\times 2) = 10$

Adding everything up and averaging over $32$ we have at last

$$\bbox[5px,border:2px solid #00A000]{49}$$

colorings. As for this being an exam problem, the amount of computation required and the order of the values that appear presumably makes it possible to do it in about fifteen minutes supposing the author is sure of their arithmetic.

Remark on the PGE algorithm. The heart of the PGE algorithm is to compute the number of orbits by Burnside's lemma which says to average the number of assignments fixed by the elements of the power group. But this number is easy to compute. Suppose we have a permutation $\alpha$ from the slot permutation group $Q$ and a permutation $\beta$ from $C$. If we place the appropriate number of complete, directed and consecutive copies of a cycle from $\beta$ on a cycle from $\alpha$ then this assignment is fixed under the power group action for $(\alpha,\beta)$ , and this is possible iff the length of the cycle from $\beta$ divides the length of the cycle from $\alpha$ . The process yields as many assignments as the length of the cycle from $\beta$.

For example, with the pair $a_1^2 a_2$ and $b_1^3 b_2$ we can cover an instance of $a_1$ with instances of $b_1$ of which there are three, producing $3^2.$ The cycle $a_2$ can be covered with instances of $b_1$ or instances of $b_2$, producing $3+2.$ (There is only one instance of $b_2$.)

Related Question