This is the tale of a mathematical adventure. Last time our hardy band of explorers discovered that if you randomly choose two points on the unit sphere in 1-, 2- or 4-dimensional space and look at the probability distribution of their distances, then the even moments of this probability distribution are always *integers*. I gave a proof using some group representation theory.

On the other hand, with the help of Mathematica, Greg Egan showed that we can work out these moments for a sphere in *any* dimension by actually *doing the bloody integrals*.

He looked at the nth moment of the distance for two randomly chosen points in the unit sphere in and he got

This looks pretty scary, but you can simplify it using the relation between the gamma function and factorials. Remember, for integers we have

We also need to know at half-integers, which we can get knowing

and

Using these we can express moment(d,n) in terms of factorials, but the details depend on whether d and n are even or odd.

I’m going to focus on the case where both the dimension d and the moment number n are even, so let

In this case we get

Here ‘we’ means that Greg Egan did all the hard work:

From this formula

you can show directly that the even moments in 4 dimensions are Catalan numbers:

while in 2 dimensions they are binomial coefficients:

More precisely, they are ‘central’ binomial cofficients, forming the middle column of Pascal’s triangle:

So, it seems that with some real work one can get vastly more informative results than with my argument using group representation theory. The only thing you don’t get, *so far*, is an appealing explanation of *why* the even moments are integral in dimensions 1, 2 and 4.

The computational approach also opens up a huge new realm of questions! For example, are there any dimensions *other* than 1, 2 and 4 where the even moments are all integral?

I was especially curious about dimension 8, where the octonions live. Remember, 1, 2 and 4 are the dimensions of the *associative* normed division algebras, but there’s also a *nonassociative* normed division algebra in dimension 8: the octonions.

The d = 8 row seemed to have a fairly high fraction of integer entries:

I wondered if there were only finitely many entries in the 8th row that weren’t integers. Greg Egan did a calculation and replied:

The d=8 moments don’t seem to become all integers permanently at any point, but the non-integers become increasingly sparse.

He also got evidence suggesting that for *any* even dimension d, a large fraction of the even moments are integers. After some further conversation he found the nice way to think about this. Recall that

If we let

then this moment is just

so the question becomes: when is this an integer?

It’s good to think about this naively a bit. We can cancel out a bunch of stuff in that ratio of binomial coefficents and write it like this:

So when is this an integer? Let’s do the 8th moment in 4 dimensions:

This is an integer, namely the Catalan number 42: the Answer to the Ultimate Question of Life, the Universe, and Everything. But apparently we had to be a bit ‘lucky’ to get an integer. For example, we needed the 10 on top to deal with the 5 on the bottom.

It seems plausible that our chances of getting an integer increase as the moment gets big compared to the dimension. For example, try the 4th moment in dimension 10:

This not an integer, because we’re just not multiplying enough numbers to handle the prime 5 in the denominator. The 6th moment in dimension 10 is also not an integer. But if we try the 8th moment, we get lucky:

This is an integer! We’ve got enough in the numerator to handle everything in the denominator.

Greg posted a question about this on MathOverflow:

• Greg Egan, When does doubling the size of a set multiply the number of subsets by an integer?, 9 July 2018.

He got a very nice answer from a mysterious figure named Lucia, who pointed out relevant results from this interesting paper:

• Carl Pomerance, Divisors of the middle binomial coefficient, *American Mathematical Monthly* **122** (2015), 636–644.

Using these, Lucia proved a result that implies the following:

**Theorem.** If we fix a sphere of some even dimension, and look at the even moments of the probability distribution of distances between randomly chosen points on that sphere, from the 2nd moment to the (2m)th, the fraction of these that are integers approaches 1 as m → ∞.

On the other hand, Lucia also believes Pomerance’s techniques can be used to prove a result that would imply this:

**Conjecture.** If we fix a sphere of some even dimension > 4, and consider the even moments of the probability distribution of distances between randomly chosen points on that sphere, infinitely many of these are *not* integers.

In summary: we’re seeing a more or less typical rabbit-hole in mathematics. We started by trying to understand how noncommutative quaternions are on average. We figured that out, but we got sidetracked by thinking about how far points on a sphere are on average. We started calculating, we got interested in moments of the probability distribution of distances, we noticed that the Catalan numbers show up, and we got pulled into some representation theory and number theory!

