Visualizing the circles of p-norms

Brian Chivers
4 min readOct 25, 2018

--

When learning about the various types of vector norms that exist, this picture often shows up:

While the L-2 norm appears to make sense, the rest puzzled me. Why a diamond and a square? What do the other p-norms look like? Couldn’t we transform the diamond somehow to be exactly the square? I hope this explanation will clarify these.

L-1 Norm (Manhattan Distance)

The L-1 norm (commonly referred to as the taxicab or Manhattan distance) is formally defined as the sum of the absolute value of the difference in each coordinate between two vectors. Intuitively, you can imagine a grid on top of your Cartesian plane, and the Manhattan distance is the distance it would take you to walk along that grid from one point to another, or as a taxicab would drive through Manhattan from one point to another.

So why the diamond?

A circle is frequently defined as a set of points that are at an equal distance from the center. If we use the Manhattan distance to create a circle, we get this diamond. Imagine the distance set for this “circle” is 1. A taxicab could drive to (1,0) or (.75,.25) or (.01,.99) after traveling 1 distance on the Cartesian plane. The diamond represents all of those possible points.

L-2 Norm (Euclidean Distance)

Now, the circular shape makes more sense: Euclidean distance allows us to take straight-line paths from point to point, allowing us to reach further into the corners of the L-1 diamond. A circle drawn with the Euclidean distance definition is very familiar:

You can think of this straight line path as a string, pinned to the origin. We can draw all points at the end of the string as we explore all possible positions of the string. Since euclidean distance is most common in the real world, this is our natural sense of a circle.

L-∞ Norm (Chebyshev distance)

The L-∞ norm is equivalent to the maximum absolute dimension in the distance between two points. I won’t provide the full proof here, but as all differences are multiplied by themselves to the infinite power, the largest difference will take over in the limit. Then, as the reciprocal power is taken, only the that largest difference remains. So, in a difficult, infinite way, it simply chooses the maximum.

So if we wanted to construct a circle, where every point is equal Chebyshev’s distance to the center, we would get a square. Let’s say that distance is 1. When compared to the origin, Chebyshev’s distance will pick the highest absolute coordinate: X or Y. So all points of distance 1 from the origin will have either X=±1, Y=±1, or both, but never more. We want the distance function to always choose 1 as its maximum absolute X or Y. Thus, the square- all of the points whose maximum coordinate is 1.

Why is this square not just a transformation of the diamond from the L-1 norm?

Besides the diamond having a different area than the square, this appeared equality dissolves in higher dimensions. In a 3-D space, the L-1 circle looks like an 8 sided diamond, while the infinite norm circle looks like a 6 sided cube.

What about the other p-norms?

They are a harder to understand intuitively, but they follow a similar pattern — the p-norms of p>1 push further and further out into the corners, as the limit reaches a square.

On the other hand, p-norms with p<1 squeeze in the corners, and travel further along the axis.

A super cool animation of p-norms from p=0.1 to p=2

References/Images:

https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Vector_norms.svg/146px-Vector_norms.svg.png

https://upload.wikimedia.org/wikipedia/commons/d/d4/Vector-p-Norms_qtl1.svg

https://upload.wikimedia.org/wikipedia/commons/1/1f/Lp_space_animation.gif

--

--