Experiments carried out by American physicists have made it possible to classify the knots formed by shaking a box of wires and create a model of their formation.

Long lengths of wires can take on a wide variety of configurations. For example, the wire can be laid out in a straight line, or bent in the middle.
In mathematics, a whole area is devoted to this, known as knot theory, which studies the embeddings of one-dimensional manifolds in three-dimensional Euclidean space. To classify nodes, tables of nodes are made - a list of diagrams of all simple nodes that allow projection onto a plane
In 2007, physicists Douglas Smith and Dorian Raimer decided to apply knot theory to real wires. They put a piece of wire in a box and shook it for 10 seconds. Raimer repeated the experiment 3,000 times with wires of varying lengths and stiffnesses, changing boxes and shaking speed and technique.
In 50 percent of all cases, the wire became tangled to form a knot. Of course, a lot depended on the length of the wire. Relatively short - 15 cm or less - mostly did not form knots. However, starting from a certain length, tangling of the wire became inevitable.
Raimer and Smith classified the types of knots found using Jones polynomials from mathematical knot theory. After each shaking, they photographed the wire and entered the image into a computer. The program they created then classified the found nodes.
In particular, the researchers were able to find 14 simplest nodes predicted by mathematical theory and consisting of seven or less intersections. Of course, the simpler the knot was, the more often it was encountered. But there were also more complex nodes, up to 11 intersections.
Based on their observations, physicists have created a theoretical model of wire entanglement. It is based on the simple fact that in order to fit a long wire into a box, it must be bent so that some segments of it lie parallel to the other. As you shake and rotate the box, these segments intersect and end up on top of each other, over and over again.

So what can you do to make the wires less tangled? One possible solution is to increase their rigidity. Perhaps this is why the latest generation of Apple laptops have less flexible wires.
Another solution proposed by scientists is to reduce the size of the box. If the wires are firmly pressed against the walls of the container, the degree and likelihood of entanglement will also be reduced.