A Group of Retired Engineers Built a Fully Functional Hovercraft From Lawn Mower Parts
The 'Grasshopper' can skim across fields and ponds at 35 miles per hour, powered by three rusted engines and an enormous...
The classic ham sandwich theorem, beloved by math nerds and deli workers alike, states that for any three measurable objects in three-dimensional space (say, a slice of bread, a slice of ham, and another slice of bread), there exists a single flat plane that cuts each object into two equal volumes. It is a powerful result with applications in fair division, political redistricting, and even cancer radiation therapy planning. But it has always had a practical problem: the theorem tells you that a perfect cut exists, but it does not tell you where to make it.
A team of mathematicians from Carnegie Mellon University and the University of Cambridge has now solved that problem, publishing a new algorithm in the Annals of Mathematics that finds the ham sandwich cut for any number of components—not just three—and does so using only simple geometry, no calculus required. The practical upshot for sandwich makers: the perfect cut is almost never through the geometric center of the sandwich.
"The midpoint is a trap," said Dr. Ananya Rao, lead author of the study. "People intuitively think that if you want to divide something fairly, you find its center and cut there. But that only works if the object is perfectly symmetric and if you only care about volume, not shape. A real sandwich has ingredients distributed unevenly. The ham is probably not centered. The bread might be thicker on one side. The tomato slice is off to the left. The midpoint cut will give you unequal ham, and that is the real sin."
The new algorithm, which Rao calls the "weighted recursive sandwich cut," works by treating each ingredient as a probability distribution. Instead of asking for a single plane that cuts each ingredient into exactly two equal halves (the classic theorem's guarantee), the algorithm asks for a plane that cuts each ingredient into two parts whose volumes are as close to equal as possible, given the geometric constraints. It then recursively applies that logic to the two halves, generating a series of cuts that eventually divide the entire sandwich into any number of equally fair portions.
To test the algorithm, the team built a sandwich-scanning rig: a laser profilometer that maps the 3D shape of a sandwich, combined with a hyperspectral camera that distinguishes ham from bread from cheese from tomato. The rig generates a point cloud of the sandwich, runs Rao's algorithm, and then—in the laboratory version—suggests a cut line to a human operator with a very sharp knife.
In 47 trials with real sandwiches (made fresh each morning by a local deli, then scanned and cut according to the algorithm's recommendations), the weighted recursive cut outperformed both the midpoint cut and a cut chosen at random. The algorithm's cuts achieved an average fairness score (the worst-off ingredient's proportion of its total volume) of 0.48 on a scale where 0.5 is perfect equality. The midpoint cut averaged 0.41. Random cuts averaged 0.35.
"The difference between 0.48 and 0.41 is the difference between getting half the ham and getting a third of the ham," Rao explained. "If you are splitting a sandwich with a friend and you care about ham, that is a massive difference. You will notice."
The mathematical breakthrough has already attracted attention outside academia. The U.S. Department of Justice's Antitrust Division has inquired about applying the algorithm to fair division of assets in corporate bankruptcies. The United Nations World Food Programme is exploring whether the algorithm could improve the distribution of emergency food aid in refugee camps. And at least three kitchen gadget companies have filed patent applications for "smart knives" that use embedded cameras and microprocessors to guide users to the optimal cut line.
Not everyone is thrilled. Artisanal sandwich makers, who take pride in their craft, have pushed back against what they see as mathematical overreach. "My job is not to divide ingredients like I am solving an equation," said Tony Giallo, owner of Tony's Deli in Brooklyn, New York. "My job is to make a sandwich that tastes good. Sometimes that means one person gets more ham and the other person gets more tomato. That is not unfair. That is personality."
Rao acknowledges the criticism but stands by her math. "We are not telling anyone how to make a sandwich," she said. "We are telling anyone who wants to divide a sandwich fairly—for lunch, for a shared meal, for a political negotiation—that there is a provably better way than cutting down the middle. If you prefer an unfair sandwich, by all means, keep cutting at the midpoint. The rest of us will eat mathematically optimal ham."
For those who want to try the algorithm at home, Rao's team has released a free smartphone app called CutFair. Point your phone's camera at an assembled sandwich, and the app overlays a recommended cut line on the screen. Early user reviews are mixed: some praise the app's fairness, while others complain that it recommends diagonal cuts, which are harder to execute with a standard kitchen knife. Rao is unbothered. "Harder does not mean impossible," she said. "If you want fairness, you must be willing to cut on the bias."