I wouldn’t say our results are earth-shaking, but we definitely had fun and learned a thing or two. One thing at least is clear. In pure math, at least, it pays to follow the ideas wherever they lead. Math isn’t really divided into different branches—it’s all connected!

### Afterword

Oh, and one more thing. Remember how this quest started with John D. Cook numerically computing the average of over unit quaternions? Well, he went on and numerically computed the average of over unit octonions!

• John D. Cook, How close is octonion multiplication to being associative?, 9 July 2018.

He showed the average is about 1.095, and he created this histogram:

Later, Greg Egan computed the exact value! It’s

On Twitter, Christopher D. Long, whose handle is @octonion, pointed out the hidden beauty of this answer—it equals

Nice! Here’s how Greg did this calculation:

• Greg Egan, The average associator, 12 July 2018.

### Details

If you want more details on the proof of this:

**Theorem.** If we fix a sphere of some even dimension, and look at the even moments of the probability distribution of distances between randomly chosen points on that sphere, from the 2nd moment to the (2m)th, the fraction of these that are integers approaches 1 as m → ∞.

you should read Greg Egan’s question on Mathoverflow, Lucia’s reply, and Pomerance’s paper. Here is Greg’s question:

For natural numbers , consider the ratio of the number of subsets of size taken from a set of size to the number of subsets of the same size taken from a set of size :

For we have the central binomial coefficients, which of course are all integers:

For we have the Catalan numbers, which again are integers:

However, for any fixed , while seems to be mostly integral, it is not exclusively so. For example, with ranging from 0 to 20000, the number of times is an integer for 2,3,4,5 are 19583, 19485, 18566, and 18312 respectively.

I am seeking general criteria for to be an integer.

Edited to add:We can write:

So the denominator is the product of consecutive numbers , while the numerator is the product of consecutive numbers . So there is a gap of between the last of the numbers in the denominator and the first of the numbers in the numerator.

Lucia replied:

Put , and then we can write more conveniently as

So the question essentially becomes one about which numbers for divide the middle binomial coefficient . Obviously when , always divides the middle binomial coefficient, but what about other values of ? This is treated in a lovely Monthly article of Pomerance:

• Carl Pomerance, Divisors of the middle binomial coefficient,

American Mathematical Monthly122(2015), 636–644.Pomerance shows that for any there are infinitely many integers with not dividing , but the set of integers for which does divide has density . So for any fixed , for a density set of values of one has that all divide , which means that their lcm must divide . But one can check without too much difficulty that the lcm of is a multiple of , and so for fixed one deduces that is an integer for a set of values with density 1. (Actually, Pomerance mentions explicitly in (5) of his paper that divides for a set of full density.)

I haven’t quite shown that is not an integer infinitely often for , but I think this can be deduced from Pomerance’s paper (by modifying his Theorem 1).

I highly recommend Pomerance’s paper—you don’t need to care much about which integers divide

to find it interesting, because it’s full of clever ideas and nice observations.

Much simpler result, but still very nice.. if you have a sphere in n-dimensional Euclidean Space and you insist that the surface area=the volume, then its radius is an Integer. And the integer is n.

Nice. This must follow from

which says that the volume of the sphere of radius R is the integral of the surface areas of spherical shells with radii going from 0 to The area of the spherical shell of radius is

where

is the area of the sphere of radius

Yes. I’m pretty sure that in general surface area=d/dr(volume) so then when you require surface are=volume you get a surprise differential equation d/dr(volume)=volume

What can this possibly mean?

I like to think of these spheres as “holographic spheres” ;-)

I think this should generalise to the radius of the inscribed sphere of any polytope whose faces all make contact with that sphere. It certainly holds for n-cubes (e.g. a cube of half-side 3 has volume and surface area both equal to 216), but it should also be true that the regular icosahedron whose surface area equals its volume must have an inscribed sphere of radius 3.

Greg – Neat generalization.

Over on Twitter, Nithilher the Colourless wrote approximately:

The numbers he’s talking about are the moments

In the case where not only the dimension but also the moment number is even we should be able to prove his guess using the formula

Anyone want to take a try?

There must be a somewhat similar formula when is odd.

