For a few months in 1880, entire swaths of the United States succumbed to an addiction the likes of which had never been seen. “It has become literally an epidemic all over the country,” wrote the Weekly News-Democrat in Emporia, Kansas, on March 12, 1880. “Whole cities are distracted, and men are losing sleep and going crazy over it.” The epidemic spread to Europe and as far as Australia and New Zealand.

The disease was a new obsession: a frustratingly simple mechanical game called the 15-puzzle. Still familiar today, it consists of a four-by-four grid in which you slide 15 numbered tiles around, trying to put the numbers in sequence.

The game seems quaint by today’s standards, but in 1880, it was all the rage. “No child is too puerile to be beneath its entertaining powers, and no man is too vigorous or in too high station to escape its fascination,” the News-Democrat wrote. The frustration, perhaps, stemmed from the mathematically proven fact that only half of the puzzle configurations are solvable (likely unbeknownst to the addicted).

Now, nearly 140 years later, the 15-puzzle is of interest again, this time not as a distraction, but as a way to understand a seemingly unrelated and much more complex puzzle: how magnets work.

Permanent magnets such as the ones on your refrigerator are magnetic because of a phenomenon called ferromagnetism. In a ferromagnet, the spins of electrons align, collectively generating a magnetic field. More specifically, metals such as iron, cobalt and nickel demonstrate itinerant ferromagnetism, which refers to the fact that their electrons can move around freely within the material. Each electron also has an intrinsic magnetic moment, but to understand exactly how and why all those magnetic moments align in a magnet demands calculating the quantum interactions among all the electrons, which is prohibitively complex.

“Itinerant ferromagnetism is actually one of the hardest problems in theoretical condensed matter physics,” said Yi Li, a physicist at Johns Hopkins University.

But Li and two graduate students, Eric Bobrow and Keaton Stubis, may be just a bit closer to solving the problem. Using the mathematics of the 15-puzzle, they expanded a well-known theorem that describes an idealized case of itinerant ferromagnetism. In their new analysis, published in the journal Physical Review B, they extend the theorem to explain a broader and more realistic system, potentially leading to a more rigorous model of how magnets work.

“This is a beautiful paper,” said Daniel Arovas, a physicist at UC San Diego. “Especially because rigorous results for the case of itinerant ferromagnets are rather few and far between, I really like this work.”

Hole Hop

At the most basic level, electrons in a metal have to abide by two big constraints. First, they’re all negatively charged, so they all repel one another. In addition, electrons must obey the so-called Pauli exclusion principle, which states that no two particles can occupy the same quantum state. This means that electrons with the same property of “spin”—which is proportional to the electron’s magnetic moment—cannot occupy the same quantum state around an atom in the metal. Two electrons with opposite spins, however, can.

It turns out the easiest way for an ensemble of freely moving electrons to satisfy both their mutual repulsion and the constraints of the Pauli exclusion principle is for them to stay apart and for their spins to align—and thus become ferromagnetic.