# The volume and area of spheres of various dimensions

Consider a vector space, over the reals, of arbitrary natural dimension, dim. Allow the presence of a standard (positive-definite symmetric) metric and work consistently in the coordinates associated with a basis which diagonalises this with all diagonal entries 1. This effectively expresses our vector space as U = {({reals}:|dim)}, with the metric as (: (: sum(: v(i).u(i) ←i |dim) ←u |U) ←v |U).

The volume of a sphere of radius r trivially varies as power(dim, r) and the surface area is just the derivative with respect to r, which is d(power(dim, r))/dr = dim.power(dim−1,r) times the volume of the unit sphere. Consequently, we only need to determine the volume of the unit sphere, V(dim), at each dimension; this unit sphere's surface area shall then be A(dim) = dim.V(dim).

Choosing any diameter and integrating the cross-section perpendicular to it, we obtain (with B = {scalar t: −1≤ t ≤1})

V(dim)
= integral(: power((dim−1)/2, 1−x.x).V(dim−1) ←x :B)

in which we can substitute x= sin(t) to obtain

= I(dim).V(dim−1)

where, taking T = {scalar t: −π/2 < t < π/2}, so that (B|sin:T),

I(dim)
= integral(: power(dim−1, cos(t)).sin'(t) ←t |T)
= integral(: power(dim, cos(t)) ←t |T)

which is π for dim=0, change(:sin:T) = 2 (because sin' = cos) for dim=1 and susceptible to integration by parts when dim > 1:

= integral(: power(dim−2, cos(t)).(1 +cos'(t).sin(t)) ←t |T)
= I(dim−2) +integral(: power(dim−1, cos)'(t).sin(t)/(dim−1) ←t |T)
= I(dim−2) +change(: power(dim−1, cos(t)).sin(t)/(dim−1) ←t |T) −integral(: power(dim−1, cos(t)).sin'(t)/(dim−1) ←t |T)

in which the middle term is zero: dim>1 gives dim−1 > 0 and cos(π/2) = 0 = cos(−π/2), so power(dim−1, cos(t)) is zero at both ends of T.

= I(dim−2) −I(dim)/(dim−1)

We can now re-arrange what we have to obtain

I(dim−2)
= I(dim).(1 +1/(dim−1))
= I(dim).dim/(dim−1)

or

I(dim)
= I(dim−2).(dim−1)/dim

It is easy enough to obtain, directly, I(0) = π and I(1) = 2: we can then use the recurrence relation to derive

I(2.n)
= I(2.(n−1)).(2.n −1) / 2 / n
= I(2.(n−1)).2.n.(2.n −1) / n / n / 4
= I(2.(n−i)).((2.n)! / (2.(n−i))!) . power(2, (n−i)!/n!) / power(i,4)

for i = 0, 1, …, n (by induction in i)

= I(0) . (2.n)! / power(2, n!) / power(n, 4)
= π . (2.n)! / power(2, n!) / power(2.n, 2)

and, similarly,

I(2.n+1)
= I(2.n−1) . 2.n . 2.n / (2.n) / (2.n +1)
= I(2.(n−i)+1) . power(i,4) . power(2, n!/(n−i)!) . (2.(n−i)+1)! / (2.n+1)!

for i = 0, 1, …, n (by induction in i, again)

= I(1) . power(n,4) . power(2, n!) / (2.n+1)!
= power(2.n+1, 2) . power(2, n!) / (2.n+1)!

• I(2.n).I(2.n+1) = 2.π / (2.n+1)
• I(2.n−1).I(2.n) = 2.π / (2.n)

i.e. V(dim)/V(dim−2) = I(dim).I(dim−1) = 2.π/dim for each dim. This, incidentally, implies A(dim+2)/A(dim) = 2.π/dim for each dim; and at least strongly suggests that I(dim) shrinks as 1/√dim for large dim.

One may trivially obtain V(1) = 2 or start from the more familiar V(2) = π (note that I(2) = π/2 = V(2) / V(1) as expected). From here we can work upwards to obtain

V(dim)
= V(1).product(: I |{2,…,dim})
= product(: I |{1,…,dim})

since I(1) = 2 = V(1), leading to

V(2.n)
= product(: I(2.i).I(2.i−1) ←i |{1,…,n})
= product(: π / i ←i |{1,…,n})
= power(n, π) / n!

i.e. V(2.n) = πn/n!, and

V(2.n+1)
= I(1) . product(: I(2.i+1).I(2.i) ←i |{1,…,n})
= 2 . product(: 2.π / (2.i+1) ←i |{1,…,n})
= 2 . product(: 4.π . i / (2.i) / (2.i+1) ←i |{1,…,n})
= 2 . power(n, 4.π) . n! / (2.n+1)!

It will readily be seen that both formulae tend to zero as n tends to infinity. They do this faster than 1/n, so the area also tends to zero. Consequently, one should be wary of imagining that integration over the surface of the unit sphere in an infinite-dimensional vector space (such as the Hilbert spaces which many quantum mechanical systems involve) can be commensurate with the metric used in defining the sphere. Or, to rub the point in, integration over all possible states of a quantum mechanical system is a pretty dodgy business.

It can also be shown that the two formulae above are the particular forms of a single formula: V(d) = power(d/2, π) / Γ(1 +d/2). The function Γ used here is Γ(x) = integral(: power(x−1, t).exp(−t) ←t |{positive reals}) and gives Γ(1+n) = n! for natural n; so we can write

• 1/V(d) = integral(: power(d/2, t/π).exp(−t) ←t |{positive reals})

and caricature it as extending our earlier V(2.n) = πn/n! to apply even when n isn't an integer. For surface area, this gives A(d) = d.V(d) = 2.power(d/2, π)/Γ(d/2).

We also obtain I(d) = V(d)/V(d−1) = (√π).Γ((1+d)/2)/Γ(1+d/2) whence 2.log(I(d)) is approximately log(π) −g'(1+d/2) with g = log∘Γ; Stirling's formula gives us g'(1+d/2) as 1/d +log(d/2) plus terms of order 1/d/d, so that log(I(d)) = log(2.π/d)/2 plus a polynomial in 1/d, which dies away to zero for large d; thus I(d) is asymptotically √(2.π/d), which shrinks as 1/√d, as anticipated.

If we look for the sphere of unit volume, its radius will have to be r = power(−1/dim, V(dim)); with a little help from Stirling's formula we obtain:

log(r)
= log((dim/2)!)/dim −log(π)/2
≈ (1+1/dim).log(dim/2)/2 −1/2 +log(2.π)/2/dim −1/6/dim/dim −log(π)/2
= log(dim/2/e/π)/2 +log(dim.π)/2/dim −1/6/dim/dim

whence r ≈ √(dim/2/e/π) for large dim (and 2.e.π ≈ 17.079). The radius needed to have a surface area of one is power(−1/(dim−1), dim.V(dim)) which, likewise (albeit with smaller correction, lacking any log(dim)/2/dim term), grows as √(dim/2/e/π). For each of these spheres, the RMS (root of the mean of the square of each) co-ordinate on the surface is asymptotically 1/√(2.e.π) ≈ 0.242 (and the unit-area sphere approaches this slightly faster, of the two).

The surface area of the unit sphere implies an analogue of angle and solid angle. In dimension 1+n we can infer a base unit of hyper-angle as power(n, radian) that's the hyper-angle subtended at a centre by any body whose radial projection onto the unit sphere about that centre has unit area. We also have the natural unit turn = 2.π.radian which we can use to soak up factors of π when asking what hyper-angle is subtended by the full hyper-shell subtended by something that surrounds the central point.

Here's a table of some of the early values for I, V and A:

dimI(dim)V(dim)A(dim)shell
12222
2π/2π2.πturn

and note that 3.2 = 16/5 > π and 16 > 15 imply

• π/6 < 8/15 > 1/2, whence V(4) < V(5) > V(6); and
• 1 < 16/15 > π/3, whence A(6) < A(7) > A(8).

Here's a table giving approximate numerical values to V and A in the above and at some other values of dim (to illustrate the maxima and some critical thresholds being crossed), along with r(dim) = power(−1/dim, V(dim)), the radius of the sphere with unit volume:

dim V(dim) A(dim) r(dim)
−10.318 −0.3180.318
0 1 0 any
1 2 2 0.5
2 3.14 6.28 0.564
3 4.19 12.57 0.620
4 4.93 19.74 0.671
5 5.26 26.32 0.717
6 5.17 31.01 0.761
7 4.72 33.070.801
8 4.06 32.47 0.839
12 1.34 16.023 0.976
13 0.91 11.84 1.007
18 0.08 1.48 1.149
19 0.047 0.885 1.175
43 2.05e-10 8.81e-9 1.680
44 7.70e-11 3.39e-9 1.698
47 3.83e-12 1.798e-10 1.750
48 1.38e-12 6.61e-11 1.766
188 4.96e-100 9.33e-98 3.375
189 9.04e-101 1.71e-98 3.383
192 5.37e-103 1.03e-100 3.409
193 9.68e-104 1.87e-101 3.418
1699 1.19e-1699 2.01e-1696 9.999
1700 7.21e-1701 1.23e-1697 10.002
170781 1.28e-3415622.18e-34155799.9999
170782 7.75e-3415651.32e-341559100.0001
0 0

## Rolling backwards

At the start of the tables just given, I've used the values of I to iterate V(dim−1) = V(dim) / I(dim) backwards, yielding: first, with dim = 1, the almost intelligible V(0) = 1; next with dim = 0, we find the frankly bizarre V(−1) = 1/π. After that we need I(−1) = I(1).1/0 to obtain V(−2) = 1/π . 0/I(1) = 0, albeit somewhat suspectly; we can't continue I's backwards iteration any further. We can continue V's backwards iteration: V(dim−2) = V(dim).dim/2/π makes V zero at every negative even dimension and gives us values of alternating sign for negative odd dimension; however, both this V iteration and the Γ formula it yields are, in principle, derived from the I iteration, so the link to any notion of sphere is at best tenuous below dim = −1. Below, I'll use the Γ-formula for V to study the values for negative dimension more closely, but first let's try to make sense of the cases we can get to via I's reversed iteration.

### Dimension 0

Now, V(0) is the volume of the unit sphere in {({reals}:|0)} = {({reals}:|empty)} = {empty} = {0}, the 0-dimensional vector space over the reals. This vector space has only one member: its length is the square root of an empty sum, hence zero, which is less than 1, so it is inside the unit sphere; so the unit sphere is the entire space – likewise, so is the sphere of any positive radius. We find that this has total measure 1, which seems natural enough. That it is constant for positive radius again makes sense – we expected pow(r,0) to be the r-dependency – and naturally implies zero surface area, consistent with the formulae. Since the vector space of dimension 0 is a natural model for the notion of geometrical point, this reads as saying that a point has measure 1 and its surface has measure 0.

Now the surface of the 0-sphere is a curious entity – we expect it to have dimension −1, which is definitely nonsense, so perhaps we're best off just regarding the fact that we've got 0's worth of it as a good excuse for ignoring it. Still, curiosity asks what sense we can make of V(−1) = 1/π, which means discussing the unit sphere in a space of dimension −1. We'd expect the volume of the (−1)-sphere of radius r to be V(−1)/r and its surface area −V(−1)/r/r, so watch out for this possibly mattering to Coulomb-type fields … even if we can't make sense of it.

One approach is to look at simplices (point, line segment, triangle, tetrahedron, …), each of which has a definite dimension and a standard representation as simplex(dim) = {({positive reals}: p |dim+1): sum(p) = 1}, a subset of the (1+dim)-dimensional space (this can be read as the collection of probability measures on 1+dim). Here we find that simplex(dim) has a boundary consisting of 1+dim faces each of which is a simplex(dim−1). So we have a 2-dimensional triangle with 3 edges, each of which is a 1-dimensional line, with 2 ends, each of which is a 0-dimensional point, whose boundary is a single simplex of dimension −1; this, in turn, has a boundary consisting of 0 simplices of dimension −2. The standard representation gives simplex(−1) = {({positive reals}: p |0): sum(p) = 1} and we know that any (:p|0) is empty and so has sum 0, not 1, so there are no such p and simplex(−1) = {}; it is thus no surprise that, whatever kind of things its boundary is made up of, there are none of them. Compare simplex(0) = {({positive reals}: p |1): sum(p) = 1} = {({1}: |{0})} which has one member and is viewed as a point: this is exactly the 0-sphere, so the 0-sphere has a single {} as boundary – for which a measure of 0 makes singularly good sense.

Now, let's go back to our 0-dimensional space, {zero} – and distinguish between the natural number 0 = {} = empty and the vector zero = ({0}::). We expect a basis ({zero}: e |dim) and, since 0 = {} = empty is our dimension, we have e = ({zero}: empty :{}). The sum of this is an empty sum, so yields the additive identity of our vector space, {zero}, namely zero. Thus e spans {zero}. Now, to investigate linear independence, we must ask for ({reals}: f |(:e|)) for which sum(: f(i).e(i) ←i :) = zero. There is precisely one ({reals}: f |{}), namely empty (again): and it does yield this zero sum. It's also f= ({reals}: constant(zero) |{}); so the only ({reals}: f |(:e|)) for which the sum is zero is, indeed, constant(zero) and we find that e is, indeed, linearly independent. Since we already know it spans our space, that confirms that it is a basis.

### Dimension −1

Now, I can make sense of {} as a linear space in the sense that: I can multiply any member of it you give me by any scalar you care for (because you can't give me a member of {}); likewise, I can add arbitrary members of {} – indeed, any equation of form a+b=a+c implies b=c and for any a, b in {} there is a unique x in {} for which a+x=b, so this addition is cancellable and complete. There is only one mapping ({}::), namely empty = {} = (:empty|). Oddly enough, we can't sum it sensibly, because its answer needs to be a member of the target linear space, {}, which has no members. This makes discussion of whether empty spans {} somewhat confused, since we can't sum empty (or the one scaling of it).

For linear independence, notice that the only function ({reals}:|{}) is again empty – which is, none the less, ({reals}: constant(zero) |{}) and so constant with value zero. Thus there are no mappings ({reals}:|{}) which are not constant 0 and, in particular, none such for which sum(: f(i).empty(i) ←i :{}) is zero, so empty can sensibly be viewed as linearly independent. However, since we can't sum constant(zero).empty, I'm uncomfortable with this.

This still doesn't give us {} as a linear space of dimension −1, but it's a weird enough beast that it could relate to our funny sequence. For lower negative dimensions, I can't concoct any kind of an entity to regard as the space whose sphere to discuss. Still …

### Trusting Γ

Earlier, we obtained a formula for V(dim) in terms of the Γ function, as power(dim/2, π) / Γ(1 +dim/2). Now, Γ has a simple pole at each non-positive integer, so V is zero for each negative even dim. The formula also gives values for all odd negative dim. Note that Γ(1−z).Γ(1+z).sinc(z.π) = 1, where sinc = (:sin(x)/x ←x:) with its undefined-at-0 filled in by sinc(0) = 1; thus, substituting the Γ-formula, V(−d).V(d) = sinc(π.d/2), whence V(−even) is always zero and V(−odd) diverges to infinity, alternating negative and positive values. We can arrive at the same answer by reading V(dim)/V(dim−2) = 2.π/dim as V(dim−2) = V(dim).dim/(2.π) and rolling backwards from V(0) – which yields zero for V(−2) and all other negative even dimensions – and from V(1) or, indeed, V(−1). So here's one table giving formulae for a few illustrative cases:

dim V(dim) A(dim) r(dim)
−even (non-zero)0 0 (undefined)
−1 1/π −1/π1/π
−3 −1/2/π/π 3/2/π/π
−5 6/power(3,2.π) −30/power(3,2.π)
−7 −30/power(4,2.π) 210/power(4,2.π)

and another giving values for odd negative dimension, whatever they may mean:

dim V(dim) A(dim) r(dim)
−1 0.318 −0.318 0.318
−3 −0.0507 0.152 −0.370
−5 0.0242 −0.121 0.475
−7 −0.0192 0.135 −0.569
−9 0.0214 −0.193 0.653
−11 −0.0307 0.338 −0.729
−13 0.0538 −0.699 0.799
−15 −0.1112 1.67 −0.864
−17 0.266 −4.52 0.925
−19 −0.719 13.66 −0.983
−21 2.17 −45.64 1.038
−45 4.94e+8 −2.22e+10 1.560
−47 −3.54e+9 1.66e+11 −1.597
−49 2.65e+10 −1.30e+12 1.632
−189 3.73e+97 −7.045e+99 3.283
−191 −1.12e+99 2.14e+101 −3.301
−193 3.408e+100 −6.58e+102 3.318
−1713 3.42e+1712 −5.862e+1715 9.994
−1715 −9.34e+1714 1.601e+1718 −10.000
−1717 2.55e+1717 −4.38e+1720 10.005
−170805 4.75e341609 −8.11e341614 99.9996
−170807 −1.29e341614 2.20e341619 −100.0001
−odd infinity

Note that r is smallest at dimension −1. While, among positive dimensions, 5 and 7 yielded the maxima for V and A, respectively, dimensions −5 and −7 yield the smallest values for A and V, respectively, among negative odd dimensions.

Written by Eddy.