News for hackers. Stuff that matters.
Re:Folks, we have the best π by whyandgrowth on Monday September 15, 2025 @05:04AM (#45247619)
This is very interesting, but I have 3 questions:

1. Why exactly n = 2 minimizes π. The article shows this graphically, but there is no formal proof (although the Adler & Tanton paper is mentioned). It would be interesting to understand why this is the case mathematically.

2. How to calculate π for n-metrics numerically. The general idea of "divide the circle into segments and calculate the length by the metric" is explained, but the exact algorithm or formulas are not shown.

3. What happens when n → 0. It mentions that "the concept of distance breaks down," but it does not explain exactly how and why this is so.

Re:Folks, we have the best π by danbruc on Monday September 15, 2025 @07:49AM (#45248575)
For point one the reason is of course that π(p) has a [global] minimum at 2. Actually showing that is not that easy because the involved integrals have no closed form solution but in principle it is not too hard. The circumference of the circles is 2 π(p) and equals four times the length of the quarter circle in the first quadrant which has all x and y positive and allows dropping the absolute values. The quarter circle is y(x) = (1 - x^p)^(1/p) with x in [0, 1]. Its length is the integral of ds over dx from 0 to 1 where ds is the arc length in the Lp norm ds = (dx^p + dy^p)^(1/p) which yields ds = (1 + (dy/dx)^p)^(1/p) dx. For dy/dx you insert the derivative of the quarter circle dy/dx = -x^(p - 1)(1 - x^p)^(1/p - 1) and finally you have to compute the derivative of the integral with respect to p and find the zeros to figure out where the extrema are. Well, technically you have to also look at the second and third derivative to confirm that it is a minimum and check the limiting behavior. The referenced paper works around the integral by modifying the function in a way such that it still agrees with the original function in some relevant points but yields a solvable integral and shows that using the modified function does not alter the result.
Re:Folks, we have the best π by elsjaako on Monday September 15, 2025 @05:32AM (#45247795)
I think lcantuf has looked at the first two and decided that the answer is too complex for a post like this. He linked to the article.

The third one we can reason about: For all cases where x and y aren't 0, |x|^n goes to 1 as n goes to 0, so (|x|^n + |y|^n) goes to 2 , and 1/n goes to infinity, so lin n->0 (|x|^n + |y|^n)^(1/n) goes to infinity. If x and y are 0 it's 0, if x xor y are 0 it's 1.

To phrase this in a mathematically imprecise way, if all distances are either 0, 1, or infinite the concept of distance no longer represents how close things are together.

Re:Folks, we have the best π by bubblyworld on Monday September 15, 2025 @07:31AM (#45248450)
There's a stackexchange thread that touches on the first two questions. It's got the integral form of the circumference calculation, but I doubt there's a closed-form solution in general: https://math.stackexchange.com/questions/2044223/measuring-p...
Re:Folks, we have the best π by mistercow on Monday September 15, 2025 @05:22AM (#45247729)
> How to calculate π for n-metrics numerically. The general idea of "divide the circle into segments and calculate the length by the metric" is explained, but the exact algorithm or formulas are not shown.

I feel like that would have been a bit in the weeds for the general pacing of this post, but you just convert each angle to a slope, then solve for y/x = that slope, and the metric from (0,0) to (x,y) equal to 1, right? Now you have a bunch of points and you just add up the distances.

Re:Folks, we have the best π by whyandgrowth on Monday September 15, 2025 @05:29AM (#45247773)
Thanks
Re:Folks, we have the best π by srean on Monday September 15, 2025 @05:31AM (#45247784)
> The article shows this graphically, but there is no formal proof (although the Adler & Tanton paper is mentioned).

Well, if that interested you, you could have downloaded the paper and read it. To me your comment sounds a shade entitled, as if the blog author is under an obligation to do all the work. Sometimes one has to do the work themselves.

Re:Folks, we have the best π by whyandgrowth on Monday September 15, 2025 @05:36AM (#45247821)
If the author had provided links to explanations or additional materials for those who want to understand the formal reasoning more deeply.
Re:Folks, we have the best π by dpassens on Monday September 15, 2025 @05:40AM (#45247850)
And why does the linked paper not qualify as such a link?
Re:Folks, we have the best π by whyandgrowth on Monday September 15, 2025 @06:44AM (#45248198)
Good point. I just thought that a direct link or summary of the formal reasoning would have made it easier for readers unfamiliar with the topic. But fair enough, the linked paper does cover it.
Re:Folks, we have the best π by whyandgrowth on Monday September 15, 2025 @08:25AM (#45248849)
P.S. Sorry, I was wrong.