"Keith F. Lynch" <kfl@KeithLynch.net> wrote:
Do you mean that the values of the three coordinates are independently normally distributed, or that the distance from the origin is? It's not obvious to me that these would give the same distribution.
Allan Wechsler <acwacw@gmail.com> answered this on 3/10, but I didn't find his answer searching for "do you mean," and also there are some extra quirks in the following response: Ignoring constants, the normal distribution is like 1/exp(x^2). Independent distributions for the three axes combine by multiplying: 1 / (exp(x^2) exp(y^2) exp(z^2) )= 1/exp(x^2 + y^2 + z^2) Say r is the distance from the origin, r^2 = x^2 + y^2 + z^2. So the distribution is like 1/exp(r^2). Except for constants. And I think the converse has to be true too. Reminds me that a random walk of 2D grid steps gives a distribution whose contours approach circles. Two semi-related entries in HAKMEM: ITEM 26 (? via Salamin): (typos from scanning?) Let x be uniform on [0, 1], y be uniform on [0, 2ir], x and y independent. (2pi?) Calculate r = /-log x. (sqrt(-log x))?) Then r cos y and r sin y are two independent Gaussian distributed random numbers. ITEM 27 (Salamin): PROBLEM: Generate random unit vectors in N-space uniform on the unit sphere. SOLUTION: Generate N Gaussian random numbers and normalize to unit length. --Steve