2

Assume 3 random variables $x,y,z \sim U(0,1)$, which we consider to be a 3D coordinates in a cartesian box.

Assume we define now $k(x_1,y_1,z_1,x_2,y_2,z_2) = \sqrt{(x_1-x_2)^2 + (y_1-y_2)^2 + (z_1-z_2)^2}$

What's the distribution of $k$?

My try is:

Consider 2 random variables $x_1, x_2 \sim U(0,1)$ then define $p=x_1 - x_2$.

Clearly $p \sim U(-1,1)$, therefore $\sqrt{(x_1-x_2)^2 + (y_1-y_2)^2 + (z_1-z_2)^2} \sim U(0,\sqrt{3})$.

0x90
  • 1,641

1 Answers1

4

MathWorld calls this cube line picking and gives a closed form for the distribution due to Mathai et al. $$P(k=d)=\begin{cases} -d^2((d-8)d^2+\pi(6d-4))&0\le d\le 1\\ 2d((d^2-8\sqrt{d^2-1}+3)d^2-4\sqrt{d^2-1}+12d^2\sec^{-1}d+\pi(3-4d)-1/2)&1\le d\le\sqrt2\\ d((1+d^2)(6\pi+8\sqrt{d^2-2}-5-d^2)-16d\csc^{-1}\sqrt{2-2/d^2}+16d\tan^{-1}d\sqrt{d^2-2}-24(d^2+1)\tan^{-1}\sqrt{d^2-2})&\sqrt2\le d\le\sqrt3 \end{cases}$$

Parcly Taxel
  • 103,344