Just in case no one has noticed, if s has the distribution from Part 1, and , then x has a Beta distribution. I think you might be asking something like: when does have all moments integral?

Nice! Since I don’t know much about Beta distributions, this doesn’t help me. But it could help someone who knew about them, and there’s a chance someone has already studied the problem in this guise!

I’m not sure that’s true. The substitution , and the right choice of parameters for the Beta distribution will make proportional to , but when you do a change of variable the probability density function also picks up a factor from the derivative of the transformation.

I believe Greg’s objection is correct. It makes me happy in a perverse way, because sometime I may want to do a literature search to see which of our results are new, and this may excuse me from having to read the literature on moments of Beta distributions.

so it still has the form of a beta distribution. No?

Graham’s right, you can tweak the parameter to account for the derivative and match the probability distribution, so the relevant Beta distribution becomes .

There is one remaining catch, though: the change of variables means that the original moments now come from powers, not of , but of .

So the moments of these Beta distributions need to be multiplied by powers of 4 to make them integral. For example, to get the Catalan numbers, you need to multiply the mth moments of the Beta(3/2,3/2) distribution by .

I think everything is easier if you look at squared Euclidean distances. For example: Consider one point at (1,0,0…0), and a random point at (x1,x2,…xn). Let x = x1 and D be the sum of squares of x2,…xn. The squared distance is (1-x)^2 + D = 1-2x+x^2+D = 2-2x. The squared distance to the ‘mirror’ point (-x1,x2,…xn) is (1+x)^2 + D = 2+2x. So the squared distance has a symmetric distribution in [0,4]. In particular its mean is 2 for all dimensions. (Greg’s formula shows this too of course.) As for the factors of 4, just look at spheres with diameter 1 instead of radius 1!

Sorry for doubting you about the Beta distribution.

Squared distances are what I use in Part 1 and also Random points on a group. Basically, polynomials are good but square roots suck—a lesson I always emphasize in my calculus classes!

Thinking about this a bit more I suspected that there would be a relationship between Dirichlet distributions on the unit simplex and uniform distributions on spheres. Google found this

for me, and Lemma 2.3 is a more general version of what I guessed. Those Rademacher distributed epsilons sound scary but they are just random + or – signs. The case p=2 is the one we’re talking about here.

…and somehow, this is really all about biology!

https://johncarlosbaez.wordpress.com/2014/01/22/relative-entropy-in-evolutionary-dynamics/

I’ll just mention that “Lucia” is the nom de plume of a pretty well-known number theorist with impeccable credentials. I’m contractually obligated as a MathOverflow moderator not to say who, but it’s a he.

Thanks. It simplifies life a bit knowing the gender of this being.

This is great stuff! I’ll have to clear some time (and find some mental focus) to explore it myself. I love unexpected appearances of or , all the more so after I found one of my own.

Congratulations on finding your very own. I’ll have to check that out.

By the way, it would be nice to settle this:

Conjecture.In dimensions 1, 2 and 4, andonly in these dimensions, all the even moments of the probability distribution of distances between two independently and uniformly distributed points are integers.It’s only the italicized phrase that’s left to show, and we can probably do that by looking at the 4th moment. If the dimension is even, say we have a nice formula for the moment:

and this is an integer only if is 1 or 2, i.e. is 2 or 4.

So, we only need to handle all the odd dimensions. We’ve been sort of sidestepping those. We can probably take the formula

and rewrite it in terms of factorials or binomial coefficients when is odd and is even.

It occurs to me that another reason to know about the odd dimensions would be to see if any formulas for the cumulants turn out nicely.

On MathOverflow, James Propp pushed the conversation in another direction:

Iosif Pinelis said that for every natural number the th moment is

Of course, this whole thing uses distance defined by the 2-metric.. d^2=x1^2+x2^2+…+xn^2 which is just a member of the metric family.. d^q=x1^q+x2^q+…+xn^q for any positive integer q. And there are many other metrics. I wonder how the results would play in different metrics?

http://mathworld.wolfram.com/SpherePointPicking.html

Or CLT and Walsh Hadamard transform. Note CLT applies as equally to differences as additions.

https://archive.org/details/bitsavers_mitreESDTe69266ANewMethodofGeneratingGaussianRando_2706065