Hacker News new | comments | ask | show | jobs | submit login
How much time cutting corners actually saves (math) (masonsimon.com)
16 points by masonicb00m 9 months ago | hide | past | web | favorite | 9 comments



My favorite things - analytical and sorta useless. However, it is interesting that moving the figurative to the literal could be deriving a single dimension metric and applying simple trig.


That plot is deceiving, just because the x-axis representing the ratio goes so large so quickly. I'd say roughly 95% of normally encountered triangles have edge ratios of less than 1:20, which represents 2% of the x axis.

Glancing at that graph you might wrongly conclude "no point cutting corners unless the triangle is reaaaally close to 1:1".


Thanks for the feedback. I included that much range to show the limit. I have a plot with truncated range that I skipped including for brevity. Maybe it’s worth throwing back in.


> This is why my preferred method for crossing intersections with 4-way stop signs is to go straight through the middle.

https://www.youtube.com/watch?v=IJNR2EpS0jw


I have a feeling that this would be much easier to understand using trigonometry. For a unit hypothenuse, you're trying to maximise sin(θ) + cos(θ), which is the case when θ = τ/8, giving √2.

Given that we cut a corner, the longest possible value for the original problem is √2.

If we want the proportion cut, we get (1 - 1/√2) ≅ 0.3


Maybe so. Does your method give a way to plot the function over the full range of values though? I think that seeing how the gains fall off is as interesting as computing the best case.


What is the full range of values? I find it easiest to think in terms of an angle of one of the corners, so 0-90 in degrees. Note that the graph only covers half of that range, somewhat arbitrarily.

The important realisation that the ratio of cutting corners that is maximised at 45° is not shown by the graph, which is a shame.

You don't have to use trig to show that, but I think it helps.

Edit: as a side point, as I was thinking about this, I realised that you've discovered the maximum relative error of an L1 norm vs an L2 norm, which is fun


I hear your point that phrasing in terms of angles may be more understandable.

The x-axis in my plot shows the ratio of lengths of the longer to the shorter of the two non-hypotenuse sides (yes, typing this out it does sound convoluted). This ratio is 1 when those two sides are equal length, which implies that the two corners are 45°. So the plot does show that the return to cutting corners is maximized at 45°-45°-90°, but indirectly.

It's not an arbitrary decision that the graph only covers half the angle range. That's a consequence of the decision to label the shortest side "a" and the longer one (non-hypotenuse) "b". If those labels were applied to specific sides then you could explore the full angle range, but it would be redundant. I'm open to the idea that people might find this easier to understand though.

I think the natural way to refer to the sides of a triangle is by their length, which lead to my formulation. If you feel like plotting your formulation, here's my source code (in R): https://gist.github.com/masonicboom/dafeb49b3c1d4c44998969ef....

Cheers!


TLDR version: Best case is a 45-45-90 triangle, and sqrt(2)/2 = 0.707.




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: