top | item 42244814

A solution to The Onion problem of J. Kenji Lopez-Alt (2021)

376 points| fanf2 | 1 year ago |medium.com

151 comments

order
[+] drspoulsen|1 year ago|reply
Hi everyone, the author of the blog here. I'm glad to see the interest here on this piece!

I have slides that detail the problem setup and the mathematics, as well as a consideration of three-dimensional onions, here: https://drspoulsen.github.io/Onion_Marp/index.html

I have submitted a formal write-up of the details of the problem and the solution to a recreational mathematics journal.

I'm also happy to answer any questions about this!

[+] therealfiona|1 year ago|reply
The thing I love about Hacker News is that someone can post an article like this, then the author of the paper shows up to answer any questions. Keep being awesome.
[+] dgacmu|1 year ago|reply
This is tremendously fun, thank you!

Your solution seems to assume that all cuts need to be directed towards a single point, but doesn't it seem likely that an even more optimal solution increases h (depth of cut target) as the cuts move outward? Or did I miss a reason that's not the case?

[+] thaumasiotes|1 year ago|reply
> I'm also happy to answer any questions about this!

If you're still checking, I have a semi-related question:

You're solving the problem for a circle in a plane (actually, a semicircle in a plane), and the reduction in dimensions is related to something that has bothered me.

I can easily segment a circle into a bunch of identical arcs (say, by making each arc 3 degrees long and getting 120 identical copies). Polar coordinates are great for this.

But spherical coordinates are terrible for accomplishing the same thing on a sphere, and my understanding is that the analogous effect - tiling the surface of a sphere with a single shape - can't be achieved?

What motivated me to thinking about this was the idea of a coordinate system that would allow every "square" on a map to be the same as the other squares, regardless of how much distortion there might be between the shape of the region on the spherical surface and the shape of the same region as a square on this fancy map. But it also seems relevant to the question of how well your two-dimensional analogue to the onion problem answers the original three-dimensional question. (I'm writing this comment in the middle of reading your article, so I don't know if the 3D solution is ultimately addressed.)

I'd be happy for any comments you might have related to this.

