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.
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.
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!
> An example that should be familiar to many software engineers is the taxicab metric, also known as the Manhattan distance. ... There are some unnamed geometries in between, but if n approaches infinity, we get what’s called the Chebyshev distance.
I like to think of these two metrics and "rook" and "queen" distance. Manhattan distance is how far away two points are if you are traversing using a rook in chess which can only move horizontally and vertically. Chebyshev distance is how far they are if you can also move diagonally.
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=|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. The blog shows we can approximate it best ignoring all other dimensions but those two in two dimensional space. Seems obvious, but that has everything to do with the nature of pi, not with the math.
d=(|x|^3+|y|^3+|z|^3)^(1/3) would approximate pi better in 3 dimensional space than in any other, etc.
LOL as I'm reading the bit about the minimum (and before I get to the part linking the proof (which spawned the blog post)) my brain says "Ok, but have you done a formal proof extrapolating out to... maybe there's another dip, a pattern of dips..."
I haven't clicked the link, but I guess this is a well written blog post, since the place where I asked the question is precisely where they link to the paper. Nice.
The area of the Euclidean unit disk (area of a circle with radius 1) is equal to π. However, the volume of the unit ball (ball with radius 1, one dimension more) is larger, namely 4/3π ≈ 4.18879. So how does the hypervolume for unit n-balls change in higher dimensions, where the 1-ball is a circular disk and the 2-ball an ordinary ball?
Surprisingly, it first increases but then converges to 0. The maximum is achieved for a unit 5-ball with a hypervolume of about 5.2638. For higher dimensions the value decreases again.
However: If we allow fractional dimensions, the 5-ball isn't at the peak volume. The n-ball with the largest volume is achieved for n≈5.256946404860577, with a volume of approximately 5.277768021113401, which are slightly larger numbers.
Curiously, the paper above says that the area of the hyper surface of the n-ball (rather than its volume) peaks at n≈7.2569464048, while ChatGPT calculated it as n≈6.256946404860577, so exactly one dimension less than the paper. I assume the paper is right?
Also curiously, as you can see from these numbers, that fractional dimension with the peak hyper surface area is exactly two (according to the paper) or one (according to ChatGPT) dimension larger than the fractional dimension of the peak volume.
This is largely an aside but the I was at the local 50's themed diner down the street and asked for a coffee and apple pie David Lynch style and you know what those bastards brought me? One of those packaged mini pies and then they directed me to the counter to pour my own coffee.
My point is that when it comes to π it's just like people don't care like they used to. I hope you don't take that as a criticism.
Is there a metric for distance on the surface of a sphere? I imagine it's not one of the metrics in the family in the article, but in such a metric wouldn't Pi be less than 3.14?
[I dropped my physics major in college in favor of computer science, mostly because I couldn't handle the math, so I acknowledge that this could be a stupid/non-sensical question.]
I've always found the approximation of a circle to the limit as n -> inf of a polygon of n equal sides to be interesting. I do have a question though: is it possible to extend this method of exploration to reconcile the irrational property of pi? Because I'm somewhat discomforted with being satisfied with approximating our "best pi" to 3.14.
After thinking some more about this, it all seems a bit silly because the metric for n!=2 is not rotationally invariant. The article should have mentioned this!
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.
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
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.
Aside: In the table relating n to pi, what’s with the baselines of the text in the second column? (“exact” and “you are here”.) Is some renderer treating the characters like mathematical symbols?
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.
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!
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.
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.
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.
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
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!
A similar article, possibly was linked from Hacker News before: https://azeemba.com/posts/pi-in-other-universes.html
> An example that should be familiar to many software engineers is the taxicab metric, also known as the Manhattan distance. ... There are some unnamed geometries in between, but if n approaches infinity, we get what’s called the Chebyshev distance.
I like to think of these two metrics and "rook" and "queen" distance. Manhattan distance is how far away two points are if you are traversing using a rook in chess which can only move horizontally and vertically. Chebyshev distance is how far they are if you can also move diagonally.
[edited]
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=|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. The blog shows we can approximate it best ignoring all other dimensions but those two in two dimensional space. Seems obvious, but that has everything to do with the nature of pi, not with the math.
d=(|x|^3+|y|^3+|z|^3)^(1/3) would approximate pi better in 3 dimensional space than in any other, etc.
LOL as I'm reading the bit about the minimum (and before I get to the part linking the proof (which spawned the blog post)) my brain says "Ok, but have you done a formal proof extrapolating out to... maybe there's another dip, a pattern of dips..."
I haven't clicked the link, but I guess this is a well written blog post, since the place where I asked the question is precisely where they link to the paper. Nice.
Also interesting:
The area of the Euclidean unit disk (area of a circle with radius 1) is equal to π. However, the volume of the unit ball (ball with radius 1, one dimension more) is larger, namely 4/3π ≈ 4.18879. So how does the hypervolume for unit n-balls change in higher dimensions, where the 1-ball is a circular disk and the 2-ball an ordinary ball?
Surprisingly, it first increases but then converges to 0. The maximum is achieved for a unit 5-ball with a hypervolume of about 5.2638. For higher dimensions the value decreases again.
However: If we allow fractional dimensions, the 5-ball isn't at the peak volume. The n-ball with the largest volume is achieved for n≈5.256946404860577, with a volume of approximately 5.277768021113401, which are slightly larger numbers.
These were computed by GPT-5-thinking, so take it with a grain of salt. But the fractional dimension for peak volume is also reported here on page 34: http://lib.ysu.am/disciplines_bk/8d6a1692e567ede24330d574ac3...
Curiously, the paper above says that the area of the hyper surface of the n-ball (rather than its volume) peaks at n≈7.2569464048, while ChatGPT calculated it as n≈6.256946404860577, so exactly one dimension less than the paper. I assume the paper is right?
Also curiously, as you can see from these numbers, that fractional dimension with the peak hyper surface area is exactly two (according to the paper) or one (according to ChatGPT) dimension larger than the fractional dimension of the peak volume.
and hackernews' font has the worst pi :/
This is largely an aside but the I was at the local 50's themed diner down the street and asked for a coffee and apple pie David Lynch style and you know what those bastards brought me? One of those packaged mini pies and then they directed me to the counter to pour my own coffee.
My point is that when it comes to π it's just like people don't care like they used to. I hope you don't take that as a criticism.
Is there a metric for distance on the surface of a sphere? I imagine it's not one of the metrics in the family in the article, but in such a metric wouldn't Pi be less than 3.14?
[I dropped my physics major in college in favor of computer science, mostly because I couldn't handle the math, so I acknowledge that this could be a stupid/non-sensical question.]
I've always found the approximation of a circle to the limit as n -> inf of a polygon of n equal sides to be interesting. I do have a question though: is it possible to extend this method of exploration to reconcile the irrational property of pi? Because I'm somewhat discomforted with being satisfied with approximating our "best pi" to 3.14.
Popular-news version of this math, from the New York Times:
https://www.nytimes.com/interactive/2025/06/09/science/math-...
After thinking some more about this, it all seems a bit silly because the metric for n!=2 is not rotationally invariant. The article should have mentioned this!
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.
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
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.
Aside: In the table relating n to pi, what’s with the baselines of the text in the second column? (“exact” and “you are here”.) Is some renderer treating the characters like mathematical symbols?
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.
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?
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!
But remember that "we" chose the generalization which this all depends on.
"All norms define the same topology"
Memory from my Analysis 4 class in college.
this would make a great yt video lesson
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.
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.