Hat Swaps

In the homework for my STEP program, I gave the following challenge problem.

Puzzle. My sages each wear a hat of a different color. As in standard hat puzzles, they can see everyone else’s hat color. Unlike in many other hat puzzles, they know the color of their own hat as well. I announce which color each of them should end up wearing; this assignment is a permutation of the original colors. Each sage is allowed one swap of hats with another person per day. They have two days to rearrange the hats so that everyone ends up with the correct color. Can they do it?

Many students noticed that the permutation can be decomposed into disjoint cycles and suggested solving the problem cycle by cycle. A few of them even pushed this idea all the way to a complete solution. However, none of them connected the puzzle to a topic we had discussed in class: dihedral groups.

Here is an elegant way to finish the solution once the permutation is decomposed into cycles. A cyclic permutation on n elements can be viewed as a rotation of an n-gon. Any rotation of an n-gon can be written as a product of two reflections. Each reflection of an n-gon, viewed as a permutation, consists only of 1- and 2-cycles. Ta-da!


Share:Facebooktwitterredditpinterestlinkedinmail

One Comment

  1. Konstantin:

    See also https://www.kvant.digital/problems/m1069/

Leave a comment