[+] timClicks|1 year ago|reply
I love how deeply nerd-sniped you have been by this topic. It's wonderful to be able to observe your delight in solving this. Thank you for sharing.
[+] dawnofdusk|1 year ago|reply
Would be really interesting if you could reverse engineer the model which yields 1/phi as the correct answer. Evidently for some non-uniform measure on the onion you could do it. What about for considering the onion as a half-ball? (Although if you're cooking it really is primarily the thickness that matters.)
[+] andrewmcwatters|1 year ago|reply
I feel like mathematics and many other rigorous field-friends have tons of great questions like this that are ripe for fun research. Thanks for publishing this and contributing to that world of curiosity!
[+] domenici2000|1 year ago|reply
Thanks, this has been my go to technique after watching Kenji's video about it.
[+] yunwal|1 year ago|reply
> First, we model the onion as half of a disc of radius one, with its center at the origin and existing entirely in the first two quadrants in a rectangular (Cartesian) coordinate system.

Can someone explain to me why a half sphere (the shape of half an onion) can be modeled as a half-disk in this problem? Why would we expect the solutions to be the same? If you think about the outermost cross-sections at the ends of the onion (closest to the heel and tip of the knife), as you get closer and closer to the ends, you approach cutting these cross-sections more vertically. I'd expect that you'd have to make the center cross-section a bit shallower to "make up" for the fact that the outsides are being cut vertically. Idk, either way I think declaring this the true "Onion constant" is probably wrong.

[+] ortusdux|1 year ago|reply
On the other hand, fellow food youtuber Adam Ragusea swears by the importance of heterogeneity. Optimizing for uniformity might not be the best strategy!

https://www.youtube.com/watch?v=5cWRCldqrxM

[+] stickfigure|1 year ago|reply
I literally came in here just to make this comment. Like Ragusea, I prefer every bite to be slightly novel and different.

One of my favorite hacks for Ceasar Salad: Take a bag of packaged croutons, put it flat on the table, and crush it with the bottom of a pan. Repeatedly. Until you get a mix of various sized crouton chunks, gravel, and dust. Apply to salad.

I ate a Ceasar this way in some fancy restaurant and I've been making it that way ever since.

[+] catapart|1 year ago|reply
Adam was solving a different problem statement. Kenji's point was to have one simple rule that anyone could remember and follow to make the best cuts without having to worry about precision. This rule gets you close enough to the homogeneity that is expected in most recipes (for things like onions) without having to fuss over particular cuts. Having watched Ragusea for a while, I'm betting he would be perfectly on board with that solution to that problem.
[+] andrewmcwatters|1 year ago|reply
I remember reading about the consistency of cuts from classically trained chefs. I think Adam Ragusea has a lot of niche, quirky practices that don't align with actual profession. He's more of a culinary advocate in the same way that Bill Nye is a science advocate. They're not professional chefs or scientists.
[+] jfactorial|1 year ago|reply
Well the logic presented in that video certainly cannot be argued against.
[+] momoschili|1 year ago|reply
really isn't a right and wrong way to do it. Erring too far toward either extreme makes your food probably a bit boring versus poorly executed.

That being said, most of Ragusea's takes haven't aged all that well, some by his own admission.

[+] alliao|1 year ago|reply
it's definitely one of the more subtle tool to use when cooking, mixing heterogeneity and homogeneous!
[+] me_again|1 year ago|reply
Marco Pierre-White recommends grating onions, which ingeniously avoids the entire issue.

Grating the Gordian knot, if you will.

https://youtu.be/glIUUrh6qtQ?t=40

[+] tptacek|1 year ago|reply
He grates for a tomato sauce, which makes sense, but you wouldn't want that as your default onion cut.
[+] account42|1 year ago|reply
It avoids the issue except for the remaining bit which you can't grate without risking your fingers.

For garlic, I prefer crushing them for many recipes. This creates much rougher outlines that blend better into the food and crisp nicely when fried.

[+] tdeck|1 year ago|reply
At that point why not just grind them in a food processor?
[+] marcopw|1 year ago|reply
“You can grate the onion, or not, its your choice really”
[+] OJFord|1 year ago|reply
Is the problem explained in text anywhere? (TFA delegates to a video and afaict only discusses another video-suggested solution and a novel solution in text, I don't understand what we're solving.)
[+] ipsento606|1 year ago|reply
> Is the problem explained in text anywhere

the problem is that you want to cut up an onion in such a way as to minimize variation in the size and shape of the cut-up pieces

usually, so that the pieces will cook evenly

[+] ruds|1 year ago|reply
You would like to slice (half) an onion in a way that minimizes the variance in volume of the pieces. The problem is then simplified to slicing half an onion in a way that minimizes the variance in cross-sectional area of the pieces at the widest part of the onion.
[+] dfxm12|1 year ago|reply
The problem is "I have an onion that is spherical with even layers. How do I cut it into pieces with equal volume?"

It's more of a geometry thought experiment than a practical epicurean "problem".

[+] sampo|1 year ago|reply
> Is the problem explained in text anywhere?

Not very well. There are some snippets:

"to keep the pieces as similar as possible"

"The Jacobian r dr dθ gives a measure of how big the infinitely small pieces are relative to each other"

"The variance is a good measure of the uniformity of the pieces."

[+] ska|1 year ago|reply
The problem is how to get roughly equal sized pieces from cutting an onion. If you cut towards the center the inner pieces are much smaller than the outer.
[+] CarVac|1 year ago|reply
I'm surprised Kenji still does the horizontal cut at all. With the angled vertical cuts I find the horizontal cut entirely unnecessary. (Also a few years back I gave myself a nice flap avulsion doing the horizontal cut in an onion...)
[+] tptacek|1 year ago|reply
The weirder thing for me is that he makes the horizontal cut after the vertical cuts --- in fact, most cooks I've seen dicing onions do that --- and it seems completely backwards. It's safe and easy to make the horizontal cut on an intact onion half, but much harder after it's been cut up vertically.
[+] momoschili|1 year ago|reply
angling the horizontal cut down is a good way to handle this. The horizontal cut is mostly only necessary for the lower sides of the onion anyways.
[+] aidenn0|1 year ago|reply
While narrating, Kenji says that he doesn't do the angled cuts at all, but it was an interesting math problem.
[+] ImPostingOnHN|1 year ago|reply
Invest in cut-resistant gloves. The few dollars will pay for themselves in non-lost time, plus you can use them on a mandolin.

NB: maybe stick a hotdog in one of the fingers to test it first.

[+] klysm|1 year ago|reply
Amazing, and I was soooo glad to see the integral has a closed form. I’m very curious what this looks like in the discrete case. I’d imagine it’s somewhat straightforward to code a simulation?
[+] tptacek|1 year ago|reply
In fancy cooking there's also a notion of a "perfect dice", meant literally to be that --- you pull the layers of the whole onion apart and cut/press them into sheets, so you have a rectangle to work with, and then dice that on a grid.
[+] dessimus|1 year ago|reply
>To get the most even cuts of an onion by making radial cuts, one should aim towards a point 55.73066% the radius of the onion below the center. This is close, but different from, the 61.803% claimed in the Youtube video at the top.

Wife walks into kitchen with 3447 cut onions in piles: "What are you doing?!" This guy: "I just cannot get these onions cut to a point 55.73066% below the origin! The best I have achieved is only 2 significant digits of accuracy." Wife, mumbling: "Maybe that's why Kenji said: 60%..."

[+] ackbar03|1 year ago|reply
You want even cuts you throw it into a blender