Dicing an Onion, the Mathematically Optimal Way

https://news.ycombinator.com/rss Hits: 3
Summary

This is a project about onions and math.Why? Because tens of millions of people are curious about how to properly dice an onion, according to YouTube.In 2021, chef and food writer J. Kenji López-Alt broke out some math to get optimal uniform piece sizes. But there is more than one way to dice an onion… This is an onion. (Well, a simplified cross-section of one.) We’ve cut it in half lengthwise, using a sharp knife to reduce the chance of injury and onion-induced crying. From here, what’s the best way to dice it? That is, how do we get the most uniform piece size?For the sake of example, let’s assume our onion has 10 layers. We can represent the layers as concentric circles.Let’s start with a common approach—vertical cuts. The pieces near the center line are fairly consistent in shape and size.But along the bottom there are some noticeably larger pieces. When you dice an onion, you’re probably not imagining pieces like these.This inconsistency can be measured by calculating the standard deviation of our pieces’ areas.A note on the standard deviationIn this article when we say standard deviation it refers to relative standard deviation. Relative standard deviation here is the ratio of the standard deviation compared to the average piece size. Because relative standard deviation is a percentage, we can make unitless comparisons about how tightly our piece sizes cluster around the average—we don’t have to make any assumptions about the exact dimensions of our onion.Without getting too deep in the weeds, just know that a higher standard deviation means more piece size variation. So to obtain the most consistently sized pieces, we want to make the standard deviation as small as possible.Adjust the slider below to see how the number of cuts affects the standard deviation. Oh, and don’t forget to check out the exploded view toggle to see the variation. Okay, let’s try a different technique—radial cuts. The piece size still isn’t very consistent—those near the outside are mu...

First seen: 2025-08-16 16:27

Last seen: 2025-08-16 18:27