Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the probability given two randomly directed unit vectors $x$, $x'$ in the nth dimension, that $x'$ will be close to the origin than $x$. Given that $x'$ begins where $x$ ends.. I am trying to find an expression generalized with the dimension n for the probability that $x'$ will be closer to the origin than $x$ is.

For example in the first dimension, on a single axis. $x$ can either be 1 or -1, given an equally random probability to go in either direction. $x'$ can then either start at 1, or -1. If it starts at 1, it could go to 2 or back towards 0. Similarly for -1, $x'$ can go to -2 or back towards 0. This gives a $0.5$ probability that $x'$ is closer to the origin than $x$ is in the 1st dimensions.

For the second dimension, the step that $x$ will take can land anywhere on the unit circle $a$ centered at the origin. Since $x'$ will start somewhere on $a$ and move in any direction it could land anywhere on the unit circle $b$ which has it's center on any point of $a$'s circumference. This means finding the probability that $x'$ is closer to the origin is $x$ is equivalent to asking what portion of $b$'s circumference is inside of $a$'s. This works out to be $.333\dots$$ for the 2nd dimension.

I do not know the proof in the 3rd dimension to show how much of a spheres SA would be within the others if both touched each others mid points but from a question I have asked on this Mathematics StackExchange before I found out it was $.25$ which equates to the probability I am trying to find in the 3rd dimension.

the trend among the first three dimensions leads to guess of $1/(1 + n)$ as a generalized expression for the probability. Where n is the dimension. Is there a way to check or prove/disprove this for each higher dimensions?

share|cite|improve this question
up vote 2 down vote accepted

Unfortunately your very plausible guess turns out to be wrong. You're looking for the fraction of the surface area of the sphere around $x$ that's within $\pi/3$ of the ray to the origin, and this can be computed as

$$ \frac{\displaystyle\int_0^{\pi/3}\sin^{n-2}\theta\,\mathrm d\theta}{\displaystyle\int_0^\pi\sin^{n-2}\theta\,\mathrm d\theta} $$

for $n\ge2$. For $n=2$ and $n=3$ this yields $1/3$ and $1/4$, respectively, as you found, but already for $n=4$ we have

$$ \frac{\displaystyle\int_0^{\pi/3}\sin^2\theta\,\mathrm d\theta}{\displaystyle\int_0^\pi\sin^2\theta\,\mathrm d\theta}=\frac13-\frac{\sqrt3}{4\pi}\approx0.1955\;, $$

almost but not quite $1/5$. You can compute these integrals recursively using integration by parts:

$$ \begin{align} \int_0^\alpha\sin^k\theta\,\mathrm d\theta &= \int_0^\alpha\sin\theta\sin^{k-1}\theta\,\mathrm d\theta \\ &= \left[-\cos\theta\sin^{k-1}\theta\right]_0^\alpha+(k-1)\int_0^\alpha\cos^2\theta\sin^{k-2}\theta\,\mathrm d\theta \\ &= -\cos\alpha\sin^{k-1}\alpha+(k-1)\int_0^\alpha(1-\sin^2\theta)\sin^{k-2}\theta\,\mathrm d\theta \end{align} $$

and thus

$$ \int_0^\alpha\sin^k\theta\,\mathrm d\theta =\frac1k\left( -\cos\alpha\sin^{k-1}\alpha+(k-1)\int_0^\alpha\sin^{k-2}\theta\,\mathrm d\theta\right)\;, $$

where the boundary term vanishes for $\alpha=\pi$ but not for $\alpha=\pi/3$.

For another problem involving spheres in $n$ dimensions in which similar integrals come up, see Puzzle: stars in the universe - probability of mutual nearest neighbors.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.