No hardcore math this week, but we have something very interesting that any biologist can read, i.e. all you need to know is high school calculus and probability. (!!!)

Someone on livejournal posted this problem. Suppose you have a (hyper)sphere in n dimensions (don’t worry, no one can really imagine anything dimensions higher than 3 or 4). Suppose you randomly pick two points on the surface of the sphere. What is the expected distance? Here is my “solution”. :)


Without loss of generality, fix one point to be the north pole. Note that though you do not need to imagine a (hyper)sphere, you do need to imagine a 3D sphere, and know spherical coordinates. Let S_n(R) denote the surface area of a sphere with radius R, in n+1 dimensions. So S_1(R)=2 \pi R, S_2(R)=4 \pi R^2, S_3(R)=2 \pi^2 R^3 and so on.

Before proceeding, you might find it helpful to review spherical coordinates, or even look at hyperspherical coordinates by checking out http://en.wikipedia.org/wiki/Hypersphere. Alright let us move on.

Let us work in n+1 dimensions. (You may like to substitute n=2.)
Remember first point is the north pole. The main idea is to integrate circular strips from top to bottom. Each circle has radius R \sin \theta where R is radius of our sphere and \theta is the “zenith angle” (http://en.wikipedia.org/wiki/Spherical_coordinates). Each of these strips have a certain probability. Its surface area is S_{n-1}(R \sin \theta) \times R d\theta. R d\theta is like the thickness of this strip. Convince yourself at least for n=2. So the probability of picking a point on this strip is S_{n-1}( R\sin \theta) \times R d\theta / S_{n}(R).

In fact, S_{n}(R)=\int_{\theta=0}^{\pi} S_{n-1}(R \sin \theta) R d\theta. For example, \int_{\theta=0}^{\pi} 2 \pi (R \sin \theta) R d\theta is equal to 4\pi R^2 or S_{2}.


Every point on each strip has equal distance from the north pole. The distance is 2 \sin (\theta/2). (just draw a line between the two points and bisect \theta.) So, the expected distance is \int_{\theta=0}^{\pi} \frac{S_{n-1}(R \sin \theta) (R d\theta)}{S_n} \left( 2\sin (\theta/2) \right).

Let K_{n-1}=S_{n-1}(1) be surface area of unit sphere. Obviously, by rescaling, similarity etc, S_n=K_n R^n. Express the denominator as the integral over circular strips. Substitute in K_{n-1}. Cancel these constants to obtain the expected distance as

\frac{\int_{\theta=0}^{\pi} (\sin^{n-1} \theta) (2 \sin (\theta/2)) d \theta}{\int_{\theta=0}^{\pi} ( \sin^{n-1} \theta ) d\theta}. Great. At this point, you can crank up mathematica, type in the expression, and get ugly expressions and send n\rightarrow \infty. Very tempting but not nice. Let’s try something else ;) .

If you plot \sin^{n} \theta for \theta \in [0,\pi], you will notice that it becomes sharper and sharper at \theta=\pi/2. Aha, it is becoming like a delta function multiplied by a constant \int_{\theta=0}^{\pi} (\sin^{n} \theta) d\theta. Therefore, the expected distance is becoming 2 \sin (\theta/2) with \theta=\pi/2 which is \sqrt{2}.. We are more or less done.


This is the idea, but it is not rigorous. The rest of this post will make this as robust as titanium. However, it may also be a good point to stop reading.

I recall Stein and Shakarchi, chapter 3, section 2 on “good kernels and approximations to the identity”. This is what it says.

Suppose there is a family of functions \{ K_{\delta} (x) \} such that

  1. \int_{\mathbb{R}^d} K_{\delta}(x) dx=1
  2. \int_{\mathbb{R}^d} | K_{\delta}(x) | dx \leq A for some real number A independent of \delta
  3. For every \eta >0, \int_{|x|\geq \eta} | K_{\delta}(x)| dx \rightarrow 0 as \delta \rightarrow 0

Then for any bounded function f, we have (f * K_{\delta})(x) \rightarrow f(x) as \delta \rightarrow 0, where (f*K_{\delta})(x)=\int_{\mathbb{R}^d} f(x-y) K_{\delta}(y) dy is the convolution between f and K_{\delta}.

This K_{\delta}(x) is like \delta_{0}(x), a Dirac delta function at the origin. Often, we write \int \delta_{x_0}(x) f(x) dx = f(x_0). To be mathematically correct, we should write \delta_{x_0}(x) as K_{\delta}(x-x_0) instead. Now, the integral becomes a convolution between K_{\delta} and f and the above “theorem” gives us the answer f(x_0). Now back to our problem.


Scratch work: we want \delta_{\pi/2}(\theta) “equal” \frac{ \sin^{n} \theta }{\int_{\theta=0}^{\pi} (\sin^{n} \theta) d\theta} supported on \left[0,\pi \right]. Let \delta=1/n. Let u=\theta-\pi/2. Now we know we have to define K_{\delta}(u)=\frac{\sin^{1/\delta} (u+\pi/2)}{F_{\delta}} where F_{\delta}=\int_{\theta=0}^{\pi} \sin^{1/\delta}(\theta) d\theta is just some useless normalizing factor to make K_{\delta} satisfy condition 1. Notice that K_{\delta} is basically our \sin^{n}(x) over some constant, shifted to the left by \pi/2. Let us verify further that K_{\delta} is a good kernel/approximation.

Condition 2 is trivial since our function is nonnegative and condition 1 implies 2. Condition 3 is more tricky to check. Let’s work on it. Fix some \eta>0. Let \varepsilon= \cos \eta which is strictly less than 1.

By symmetry, the numerator of the integral (see condition 3 and the definition of K_{\delta}) is 2 \int_{\eta}^{\pi/2} \sin^{n}(x+\pi/2) dx \leq \pi \times \cos^n \eta, i.e. o(\varepsilon^n). The denominator F_{1/n} also grows small with n, but not as rapidly as we will show. Integrating by parts, we know that F_{1/n}=\frac{n-1}{n} F_{1/(n-2)}. Its lower bound turns out to be C/n for some small constant C.

For example, F_{1/9.5}=\frac{8.5}{9.5} \frac{6.5}{7.5} \frac{4.5}{5.5} \frac{2.5}{3.5} F_{1/1.5}. Insert extra factors of the form \frac{k-1}{k} to get a lower bound. Now, consecutive factors cancel off and we are left with some constant divided by 9.5. The same reasoning applies to any \delta=1/n.

In short, the numerator dies faster than the denominator and condition 3 is satisfied.

Next, let f(x)=2 \sin(x/2). Working backwards using the “scratch work”, we see that the expected distance is just integrating K_{1/n}(\theta-\pi/2) f(\theta), which is (K_{1/n}*f)(\pi/2), and must converge to f(\pi/2)=\sqrt{2} as n \rightarrow \infty. That is it. :)


Key ideas: Recognizing good kernels.

Advertisement