I'm trying to figure out why $x^2+y^2$ is uniform distributed while $x^2+y^2+z^2$ appears to be distributed as $\sqrt(x)$. Both distributions drop off once $x^2+y^2 $ is bigger than 1 or $x^2+y2+z^2$ is bigger than 1 presumably because the size is past the biggest circle/sphere that can be formed with the x,y,z uniform random constraints. I would have expected $x^2+y^2+z^2$ to be linearly distributed (i.e., because there should be 2x shells with SA ~ $2r^2$ should be than a shell with SA ~ $r^2$)
Here's the python code I've been using for reference:
x = np.random.uniform(0,1,1000000);
x1 = np.random.uniform(0,1,1000000);
x2 = np.random.uniform(0,1,1000000);
x3 = np.random.uniform(0,1,1000000);
x4 = np.random.uniform(0,1,1000000);
a=plt.hist((x**2+x1**2+x2**2),bins=100)
Deeper insight much appreciated.
Clarification: $x^2+y^2$ appear uniform when I plot the sum in a histogram with uniformly sized bins. $x^2+y^2+z^2$ appear $\sqrt(x)$ distributed in a histogram with uniformly sized bins.
This result is part of the paper published by Ishay Weissman in Statistics and Probability Letters in Statistics and Probability Letters $129, (2017), 147–154$. The constant property was first noticed by Adi Ben-Israel.
It is shown that
$$f_2(s) =\begin{cases} \frac{\pi}4 & ,0 \le s\le 1 \\ \arcsin\left( \frac{1}{\sqrt{s}} - \frac{\pi}4\right) &, 1\le s\le 2.\end{cases} $$
$$f_3(s) =\begin{cases} \frac{\pi}4\sqrt{s} & ,0 \le s\le 1 \\ \frac{\pi}{4}(3-2\sqrt{s}) & , 1 \le s \le 2 \\ 3\left[\arcsin\left( \frac{1}{\sqrt{s-1}} \right) - \frac{\pi}4\right]+\sqrt{s}\left[ \arctan\left(\sqrt{\frac{s-2}{s}} \right) - \arctan\left(\sqrt{\frac{1}{s(s-2)}} \right)\right] &, 2\le s\le 3.\end{cases} $$
The result can be obtained by convolution.