Pattern Reference
Burnside's Lemma
"Count distinct objects under group action. Orbit-counting, necklace/bracelet enumeration, Polya enumeration."
Loading...
Deep Dive Tutorial
Burnside's lemma: distinct colorings = (1/|G|) × Σ(fixed points under each symmetry). For a necklace with n beads and k colors: the rotation group has n elements. Rotation by i positions fixes a coloring iff the coloring has period gcd(i,n). Fixed colorings under rotation-by-i = k^gcd(i,n). Sum over i=0..n-1 and divide by n.
Burnside's lemma for necklace counting
// Count distinct necklaces with n beads and k colors (rotations only)
function countNecklaces(n, k) {
const gcd = (a, b) => b ? gcd(b, a % b) : a;
let total = 0;
for (let i = 0; i < n; i++) {
// Rotation by i: fixed colorings = k^gcd(i,n)
total += Math.pow(k, gcd(i, n));
}
return total / n;
}
// Count distinct bracelets (rotations AND reflections)
function countBracelets(n, k) {
const gcd = (a, b) => b ? gcd(b, a % b) : a;
let total = 0;
// Rotations (n symmetries)
for (let i = 0; i < n; i++) total += Math.pow(k, gcd(i, n));
// Reflections (n symmetries)
if (n % 2 === 0) {
// n/2 reflections through pairs of opposite beads: each fixes k^(n/2+1) colorings
// n/2 reflections through midpoints of opposite edges: each fixes k^(n/2) colorings
total += (n / 2) * Math.pow(k, n / 2 + 1);
total += (n / 2) * Math.pow(k, n / 2);
} else {
// n reflections each through one bead and midpoint of opposite edge
total += n * Math.pow(k, (n + 1) / 2);
}
return total / (2 * n);
}Worked Problems
rotate-ccw
Burnside's formula: distinct colorings = (1/|G|) × Σ_{g∈G} k^(cycles of g on objects)
Necklace vs bracelet:
- Necklace: rotations only (group of size n)
- Bracelet: rotations + reflections (dihedral group of size 2n)
Necklaces with n beads, k colors:
(1/n) × Σᵢ₌₀ⁿ⁻¹ k^gcd(i,n)
Pólya enumeration theorem: Extends Burnside's to count by type (how many with exactly r₁ of color 1, r₂ of color 2...). Uses the cycle index polynomial.
Application pattern: Whenever problem says "distinct up to rotation" or "distinct up to symmetry" → Burnside's lemma.
Necklace vs bracelet:
- Necklace: rotations only (group of size n)
- Bracelet: rotations + reflections (dihedral group of size 2n)
Necklaces with n beads, k colors:
(1/n) × Σᵢ₌₀ⁿ⁻¹ k^gcd(i,n)
Pólya enumeration theorem: Extends Burnside's to count by type (how many with exactly r₁ of color 1, r₂ of color 2...). Uses the cycle index polynomial.
Application pattern: Whenever problem says "distinct up to rotation" or "distinct up to symmetry" → Burnside's lemma.