Salamin: Random points on the unit n-sphere can be generated without the need for sqrt and trig. Generate n+1 independent Gaussian random numbers, and normalize the vector to unit length. -- Gene
This can be used to generate a uniform [-1, 1] variable using three standard Gaussians together with the field operations and sqrt(): U[-1, 1] = Z^2/sqrt(X^2 + Y^2 + Z^2) This is very elegant, apart from the annoying sqrt(). It transpires that we can actually dispose of the sqrt(), given an extra Gaussian: -------- Problem 1 (solved): Find a rational function (no sqrt allowed) of *four* standard Gaussians, which will produce a uniform U[a, b] distribution. Solution: http://mathoverflow.net/questions/164851/which-distributions-can-you-sample-... -------- Problem 2 (open): Can we do it with fewer than four Gaussians? It's obvious we need at least two, since erf is not a rational function. Sincerely, Adam P. Goucher