How to Rob a Jewelry Store with Algebraic Topology
October 10, 2026 · 41 min read
Suppose two thieves steal an open necklace.
The necklace is an open chain composed of beads made from different gemstones: rubies, emeralds, sapphires, diamonds, and so on. Each gemstone variety appears an even number of times in total, say beads of type , but the beads are strung together in a completely arbitrary, chaotic sequence.
The thieves want to divide their loot fairly. Each thief must receive exactly half of every single gem variety: rubies, emeralds, and so on.
Naturally, neither thief wants to cut between every single bead. Doing that would destroy the string into thousands of individual fragments. They want to make the absolute minimum number of cuts along the necklace string to divide the necklace into contiguous segments, which are then distributed between the two thieves.
Here is the central question:
Given an arbitrary necklace with varieties of gems, what is the minimum number of cuts that guarantees a fair split, regardless of how long the necklace is or how maliciously the beads are ordered?
1. Ten Million Beads, Only k Cuts
Let us test our intuition on small values of :
- For variety (e.g. only rubies): A single cut () always suffices. If there are rubies, you simply count to the -th ruby and cut the string immediately after it. Thief 1 gets the left half, and Thief 2 gets the right half.
- For varieties (e.g. rubies and emeralds): Suppose all rubies are grouped on the left and all emeralds on the right: A single cut cannot help you: any single cut gives one thief all or almost all of one color. But 2 cuts work easily: cut out an interval in the middle that contains rubies and emeralds. Thief 1 takes that middle segment, and Thief 2 takes the two outer ends!
Can 2 cuts handle any arrangement of 2 gem colors, even if the necklace has 50,000 beads scattered in an alternating mess?
Yes. In fact, in 1987, mathematician Noga Alon proved a celebrated general result:
The Necklace Splitting Theorem (Alon, 1987):
For any necklace containing different types of beads with an even count of each type, cuts are always sufficient to divide the necklace so that both thieves receive exactly half of every bead type.
Think about how counter-intuitive this is. If a necklace contains types of gems and 10,000,000 beads arranged in the most adversarial, chaotic sequence imaginable, you never need more than 4 cuts.
Furthermore, cuts is strictly optimal in the worst case. If the colors are segregated into contiguous blocks (), any valid partition requires at least cuts because each color boundary must be intersected to divide each block in half.
Yet, if you try to prove this theorem using discrete mathematics (induction, Hall’s marriage theorem, or the pigeonhole principle), you will run into a wall. The discrete combinatorics of cuts and color permutations is overwhelmingly complex.
The breakthrough comes from a completely unexpected direction: continuous algebraic topology.
2. Melting Discrete Gems into Smooth Density
The discrete problem is difficult because beads are granular integer objects. To make progress, we take a standard detour: we turn the discrete necklace into a continuous interval.
Imagine laying the necklace along the continuous unit interval .
Instead of counting discrete beads, we define continuous probability measures on . Each measure represents the continuous density of the -th gemstone variety along the string.
For any sub-interval , denotes the fraction of gem variety that lies inside . By definition:
Because these measures are continuous, they place zero measure on individual points: .
The continuous version of our puzzle can now be stated cleanly:
Continuous Necklace Problem:
Can we find cut points dividing into segments: and assign each segment either to Thief 1 or Thief 2 such that for every single measure :
3. The Sphere That Encodes Every Cut
How can we parameterize all possible ways to place cuts and assign segments to the two thieves?
Consider the unit -dimensional sphere embedded in -dimensional Euclidean space :
Every point directly encodes a complete partition and assignment of the continuous necklace!
Here is the dictionary:
- Segment Lengths: For each coordinate , define the length of segment to be: Since by definition of the sphere, these lengths sum to exactly 1. They tile the unit interval perfectly!
- Cut Positions: The cut points are simply the cumulative partial sums of :
- Thief Assignment: The sign of each coordinate specifies which thief gets the corresponding segment:
- If , segment is given to Thief 1.
- If , segment is given to Thief 2.
- If , segment has length zero (a degenerate segment), which simply means fewer than cuts were needed.
Now ask yourself: what happens if we take the antipodal point on the sphere?
- The length of each segment is , which is completely unchanged.
- The cut locations are completely unchanged.
- But every single sign is flipped: every segment that previously belonged to Thief 1 now belongs to Thief 2, and vice versa!
In other words:
This antipodal symmetry is the golden key to the entire proof.
4. Opposite Poles Swap the Loot
Now let us measure how unfair a given division is.
For each gemstone variety , we compute the net difference between what Thief 1 receives and what Thief 2 receives under the partition defined by :
where if , if , and if .
Combining these measurements into a single vector gives a continuous map from the -sphere to -dimensional Euclidean space:
What happens to when we evaluate it at the antipodal point ?
Therefore:
The map is an odd (antipode-preserving) continuous function.
If we can find a point where , then: which means Thief 1 and Thief 2 receive identical measures of every single gemstone variety. Since , each thief receives exactly of each color!
Does such a point guaranteed to exist?
5. The Borsuk-Ulam Killshot
To guarantee the existence of our fair partition point , we bring in one of the most famous results in algebraic topology:
The Borsuk-Ulam Theorem (Karol Borsuk, 1933):
For any continuous map , there exists at least one pair of antipodal points such that:
A familiar real-world consequence of this theorem for is that on the surface of the Earth (modeled as ), there are always two antipodal locations with the exact same temperature and atmospheric pressure simultaneously.
Now apply the Borsuk-Ulam Theorem directly to our discrepancy function :
There must exist some point such that:
However, we already established from the physics of our segment assignment that is an odd function:
Equating the two yields:
This is the entire proof.
Because , every single gemstone measure is partitioned with zero discrepancy:
And how many cuts were used? Since has coordinates, the interval is split into at most sub-intervals, which requires at most cuts.
6. You Can’t Slice an Emerald in Half (The Rounding Step)
At this point, a careful reader will object:
“Wait! The continuous theorem allows you to cut the interval at arbitrary real numbers. What happens if a cut lands right through the middle of an emerald? You cannot slice a gemstone in half!”
This is where the discrete rounding argument completes the picture.
Suppose our discrete necklace has total beads, with beads of color . We place each bead along the unit interval as a small sub-interval of length . Specifically, the -th bead occupies .
We apply the continuous theorem to obtain cut points.
If all cut points land cleanly on bead boundaries , we are done: each thief receives an integer set of intact beads, and because the continuous measures evaluate to for each color, both thieves get exactly beads of each color .
What if some of the cuts fall strictly inside beads?
Because there are at most cuts, at most beads can be cut internally. Each such cut divides a bead into two fractions.
Alon showed that one can set up a small system of linear equations matching the fractional assignments. Since each bead type has an even total count , the polyhedron of fair fractional allocations has integer vertices. By shifting the cut locations slightly to the left or right within the bead boundaries, all fractional allocations can be eliminated without changing the total count of any gem type or requiring any additional cuts.
Thus, the discrete theorem holds unconditionally.
7. Slicing a Real Necklace in Python
To see how fair cuts look in practice, consider a small necklace with colors: 8 rubies () and 6 emeralds ():
necklace = ['R', 'R', 'E', 'E', 'E', 'R', 'R', 'R', 'E', 'R', 'R', 'E', 'E', 'R']The total counts are 8 and 6 . A fair share is exactly 4 and 3 per thief.
By the Necklace Splitting Theorem, 2 cuts must always exist that achieve this split.
Here is a short script verifying all possible 2-cut partitions:
def check_necklace_splits(beads, k_colors=2): n = len(beads) total_counts = {} for b in beads: total_counts[b] = total_counts.get(b, 0) + 1
target = {color: count // 2 for color, count in total_counts.items()} print(f"Total beads: {n} | Targets per thief: {target}")
valid_cuts = [] # Test all pairs of cuts (cut1, cut2) with 0 < cut1 < cut2 < n for c1 in range(1, n): for c2 in range(c1 + 1, n): # Segment 1: [0, c1], Segment 2: [c1, c2], Segment 3: [c2, n] # Thief 1 gets Segment 2 (middle) # Thief 2 gets Segments 1 and 3 (ends) t1_beads = beads[c1:c2] t1_counts = {color: t1_beads.count(color) for color in target}
if t1_counts == target: valid_cuts.append((c1, c2))
return valid_cuts
beads = ['R', 'R', 'E', 'E', 'E', 'R', 'R', 'R', 'E', 'R', 'R', 'E', 'E', 'R']solutions = check_necklace_splits(beads)print(f"Found {len(solutions)} fair 2-cut solutions: {solutions}")Running this script reveals valid cut positions such as cuts at indices (4, 11):
- Segment 1 (Thief 2):
['R', 'R', 'E', 'E'](2 R, 2 E) - Segment 2 (Thief 1):
['E', 'R', 'R', 'R', 'E', 'R', 'R'](5 beads? Let us check: 4 R, 3 E) - Segment 3 (Thief 2):
['E', 'R'](1 R, 1 E) - Thief 2 total: R, wait, exactly 4 R and 3 E! Both thieves receive identical loot.
8. More Thieves and the PPA Complexity Trap
The story does not end with two thieves.
Scaling Up to m Thieves
Noga Alon extended the theorem to arbitrary thieves:
If a necklace contains types of beads, and each bead type appears a multiple of times (), then cuts are always sufficient to divide the necklace equally among all thieves.
For , , which matches our theorem.
The proof for general is even more advanced: instead of the simple -antipodal action of the Borsuk-Ulam theorem, it uses topological fixed-point theorems for prime cyclic group actions acting on products of unit spheres and Stiefel manifolds.
Guaranteed to Exist, Intractable to Find
The Borsuk-Ulam theorem guarantees that a fair partition exists, but it is non-constructive: it gives no efficient algorithm to find the cut points.
In 2019, computer scientists Aris Filos-Ratsikas and Paul Goldberg resolved a long-standing question about the computational difficulty of finding these cuts:
Theorem (Filos-Ratsikas & Goldberg, 2019):
Computing the cuts in the Necklace Splitting problem is PPA-complete (Polynomial Parity Argument).
PPA is the complexity class that captures problems whose existence is guaranteed by topological parity arguments (like Sperner’s Lemma and the Borsuk-Ulam theorem). It contains other famous hard problems, such as finding Nash equilibria in certain non-cooperative games.
Even though topology guarantees a fair split exists, actually finding where to make the cuts on a large necklace is computationally intractable in the worst case.
The Takeaway
The Necklace Splitting Theorem is a great example of the power of topological combinatorics:
- You start with an apparently messy discrete puzzle about indivisible beads and cuts.
- You continuous-ize the problem by mapping beads to probability measures on .
- You realize that all cut locations and thief assignments can be encoded as coordinates on a unit sphere , where antipodal points naturally swap the thieves.
- The Borsuk-Ulam theorem immediately forces a zero-discrepancy point to exist on the sphere.
- You round back to discrete beads.
It is a really clean example of how framing a discrete problem geometrically can turn an otherwise messy proof into something intuitive.