Math for stacking oranges

Math for stacking oranges

The sphere-packing problem, which has interested mathematicians for centuries, has applications in areas such as code correction.

Coffee and Theorems

Any greengrocer is clear: the best way to place oranges, occupying the least possible space, —the so-called sphere packing problem—, consists of forming a pyramid with them, in which each layer of oranges sits on the holes of the bottom layer. But, among all the possible arrangements of oranges, is this the one that makes the best use of space? The problem, which is much more complex than it might seem, was solved only 25 years ago and the verification that the answer was correct took almost 20 years.

Math for stacking oranges

The problem was proposed in 1611 by the illustrious scientist Johannes Kepler. He conjectured that in his two-dimensional version—which consists of determining the optimal way to place circles on a plane—an arrangement analogous to that of the pyramid in two dimensions—following a hexagonal pattern—was the optimal one. The rigorous proof of this claim came in 1942, from the Hungarian mathematician László Fejes Tóth, who completed an incomplete proof by Axel Thue, proposed in 1890.

The problem of three-dimensional spheres turned out to be even more difficult. It was not until 1998 that the American mathematician Thomas C. Hales published to show that the optimal packing of spheres in three dimensions is the one that follows the arrangement of pyramids. In his demonstration he also used some calculations made with computers and the proof that these calculations were correct was delayed until 2014.

Mathematicians have also studied higher-dimensional packing, which also has applications in areas such as code correction. If we treat each message of (at most) 20 bits in length as a vertex of a 20-dimensional cube, we can take advantage of good 20-dimensional sphere packings to correct bad messages.

Specifically, if we receive a message that does not fit into our list of admissible messages —either because it does not make sense or because we have a pre-established list of messages that we consider admissible—, it could mean that there has been a failure in the communication channel and, in such a case, it would be nice to be able to correct it. To try to find out what the initial message was, we can look for the message, among all admissible ones, that is most similar to the one we have received. To do this, simply compare distances in the 20-dimensional space of the messages.

Thus, if we have good packing of high-dimensional spheres, we can interpret them as admissible messages that allow correcting errors in communication. The fact that they take up a small fraction of the space means that messages use as few bits as possible.

However, the problem of optimal packings in high dimensions —greater than three— remains an open problem: only the optimal configurations in dimensions eight and dimension 24 have been found.

Math for stacking oranges


The eight-dimensional result was proved in 2016 by the Ukrainian mathematician Maryna Viazovska, who had just finished her Ph.D. at the time. It is a very outstanding milestone in recent mathematics since, in addition, her methods greatly simplified those used by Hales to demonstrate the three-dimensional case. This is not to say, far from it, that the proof was easy: the work combines tools and techniques from Fourier analysis, number theory, and the field of optimization. Also, with her proof, computational help was not needed.

With this publication, Viazovska quickly gained worldwide fame and, together with other collaborators, solved the problem in dimension 24 a year later, adapting the methods already used in dimension eight. However, these methods do not seem to work—without major modifications—for more dimensions, and no one has achieved definitive results in any other dimension to date. For some of the other dimensions, some of the current guesses are quite close to the optimum, but there are no complete proofs.

Will the sphere packing problem in some other dimension be solved soon? That already entered the field of speculation. But what we can be sure of is that, apart from the interest that the result may arouse, the most remarkable thing about proof in this sense is probably a deep new connection between different fields of mathematics —as happened with the proof of Viazovska—, something that is always very desirable to open new lines of research.

Pablo Hidalgo Palencia is a predoctoral researcher at the ICMAT

Coffee and Theorems is a section dedicated to mathematics and the environment in which it is created, coordinated by the Institute of Mathematical Sciences (ICMAT), in which researchers and members of the center describe the latest advances in this discipline, share points of encounter between mathematics and other social and cultural expressions and remember those who marked its development and knew how to transform coffee into theorems. The name evokes the definition of the Hungarian mathematician Alfred Rényi: “A mathematician is a machine that transforms coffee into theorems”.

Edition and coordination: Ágata A. Timón G Longoria (ICMAT) .


  • BUZZBONGO  is a website founded in 2018 by a group of professionals with extensive experience in creating content on the Internet. The information you will find is prepared by experts in each of the topics covered on the web. The main objective of the project is to give our users a professional, verified, and up-to-date response to solve the doubts and problems they may have in their day-to-day life... About Writing Team visit (

Leave a Reply