In Math one encounters so many results that leave one with the impression that Squared Euclidean is special. One such example is Singular Value Decomposition, or equivalently the Eckart-Young theorem. Arithmetic mean also minimizes the sum of Squared Euclidean from a set of points. Squared-Euclidean's properties are also the reason why the K-means algorithm (Lloyd's algorithm) is so simple.
Note that the squared part is important in that result although the squaring destroys the metric property.
A part of beauty of Euclidean metric (now without the squaring) is it's symmetry properties. It's level set, the circle (sphere) is the most symmetric object.
This symmetry is also the reason why the circle does not change if one tilts the coordinates. The orientation of the level sets of the other metrics considered in the post, depend on the coordinate axes, they are not coordinate invariant.
Euclidean metric is also invariant under translation, rotation and reflection. It has a specific relation with notion of dot-product and orthogonality -- the Cauchy-Schwarz inequality.
A generalization of that is Holder's inequality that can be generalized beyond these Lp based metrics, to homogeneous sublinear 'distances' or levels sets that have some symmetry about the origin [0].
The Cartesian coordinate system is in some sense matched with the Euclidean metric. It would be fun to explore suitable coordinates for the other metrics and level sets, although I am not quite sure what that means.
[0] Unfortunately I couldn't find a convenient url. I thought Wikipedia had a demonstration of this result. Can't seem to find it.
ratel 16 minutes ago [-]
Can someone explain what d(3)=(x^3+y^3)^(1/3) would actually mean as the blog seems to suggest something more profound than the below?
If d=abs(x)+abs(y) is moving in 2 dimensions, one dimension at a time and d(2)=(x^2+y^2)^(1/2) is moving in 2 dimensions at the same time, d(3)=(x^3+y^3)^(1/3) would have to mean moving 3 dimensions at once in two dimensional space (as it is missing the 3th position z) and for all n moving n dimensions at once in two dimensional space.
Now pi comes down to the constant calculating circumference in two dimensional space. The blog shows we can approximate it best ignoring all other dimensions but those two. Seems obvious, but that has everything to do with the nature of pi, not with the math.
scrumper 10 minutes ago [-]
That was fun, unexpected, learned something. I can barely calculate a restaurant tip but the thing I noticed was that our n=2 circle is smooth and continuous, the others have abrupt angle changes. Perhaps that is a clue to why "our" pi is the smallest.
whyandgrowth 3 hours ago [-]
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.
danbruc 21 minutes ago [-]
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.
elsjaako 3 hours ago [-]
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.
> 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.
whyandgrowth 3 hours ago [-]
Thanks
srean 3 hours ago [-]
> 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.
whyandgrowth 3 hours ago [-]
If the author had provided links to explanations or additional materials for those who want to understand the formal reasoning more deeply.
dpassens 2 hours ago [-]
And why does the linked paper not qualify as such a link?
whyandgrowth 1 hours ago [-]
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.
wer232essf 3 hours ago [-]
[dead]
jaza 45 minutes ago [-]
Errr... a circle is a shape in Euclidean geometry. Pi is a property of that shape in that geometry system. The OP article steps outside of Euclidean geometry. It discusses "circles" that aren't really circles. Therefore, the "pi's" that it discusses also aren't really pi's.
My conclusion therefore isn't "we have the best pi", but is rather "we have the only pi", because pi is simply not applicable, as soon as you alter the rules of there being a 2-dimensional plane and there being real-world distance, that the definition of pi depends on.
Anyway, I am not a mathematician, maybe I'm just too stuck in the boring old real world to get it!
omnicognate 31 minutes ago [-]
The definition of "circle" they are using is the set of points at an equal distance (the radius) from a given point (the centre). This definition works in any setting in which some sort of "distance" (metric) is defined. They are also using an implicit definition of "circumference" that works for the cases being considered here: split the "circle" into sections, measure the sum of their lengths according to the metric and take the limit as you use more and more, smaller and smaller sections. There are details that aren't covered in the article, but it works.
Having defined what a "circle" is and what its "circumference" and "radius" are, "pi" is defined: it's half the ratio of the circumference to the radius.
(I don't think it was very nice of whoever downvoted you, presumably because you're wrong, given you explicitly allowed that you might not be getting it.)
isoprophlex 3 hours ago [-]
I love these little mathematical snippets, where I (as a math noob) can't tell if the result is trivial or deeply profound
At least to me it's provocative
BrandoElFollito 2 hours ago [-]
I had the same thoughts when studying physics (I have a PhD). Math was some kind of a toolbox for my problems - I used it without too many thoughts and a deeper understanding. Some of the "tools" were wonderful and I was amazed that it worked; some were voodoo (like the general idea of renormalisation, which was used as a "Deus ex machina" to save the day when infinities started to crawl up).
Math is very cool but I think it requires a special (brilliant) mind to go through, and a lot of patience at the beginning, where things seem to go at a glacial pace with no clear goal.
newpavlov 38 minutes ago [-]
I wonder if there is a nice formula for the pi from n plot (extended to real n-s). It looks "nice enough" on the first glance.
As for n=0, can't you prove that pi=inf for n=0 using limits?
omneity 56 minutes ago [-]
What does `n` correspond to here? And why is it “ours”? (although the second I understand as euclidean space corresponds to n=2 and we seem to live in a locally euclidean space)
Surely it’s not dimensions, since all of these examples were two-dimensional (x and y). So I’m a little lost here.
bubblyworld 51 minutes ago [-]
It's an infinite family of metrics - you provide an n (a positive integer) and get back a metric.
So if you pick n=1 you get d(x, y) = |x| + |y|, which is the taxicab metric. You can apply this metric to a Euclidean space of whatever dimension you like, just substituting the appropriate definition of |x| and |y|. For 1-dimensional space you would use |x| = abs(x[0]), for 2-dimensional space you would use |x| = sqrt(x[0]**2 + x[1]**2), etcetera. Hope that helps.
FabHK 34 minutes ago [-]
And this works for any positive n (need not be an integer, and I think the author has an example with 1.5). Normally the letter p is used instead.
I really suck at math, especially when continuous functions are involved (ie non-CS-y math). Usually when mathy articles are posted on HN, I quickly give up, but I just ate this article up. I'm really impressed with the clear explanation, it's quite something! Thanks for writing this!
giveita 1 hours ago [-]
Spheres and hyperbolic are also interesting. On a sphere Pi can be anything from 3.14... to 4, then decreasing to zero based on how big your circle is. Not sure about hyp space but would be interesting.
NooneAtAll3 3 hours ago [-]
and hackernews' font has the worst pi :/
creata 1 hours ago [-]
The font stack is just "Verdana, Geneva, sans-serif;" so either one of those or a system font is the culprit.
mellosouls 2 hours ago [-]
Yeah I noticed that too, and had to comment (now deleted) to test it was the website here, and not the original copied and pasted text.
mixedbit 2 hours ago [-]
Is π really a number or is it a computation? For example, fibbonaci(∞) is not a number, and π looks to be conceptually similar. Unlike fibonacci(∞), π has a limit, and we can approximate it with better and better precision, but in both cases the computation will never terminate
srean 2 hours ago [-]
To answer your question you need to define what a number is to you. There are many different kinds of numbers, naturals, integers, rationals, irrationals, computable reals, reals, infinitesimals... Not even getting into complex, quaternions, octonions etc.
Is sqrt(2) a number to you ?
If you accept computable reals as numbers then \pi is definitely a number. So is the golden ratio.
Sharlin 2 hours ago [-]
If you believe that real numbers are numbers, then, yes, pi is a number. Indeed because pi is computable, it’s actually "more" real than almost all real numbers because there is only a countable infinity of computable reals.
Anyway, in modern math every real defined as the limit of a "process", namely a Cauchy sequence. Of course, for the rational subset of reals the limit is trivial.
creata 1 hours ago [-]
There are mathematical definitions of the terms "real number", "rational number", etc., but there is no mathematical definition of the word "number".
> we can approximate it with better and better precision
In one of the three common formal definitions of the real numbers, that's what a real number is: a Cauchy sequence of rational numbers, which approximate that real number with increasing precision. (Well, a real is an equivalence class of such sequences.)
(The other two common definitions are the Dedekind reals and the reals as the unique complete ordered field.)
probablypower 2 hours ago [-]
Is 2 a number?
Is 4 a number?
Is 4/2 a number?
Is 3 a number?
Is 3/2 a number?
etc...
All of these symbols represent precise points on the numberline. Pi also represents a precise point on the numberline, so is it not a number?
teiferer 1 hours ago [-]
Ironically, that response runs into the standard problem that many "limit" arguments have.
Generally speaking just because something looks like it's converging from some angle, it doesn't mean that it actually has a well-defined limit, and if it does then it also does not mean that the limit shares the properties of the items in the sequence of which it is the limit.
Examples: 1/n is strictly positive for all n. Its limit for n going to infinity, while well-defined, is not strictly positive. Another example: You can define pi as the limit of a sequence of rational numbers. But it's not rational itself.
So, no, your argument does not prove that pi is a number.
(I'm not arguing that pi is not a number. It definitely is. It's just that the argument is a different one.)
amelius 3 hours ago [-]
But remember that "we" chose the generalization which this all depends on.
mjburgess 3 hours ago [-]
Well, it's pi parameterised by the distance metric, Pi(d)
You can parameterise it by other concerns if you wish, and other things follow. But as a matter of fact, this is how pi depends on the distance metric.
amelius 2 hours ago [-]
Yes, but we're looking at a specific set of distance metrics.
It'd be interested in the set where Pi(d) is constant and equal to Pi.
(disclaimer: IANAM and I haven't given it much thought)
frotaur 14 minutes ago [-]
This is certainly an interesting question; however, it's probably very hard. This is because the 'set of all possible metrics of the 2d plane' is extremely large, and I am not sure if we have a good characterization for it.
There are a bunch of very strange metrics, e.g. a metric for which d(x,x) = 0, d(x,y)=1, that is, all points are at a distance of 1 to each other (this satisfies all axioms).
2 hours ago [-]
kragen 45 minutes ago [-]
If you want to go deeper, this is a subject with an immense number of connections. But to find them you'll probably have to know what people call them.
> Civilized man is surrounded on all sides, indoors and out, by a subtle, seldom-noticed conflict between two ancient ways of shaping things: the orthogonal and the round. Cars on circular wheels, guided by hands on circular steering wheels, move along streets that intersect like the lines of a rectangular lattice. Buildings and houses are made up mostly of right angles, relieved occasionally by circular domes and windows. At rectangular or circular tables, with rectangular napkins on our laps, we eat from circular plates and drink from glasses with circular cross sections. We light cylindrical cigarettes with matches torn from rectangular packs, and we pay the rectangular bill with rectangular bank notes and circular coins.
This column is included in one of Martin Gardner's books, which is where I read it in my childhood.
Viewed as level sets of vector norms (https://en.wikipedia.org/wiki/Norm_(mathematics)) these curves are called "balls": https://en.wikipedia.org/wiki/Ball_(mathematics)#In_normed_v.... Vector norms are fundamental to approximation theory, and because people often do math on measurements from the real world [citation needed] which are always imprecise [citation needed], approximation theory is pretty widely applicable. It's often convenient to use one of the alternative norms mentioned in Michał's article for your proofs.
Note that the squared part is important in that result although the squaring destroys the metric property.
A part of beauty of Euclidean metric (now without the squaring) is it's symmetry properties. It's level set, the circle (sphere) is the most symmetric object.
This symmetry is also the reason why the circle does not change if one tilts the coordinates. The orientation of the level sets of the other metrics considered in the post, depend on the coordinate axes, they are not coordinate invariant.
Euclidean metric is also invariant under translation, rotation and reflection. It has a specific relation with notion of dot-product and orthogonality -- the Cauchy-Schwarz inequality.
A generalization of that is Holder's inequality that can be generalized beyond these Lp based metrics, to homogeneous sublinear 'distances' or levels sets that have some symmetry about the origin [0].
The Cartesian coordinate system is in some sense matched with the Euclidean metric. It would be fun to explore suitable coordinates for the other metrics and level sets, although I am not quite sure what that means.
[0] Unfortunately I couldn't find a convenient url. I thought Wikipedia had a demonstration of this result. Can't seem to find it.
If d=abs(x)+abs(y) is moving in 2 dimensions, one dimension at a time and d(2)=(x^2+y^2)^(1/2) is moving in 2 dimensions at the same time, d(3)=(x^3+y^3)^(1/3) would have to mean moving 3 dimensions at once in two dimensional space (as it is missing the 3th position z) and for all n moving n dimensions at once in two dimensional space.
Now pi comes down to the constant calculating circumference in two dimensional space. The blog shows we can approximate it best ignoring all other dimensions but those two. Seems obvious, but that has everything to do with the nature of pi, not with the math.
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.
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.
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.
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.
My conclusion therefore isn't "we have the best pi", but is rather "we have the only pi", because pi is simply not applicable, as soon as you alter the rules of there being a 2-dimensional plane and there being real-world distance, that the definition of pi depends on.
Anyway, I am not a mathematician, maybe I'm just too stuck in the boring old real world to get it!
Having defined what a "circle" is and what its "circumference" and "radius" are, "pi" is defined: it's half the ratio of the circumference to the radius.
(I don't think it was very nice of whoever downvoted you, presumably because you're wrong, given you explicitly allowed that you might not be getting it.)
At least to me it's provocative
Math is very cool but I think it requires a special (brilliant) mind to go through, and a lot of patience at the beginning, where things seem to go at a glacial pace with no clear goal.
As for n=0, can't you prove that pi=inf for n=0 using limits?
Surely it’s not dimensions, since all of these examples were two-dimensional (x and y). So I’m a little lost here.
So if you pick n=1 you get d(x, y) = |x| + |y|, which is the taxicab metric. You can apply this metric to a Euclidean space of whatever dimension you like, just substituting the appropriate definition of |x| and |y|. For 1-dimensional space you would use |x| = abs(x[0]), for 2-dimensional space you would use |x| = sqrt(x[0]**2 + x[1]**2), etcetera. Hope that helps.
https://www.nytimes.com/interactive/2025/06/09/science/math-...
Is sqrt(2) a number to you ?
If you accept computable reals as numbers then \pi is definitely a number. So is the golden ratio.
Anyway, in modern math every real defined as the limit of a "process", namely a Cauchy sequence. Of course, for the rational subset of reals the limit is trivial.
> we can approximate it with better and better precision
In one of the three common formal definitions of the real numbers, that's what a real number is: a Cauchy sequence of rational numbers, which approximate that real number with increasing precision. (Well, a real is an equivalence class of such sequences.)
(The other two common definitions are the Dedekind reals and the reals as the unique complete ordered field.)
Is 4 a number?
Is 4/2 a number?
Is 3 a number?
Is 3/2 a number?
etc...
All of these symbols represent precise points on the numberline. Pi also represents a precise point on the numberline, so is it not a number?
Generally speaking just because something looks like it's converging from some angle, it doesn't mean that it actually has a well-defined limit, and if it does then it also does not mean that the limit shares the properties of the items in the sequence of which it is the limit.
Examples: 1/n is strictly positive for all n. Its limit for n going to infinity, while well-defined, is not strictly positive. Another example: You can define pi as the limit of a sequence of rational numbers. But it's not rational itself.
So, no, your argument does not prove that pi is a number.
(I'm not arguing that pi is not a number. It definitely is. It's just that the argument is a different one.)
You can parameterise it by other concerns if you wish, and other things follow. But as a matter of fact, this is how pi depends on the distance metric.
It'd be interested in the set where Pi(d) is constant and equal to Pi.
(disclaimer: IANAM and I haven't given it much thought)
There are a bunch of very strange metrics, e.g. a metric for which d(x,x) = 0, d(x,y)=1, that is, all points are at a distance of 1 to each other (this satisfies all axioms).
You can read more about the curves of Lamé plotted in this article at https://en.wikipedia.org/wiki/Superellipse. If you're in Sweden, the layout of https://en.wikipedia.org/wiki/Sergels_torg is a superellipse design by Piet Hein. Martin Gardner wrote a delightful column about this in the September 01965 Scientific American: https://www.scientificamerican.com/article/mathematical-game... "The superellipse: a curve that lies between the ellipse and the rectangle" which I don't have a copy of, except the slightly corrupted copy at https://piethein.com/superellipse/. It begins lyrically:
> Civilized man is surrounded on all sides, indoors and out, by a subtle, seldom-noticed conflict between two ancient ways of shaping things: the orthogonal and the round. Cars on circular wheels, guided by hands on circular steering wheels, move along streets that intersect like the lines of a rectangular lattice. Buildings and houses are made up mostly of right angles, relieved occasionally by circular domes and windows. At rectangular or circular tables, with rectangular napkins on our laps, we eat from circular plates and drink from glasses with circular cross sections. We light cylindrical cigarettes with matches torn from rectangular packs, and we pay the rectangular bill with rectangular bank notes and circular coins.
This column is included in one of Martin Gardner's books, which is where I read it in my childhood.
Superquadrics are a generalization of the three-dimensional case (see https://en.wikipedia.org/wiki/Superquadrics); Ed Mackey's 01987 "Superquadrics" screensaver is included in xscreensaver, which you can easily install if you're running Debian or Android with F-Droid: https://f-droid.org/en/packages/org.jwz.xscreensaver/
Viewed as level sets of vector norms (https://en.wikipedia.org/wiki/Norm_(mathematics)) these curves are called "balls": https://en.wikipedia.org/wiki/Ball_(mathematics)#In_normed_v.... Vector norms are fundamental to approximation theory, and because people often do math on measurements from the real world [citation needed] which are always imprecise [citation needed], approximation theory is pretty widely applicable. It's often convenient to use one of the alternative norms mentioned in Michał's article for your proofs.