Volumes of n-dimensional balls

We all know that the area of a circle is and the volume of a sphere is , but what about the volumes (or hypervolumes) of balls of higher dimension?

For a fun exercise I had my multivariable calculus class compute the volumes of various balls using multiple integrals. The surprising results inspired this post.

First some terminology. An -dimensional hypersphere (or -sphere) of radius is the set of points in satisfying (I’ll place the center at the origin for simplicity). For example, a 0-sphere is the two-point set on the real number line, a 1-sphere is a circle of radius in the plane, and a 2-sphere is a spherical shell of radius in 3-dimensional space.

An -dimensional ball (or -ball) is the region enclosed by an -sphere: the set of points in satisfying . For example, a 1-ball is the interval , a 2-ball is a disk in the plane, and a 3-ball is a solid ball in 3-dimensional space.

It is possible to define “volume” in —in it is length, in it is area, in it is ordinary volume, and in it is hypervolume. Let denote the volume of the -ball of radius .

It turns out that the volumes of -balls satisfy the following remarkable recursion relation. (I’ll prove this relation at the end of the post.)

It is not difficult to use this recurrence relation to obtain a formula for . In particular, when is even and when is odd . (If you know what the gamma function is you can express this as a single function, )

The volumes of the -balls in the first 15 dimensions are given in the following table.

If you look at the volumes of the unit balls you’ll see they increase at first, reaching a maximum in dimension 5. Then they decrease and tend to zero as the dimension goes to infinity. Strange!

First, what is special about dimension 5? Why is the maximum achieved in this dimension? It turns out that there is nothing special about dimension 5. Below is a GeoGebra applet that allows you to adjust the radii of the balls. As we can see, the maximum volume is not always attained by the ball in dimension 5. Indeed, as the radius increases, the maximum volume occurs in higher dimensions. As John Moeller points out, the powers of in the numerator try to make an increasing function, however the factorials in the denominator always dominate in the end.

Second, what is the intuition behind this limit of zero? One way to see this is to observe that to be on the boundary of the unit -ball, we must have , but for this to happen when is large, most of the ‘s must be very close to zero. For example, the line intersects the -sphere at . On the other hand, the corresponding corners of the hypercube that inscribes the sphere are at , units from the origin. Thus the sphere fills up less and less of the hypercube that contains it. (Notice that the circumscribed hypercube has volume , while inscribed hypercube has volume .)

My colleague informed me that this zero limit is related to the curse of dimensionality in statistics. Volume increases rapidly as dimension increases, so it requires many more data points to get a good estimate. As Wikipedia points out, “100 evenly-spaced sample points suffice to sample a unit interval with no more than 0.01 distance between points; an equivalent sampling of a 10-dimensional unit hypercube with a lattice with a spacing of 0.01 between adjacent points would require sample points.”

Proof

Now I will prove the recurrence relation that I gave above.

Clearly the relation is true for and . Suppose .

First recall that if a solid in -dimensional space is scaled by a factor of , then its volume increases by a factor of . In particular, this implies that

Observe that the intersection of the -plane with the -ball is a disk of radius centered at the origin (see image below). Use polar coordinates to describe points in this disk. Then the perpendicular cross section of the -ball at the point is an -ball of radius .

Thus we can compute by integrating over the disk. We do so using polar coordinates.

This volume computation is done in the book Symmetric Bilinear Forms (By Milnor, Husemoller) as part of the full classification of indefinite integral inner product spaces (by their rank, type, and signature).

There, it is shown that there is indeed something spacial about n=5; using Minkowski’s convex body theorem, it is more natural to look at the behavior of $4/(V_n(1))^{2/n}$, which is larger than 2 for n>4, which makes the solution to the classification problem essentially different for n=5.

Interesting post. I have to say though that comparing length to area to volume to hypervolume and so on makes little sense, IMHO it would be better to plot the fraction of the hypercube each sphere occupies.

That suggests a possibly interesting investigation I haven’t seen before: how does the volume of the unit n-cube or sphere vary with the *metric*. (You changing objects from sphere to cube suggested metric change to me because under other metrics, “circles” become “squares”.)

I would be curious to see a discussion of what, if anything, general could be said about the measure of typical sets as one varies the metric – especially with convergent sequences of metrics and the like. Knew I should’ve taken that functional analysis class. :P

Another Math Overflow posting that had some interesting thoughts on thinking in higher dimensions. Particularly interesting post by Terry Tao:
“For instance, the fact that most of the mass of a unit ball in high dimensions lurks near the boundary of the ball can be interpreted as a manifestation of the law of large numbers, using the interpretation of a high-dimensional vector space as the state space for a large number of trials of a random variable.”

Re string theory– if the visible universe is a 9-d object w/ 3d of ~ (10^26)m and 6d of ~(10^-35)m, its diameter is then ~(10^-14.67)m, about the diameter of a proton. No part of our universe is any farther than this from any other part- considered hyperspatially. This may be a boring and inconsequential factoid to STists, but it’s bogglesome enough that the pop-sci press should be all over it.

There’s a nice proof without induction that uses the gamma function directly, in Peskin & Schroder’s Quantum Theory of Fields. Remember the proof of the integral of a gaussian, using 2d in polar coords? This does the same in reverse. Take e^{-x_1^2 – … – x_n^2} and integrate over R^n. In cartesian coords you get pi^(n/2). Switch to polar coords and you get the formula for the surface area of a sphere times a Gamma function. Integrate surface area to get (hyper-) volume.

Nicely written and easy to understand, tnx! It is interesting to see that you mentioned the connection to ‘the curse of dimensionality’ in statistics and machine learning. Indeed this phenomena makes it difficult to train classifiers and regressions in highly dimensional spaces because most of the data lives in ‘the corners’ of the feature space (hypercube) instead of being at the center (within the hypersphere). I recentely wroten an intuitive explanation about this, and the link between your post and the curse of dimensionality: http://www.visiondummy.com/2014/04/curse-dimensionality-affect-classification/