|
|
In article <4099991b$1@news.povray.org>,
"Chris Johnson" <chris(at)chris-j(dot)co(dot)uk> wrote:
> -[You can approximate a normal distribution of numbers...]-
> ...but this is an inefficient method. The standard method is the Box-Muller
> transform, given here in C.
If you can easily generate a few random numbers and don't need a very
close approximation, the averaging method can be faster. The problem
isn't really efficiency, it's accuracy...the result isn't all that close
to a normal distribution unless you use lots of points and rescale the
numbers to get out of the range of the original numbers.
> -[...and dividing the result by n]-
> Actually, with this method you need to divide by sqrt(n) if you want to keep
> the variance independent of n.
In the places where this approximation is used, that is rarely a
problem. It's often more useful to have a known range that the random
numbers are limited to. It's a very fast and easy way to get objects to
bunch up around a point with a roughly Gaussian distribution.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/
Post a reply to this message
|
|