Selecting a Random Point Inside a Cube

587 Views Asked by At

A point $P$ is selected at random inside a cube. Find the probability that $\angle APB \geq 135^o$, where $\overline{AB}$ is a body diagonal of the cube.

enter image description here

I am not able to come up with the right condition or the right variable to integrate. Geometrically, I think, $P$ has to move in a region which is an intersection of two spheres and the given cube. I am not able to visualise that out properly too.

Please help me out. Thank you.

1

There are 1 best solutions below

0
On BEST ANSWER

WOLOG, consider the case where the cube is $[-1,1]^3$ and $A = (1,1,1)$, $B = (-1,-1,-1)$.

Let $P = (x,y,z)$ be any point inside the cube.
Let $\alpha$ be the angle $\angle APB$ and $r^2 = x^2+y^2+z^2$, $s = x+y+z$.
We have

$$\begin{align} \vec{PA}\cdot\vec{PB} &= (1-x)(-1-x)+(1-y)(-1-y) + (1-z)(-1-z) = - (3-r^2)\\ |\vec{PA}|^2 &= (1-x)^2 + (1-y)^2 + (1-z)^2 = 3+r^2 - 2s\\ |\vec{PB}|^2 &= (-1-x)^2 + (-1-y)^2 + (-1-z)^2 = 3+r^2 + 2s \end{align}$$ The condition $$\alpha \ge 135^\circ \iff \cos\alpha \le \cos135^\circ = -\frac{1}{\sqrt{2}} \quad\iff\quad\vec{PA}\cdot\vec{PB} \le -\frac{1}{\sqrt{2}}|\vec{PA}||\vec{PB}| $$ leads to $$\begin{align} & 3-r^2 \ge \frac{1}{\sqrt{2}}\sqrt{(3+r^2)^2 - 4s^2}\\ \stackrel{*}{\iff} & 2(3-r^2)^2 - (3+r^2)^2 + 4s^2 \ge 0 \iff (r^2 - 9)^2 \ge 72 - 4s^2\\ \stackrel{*}{\iff} & 9-r^2 \ge 2\sqrt{18-s^2} \iff r^2 \le 9 - 2\sqrt{18-s^2}\tag{*1} \end{align} $$ In above steps, the two marked $\stackrel{*}{\iff}$ is true because $3-r^2$ and $9-r^2$ are positive inside the cube.

Let $\Omega$ be the region in $\mathbb{R}^3$ determined by the last condition in $(*1)$ and $\mathcal{H}_t$ be the plane

$$\mathcal{H}_t = \big\{ (x,y,z) \in \mathbb{R}^3 : x+y+z = s = 3t \big\}$$

The intersection $\Omega \cap \mathcal{H}_t$ is a disk of radius $\rho(t)$ and

$$\rho^2(t) = r^2 - \frac{s^2}{3} = 9 - 2\sqrt{18-s^2} - \frac{s^2}{3} \implies \rho(t) = \sqrt{3} ( \sqrt{2-t^2} - 1)$$

If $\Omega$ lies completely inside $[-1,1]^3$, then the probability we want will be

$$\begin{align} \text{Prob}\;\stackrel{?}{=}\; & \frac{1}{8}\int_{-1}^1 \pi \rho(t)^2 \sqrt{3} dt = \frac{3\sqrt{3}\pi}{4}\int_0^1 (\sqrt{2-t^2}-1)^2 dt\\ =\; & \frac{(10-3\pi)\sqrt{3}\pi}{8}\approx 0.39125151339375 \end{align}\tag{*2} $$ The problem is near the two vertices $A$ and $B$, small portions of $\Omega$ extend beyond the cube $[-1,1]^3$. Following is a picture illustrating the geometry.

$\hspace0.8in$ admissible region $\Omega$

Let's consider what happens near $A$ where $t \sim 1$. If we intersect the cube $[-1,1]^3$ with the plane $\mathcal{H}_t$, $[-1,1]^3 \cap \mathcal{H}_t$ will be an equilateral triangle with centroid $(t,t,t)$. The mid points of the edges will be at a distance

$$\mu(t) = \sqrt{\frac32}\big(1-|t|\big)$$ from the centroid. When

$$\rho(t) > \mu(t) \quad\iff\quad |t| \ge \frac{2\sqrt{2}-1}{3}$$ the circle $\Omega \cap \mathcal{H}_t$ extend beyond the triangle $[-1,1]^3 \cap \mathcal{H}_t$. The portion outside the triangle is a union of 3 circle segments centered at $(t,t,t)$. Let $2\theta(t)$ be the angle span by any one of these circle segments with respect to $(t,t,t)$. We have

$$\cos\theta(t) = \frac{\mu(t)}{\rho(t)} = \frac{\sqrt{\frac32}(1-|t|)}{\sqrt{3}(\sqrt{2-t^2}-1)} = \frac{\sqrt{2-t^2}+1}{\sqrt{2}(1 + |t|)} $$

Elementary geometry tells us the area of any of these circle segments is $$\rho(t)^2\big( \theta(t) - \sin\theta(t)\cos\theta(t)\big)$$

If we extend the definition of $\theta(t)$ so that it vanishes for $|t| < \frac{2\sqrt{2}-1}{3}$, we can modify $(*2)$ and get

$$ \text{Prob} = \frac{3\sqrt{3}\pi}{4}\int_0^1 (\sqrt{2-t^2}-1)^2 \left[1 - \frac{3}{\pi}\big(\theta(t)- \sin\theta(t)\cos\theta(t)\big)\right] dt \tag{*2'} $$ The difference between $(*2)$ and $(*2')$ is given by following expression

$$\frac{9\sqrt{3}}{4}\int_{\frac{2\sqrt{2}-1}{3}}^1 (\sqrt{2-t^2}-1)^2 \big(\theta(t)- \sin\theta(t)\cos\theta(t)\big) dt$$ I don't know how to integrate this analytically. Numerical integration gives us a number $\approx 0.0025156775956542$ which is less than $1\%$ of that of $(*2)$. Finally, the probability we want is $$\bbox[8pt,border:1px solid blue]{ \text{Prob} \approx \frac{(10-3\pi)\sqrt{3}\pi}{8} - 0.0025156775956542 \approx 0.3887358357981 } $$ As a double check, I have split the cube $[-1,1]^3$ into $300^3$ smaller cubes and count the number of smaller cubes which satisfy $\cos\alpha \le \cos 135^\circ$. This gives me another estimate $\text{Prob} \approx 0.388734$. This is consistent with what we have just calculated.