Skip to main content

Practice · 3 of 3

The Mirror Configurations

CHALLENGE
Difficulty: advanced+25 XP

**Scenario.** Count distinct colorings of a necklace of n ≤ 18 beads with k colors, where two colorings count once if related by rotation. Direct 2-coloring enumeration with dedup works for n=18. What general principle handles it elegantly? **Which approach is the best fit? The program only needs to print the letter.** **A)** Sort all colorings lexicographically and remove adjacent duplicates **B)** Group by rotation class: each equivalence class contributes once, countable via the orbit structure **C)** Only enumerate colorings where the first bead has the smallest color index **D)** Use floating-point angles to detect rotational symmetry

Back to lesson: Practice: Observation Drills