You put the headphones in your bag in a tidy coil, but when you pull them out, they’re a snarled mess every time. It may seem like a personal curse, but a new study shows that it’s just physics in action.

Dorian M. Raymer and Douglas E. Smith of the University of California, San Diego worked out the physics of random knotting by putting lengths of string into a contraption resembling a miniature clothes dryer that spun the loose string around. A mere ten turns, they found, had a fifty-fifty chance of putting a knot in a piece of string. The longer it tumbled, the greater the chance of a knot forming.

They also wanted to know what kinds of knots were forming, so they took pictures of the strings before and after tumbling. Identifying the knots was tricky, however, because knots that look very different may nevertheless be equivalent, meaning that one knot can be transformed into the other by twisting or pulling the string without tying or untying it. One knot could be upside down, for example, or have trivial excess loops, or be twisted up. Fortunately, an entire branch of mathematics is devoted to identifying equivalent knots.

When mathematicians talk about knots, they do one slightly unusual thing: they take the two ends of the string and fuse them together to form a loop. This makes it impossible to untie the knot without cutting the string. It also means that two knots are equivalent if one can be made to look just like the other by moving the string around without cutting it.

Back in 1983, a mathematician named Vaughan Jones at the University of California, Berkeley devised a mathematical expression—now known as the Jones polynomial—that can be defined for any knot. The remarkable thing is that if two knots are equivalent, they’ll each yield the same Jones polynomial. It’s not a perfect way to classify all knots, because some complicated knots that aren’t equivalent correspond to the same polynomial—so knot theorists still have plenty to keep them busy. But relatively simple knots are equivalent if their Jones polynomials are the same.

This was just the tool Raymer and Smith needed. When they removed the strings from the tumbler, they pulled the two ends of each string straight up out of the tumbler and tied them together to get a mathematical knot. Then they photographed the knots and fed them into a computer program they had written to analyze each knot and compute its Jones polynomial.

Running their experiment a couple of thousand times, the researchers produced a remarkable number of different knots. They found all of the 14 possible knots in which the string crosses itself seven times or fewer. They also found a smattering of more complicated knots, including a few with 11 crossings. Their results appeared online Oct. 2 in advance of publication in an upcoming *Proceedings of the National Academy of Sciences*.

The pair was also surprised to find that almost all of their knots were “prime,” meaning that they weren’t composed of two or more simpler knots. They speculated that using longer strings and more tumbles would have generated some composite knots.

Raymer notes that knots have become important in understanding the ways that strings of DNA form knots, but he also says that the biological forces on DNA are very different from the random forces on his tumbled strings. The importance of this study, he says, “is mostly that we constructed a scientific study into something that could be called Murphy’s Law.” The cord always gets tangled up.

If you would like to comment on this article, please see the blog version.