Decorating Christmas Trees with Group Theory
Applying Burnside's lemma and Polya's enumeration theorem to quantify the number of patterns I can choose to arrange the baubles on my Christmas tree.
Beyond the Tinsel
Hanging baubles on my family’s Christmas tree, I wondered: in how many ways could I arrange them? The answer hinges on what “distinct” means. If I rotate the tree, is the new pattern the same as the old one? This question pulled me back into group theory and combinatorial enumeration.
This post applies Polya’s enumeration theorem and Burnside’s lemma to count distinct bauble patterns. (I assume an unlimited supply of each bauble type, and that the cats leave them alone.) Both results collapse astronomical pattern counts into manageable numbers by exploiting symmetry1.
Here is a very basic approximation of my Christmas tree. Try changing the bauble types, number of levels and rotational segments:
Christmas Tree Pattern Explorer
Explore combinatorial patterns with baubles
Configuration
Combinatorics
Formulas used:
• Vertical: (n-1)!
• Horizontal: n!
• Total: n^(k×m)
• Rotational: n^(k×m) / m
Tree Visualization
Current Pattern
Baubles arranged in vertical stripes around the tree
The number of patterns shoots up even with very small parameters. With just three bauble types, five levels and four positions per level, we get over 3.4 billion total arrangements (
Counting Patterns
The Naive Approach
Starting from the beginning, if I have:
bauble types (e.g., red, blue, gold) levels (horizontal rings on the tree) positions per level (equally spaced around the tree)
Then the total number of arrangements is:
For example, with three colours, five levels and eight positions per level:
That figure is absurd because it counts every rotation of a pattern as a different pattern, and nobody looking at a tree does.
Rotational Symmetry: Burnside’s Lemma
My tree is perfectly conical, so it has rotational symmetry. Rotating the pattern by one position doesn’t create a new pattern; it merely changes the viewing angle. The mathematical tool for handling this is Burnside’s lemma, a group theory result that counts distinct objects under group actions.
In plain English:
is the set of all possible bauble arrangements is the group of rotations (there are rotations for positions) is the set of arrangements fixed by rotation (unchanged when you rotate) is the number of distinct patterns (equivalence classes under rotation)
In words: the number of distinct patterns equals the average number of patterns fixed by each rotation.
Worked Example: 4-Bead Necklace
I’ll use the classic “necklace problem” to illustrate. Suppose I want to count distinct necklaces with four beads and two colours (red and blue). Naive counting gives
Enumerating over each rotation:
- Identity (0° rotation): all 16 patterns are “fixed” by doing nothing
- Rotate by 90°: a pattern is fixed only if all beads are the same colour, so two patterns (all red or all blue)
- Rotate by 180°: a pattern is fixed if opposite beads match, so
patterns - Rotate by 270°: same as the 90° rotation, so two patterns fixed
Applying Burnside’s lemma:
So there are six distinct patterns, or equivalence classes. Let me verify by listing them, with the size of each class in brackets:
- All red, RRRR (1)
- All blue, BBBB (1)
- One red: RBBB ~ BRBB ~ BBRB ~ BBBR (4)
- One blue: BRRR ~ RBRR ~ RRBR ~ RRRB (4)
- Alternating: RBRB ~ BRBR (2)
- Two adjacent pairs: RRBB ~ BRRB ~ BBRR ~ RBBR (4)
The class sizes come to
Cycle Structure: Polya Enumeration
Burnside’s lemma calculates how many distinct patterns exist. Polya’s enumeration theorem uses the cycle structure of permutations for more efficient counting. When a necklace is rotated, positions move in cycles. For example:
- Rotating a four-bead necklace by one position gives
: one cycle of length 4 - Rotating by two positions gives
and : two cycles of length 2
For a pattern to be fixed by a rotation, all beads in the same cycle must have the same colour. If a rotation has
- Rotating by
positions in a necklace of beads creates cycles - Each cycle has length
For the 4-bead example:
- Rotate by 1:
cycle fixed patterns - Rotate by 2:
cycles fixed patterns - Rotate by 3:
cycle fixed patterns - Identity:
cycles fixed patterns
Average:
Try it yourself with different parameters. In the “Burnside’s Lemma” tab, experiment with the necklace; in the “Polya Enumeration” tab, explore cycle structure. Notice how the number of cycles determines fixed patterns.
Polya Enumeration & Burnside's Lemma
Deep dive into combinatorial counting under group actions
Burnside's Lemma
|X/G| = (1/|G|) × Σg∈G |Xg|
Number of distinct patterns = (1/group size) × sum of patterns fixed by each symmetry
Necklace Example
Rotation Analysis
All Unique Necklaces
#1
#2
#3
#4
#5
#6
Showing 6 distinct necklaces out of 16 total arrangements
Square Rotation Example
Rotation Groups
Identity - all patterns fixed
All corners same color
Opposite corners match
All corners same color
Calculation
Total patterns without symmetry: 16
Sum of fixed points: 24
Number of rotations: 4
Unique patterns = 24 / 4 = 6
Pattern Inventory Extension
Polya’s theorem extends further. Instead of counting total patterns, we can track patterns by properties using generating functions. For instance: “how many distinct necklaces have exactly three red and five blue beads?” That means replacing the plain count
Setting every
Bringing It All Together
Now I can apply these results to my Christmas tree. The calculator below uses both Burnside’s lemma and Polya’s theorem to count distinct patterns. Try different parameters and notice how even modest rotational symmetry (4-fold, 8-fold) cuts the pattern space by close to the order of the group.
Christmas Tree Pattern Calculator
Apply Burnside's lemma and Polya's theorem to count distinct decoration patterns
Tree Parameters
Number of distinct bauble colors/types
Horizontal rings on the tree
Baubles around each level (rotational symmetry)
Total positions: 5 × 4 = 20 baubles
Pattern Counts
Burnside's Lemma:
Distinct = (1/4) × (3486784401 + 243 + 59049 + 243)
= (1/4) × 3.49 billion = 871.71 million
Polya Enumeration: Rotation Breakdown
For each rotation, we calculate the number of cycles using GCD, then count fixed patterns as n^(cycles).
| Rotation | Cycles | Formula | Fixed Patterns |
|---|---|---|---|
| Identity (0°) | 20 | 3^20 | 3.49 billion |
| 90° | gcd(4, 1) × 5 = 5 | 3^5 | 243 |
| 180° | gcd(4, 2) × 5 = 10 | 3^10 | 59,049 |
| 270° | gcd(4, 3) × 5 = 5 | 3^5 | 243 |
Key Formula
For rotation by r positions on a circular arrangement of m positions:
cycles = gcd(m, r) × k
fixed patterns = n^cycles
Why This Works
GCD determines how many independent cycles exist when rotating. Each cycle must be monochrome for the pattern to be fixed. With k levels, we multiply by k since each level rotates independently.
Result: By exploiting 4-fold rotational symmetry, we reduced 3.49 billion arrangements down to 871.71 million distinct patterns - a 4.0× reduction!
Final Thoughts
Abstract algebra turns an intractable counting problem into a short sum. Quintillions of possibilities collapse to a number you can print, and the work is one greatest common divisor per rotation.
Burnside’s lemma and Polya’s theorem apply wherever you have:
- A set of objects with labels/colours
- A group action (rotations, reflections, permutations)
- A question about “distinct” configurations
Complexity increases further if you have unequal bauble counts or add dimensions like time.
Next time I’m decorating the tree with my family, I’ll know that what looks like infinite choice has a countable structure underneath. The cats will still find a way to disrupt whichever pattern I choose.
For a related application, see my investigation into Trias (Terni Lapilli), where I applied group theory to find optimal strategy.
Appendix: GCD and Cycles
This appendix ties together number theory, group theory, and combinatorics in our necklace and Christmas tree application.
How GCD Determines Cycles
Setup: You have a necklace with
Answer: Exactly
Concrete Example: 6-bead necklace
Label the beads 0, 1, 2, 3, 4, 5.
Rotate by 2 positions (each bead moves 2 spots to the right, wrapping around):
- Bead 0 → 2 → 4 → 0 (cycle of length 3)
- Bead 1 → 3 → 5 → 1 (cycle of length 3)
So we have 2 cycles. And indeed:
Rotate by 4 positions:
- Bead 0 → 4 → 2 → 0 (cycle of length 3)
- Bead 1 → 5 → 3 → 1 (cycle of length 3)
Again 2 cycles. And:
Rotate by 1 position:
- Bead 0 → 1 → 2 → 3 → 4 → 5 → 0 (one big cycle of length 6)
1 cycle. And:
Rotate by 3 positions:
- Bead 0 → 3 → 0 (cycle of length 2)
- Bead 1 → 4 → 1 (cycle of length 2)
- Bead 2 → 5 → 2 (cycle of length 2)
3 cycles. And:
Why GCD?
GCD works because beads return to their starting position after some rotations.
If you rotate by
It returns to
Each cycle has length
The Three-Way Connection
1. Number Theory (GCD)
The greatest common divisor determines the cycle structure. This is pure number theory: properties of integers under division.
2. Group Theory (Cycles)
A rotation is a permutation in the symmetric group
3. Combinatorics (Pattern Counting)
For a pattern to be fixed by a rotation, all beads in the same cycle must have the same colour.
With
For rotation by
What This Saves
You do not need to trace bead movements or build cycles manually. A single GCD calculation gives you the entire cycle structure:
- Number of cycles:
- Length of each cycle:
- Fixed patterns:
Euclid’s algorithm computes this efficiently.
Footnotes
-
Obviously my Christmas tree is perfectly conical, has branches that are strong enough to support the baubles and there aren’t any weird patches of dense or sparse branches. ↩