Long before robots could run or cars could drive themselves, mathematicians contemplated a simple mathematical question. They figured it out, then laid it to rest—with no way of knowing that the object of their mathematical curiosity would feature in machines of the far-off future.

The future is now here. As a result of new work by Amir Ali Ahmadi and Anirudha Majumdar of Princeton University, a classical problem from pure mathematics is poised to provide iron-clad proof that drone aircraft and autonomous cars won’t crash into trees or veer into oncoming traffic.

“You get a complete 100-percent-provable guarantee that your system” will be collision-avoidant, said Georgina Hall, a final-year graduate student at Princeton who has collaborated with Ahmadi on the work.

The guarantee comes from an unlikely place—a mathematical problem known as “sum of squares.” The problem was posed in 1900 by the great mathematician David Hilbert. He asked whether certain types of equations could always be expressed as a sum of two separate terms, each raised to the power of 2.

Mathematicians settled Hilbert’s question within a few decades. Then, almost 90 years later, computer scientists and engineers discovered that this mathematical property—whether an equation can be expressed as a sum of squares—helps answer many real-world problems they’d like to solve.

Amir Ali Ahmadi, a professor at Princeton University, has shown how a sum-of-squares algorithm can be applied to modern optimization problems. Princeton/ORFE

“What I do uses a lot of classical math from the 19th century combined with very new computational math,” said Ahmadi.

Yet even as researchers realized that sum of squares could help answer many kinds of questions, they faced challenges to implementing the approach. The new work by Ahmadi and Majumdar clears away one of the biggest of those challenges—bringing an old math question squarely to bear on some of the most important technological questions of the day.

Positivity Guaranteed

What does it mean for something to be a sum of squares? Take the number 13. It’s the sum of two squares: 22 and 32. The number 34 is the sum of 32 plus 52.

Instead of numbers, Hilbert’s question—the 17th of 23 he posed at the opening of the 20th century—has to do with polynomial expressions like 5x2 + 16x + 13. These kinds of polynomials can sometimes be expressed as sums of squares, too. For example, 5x2 + 16x + 13 can be rewritten as (x + 2)2 + (2x + 3)2.

When an expression is a sum of squares, you know that it’s always nonnegative. (Because anything squared is positive or zero, and the sum of positive numbers is a positive number.) Hilbert wanted to know if it works the other way around: if all nonnegative polynomials can be expressed as a sum of squares of rational functions. In 1927 the mathematician Emil Artin proved that Hilbert’s conjecture is true.

This relationship turns out to be quite useful. If you’re handed a complicated polynomial—one with dozens of variables raised to high powers—it’s not easy to determine straightaway whether it’s always nonnegative. “Some polynomials are obviously nonnegative, others are not. It’s hard to test whether they’re always nonnegative,” said Ahmadi.

But once you show that the same polynomial can be expressed as a sum of squares, then you know nonnegativity follows as a consequence. “Sum of squares gives you a nice certificate of positivity,” said Pablo Parrilo, a computer scientist and engineer at the Massachusetts Institute of Technology who was influential in bringing the sum of squares question into the applied realm.

Knowing whether a polynomial is always nonnegative might seem like a mathematical triviality. But a century after Hilbert asked his question, polynomial nonnegativity has turned out to answer applied problems that affect us all.

The Best Way

Sum of squares meets the real world in the field of optimization. Optimization theory is concerned with finding the best way to do something amid constraints—like finding the best route to work given the current traffic conditions and a stop you need to make along the way. Scenarios like these can often be distilled into polynomial equations. In such cases, you solve, or “optimize” the scenario, by finding the minimum value taken by the polynomial.