Re: [Algorithms] Random Numbers
Brought to you by:
vexxed72
From: <ia...@cs...> - 2000-09-08 08:49:47
|
On Thu, 7 Sep 2000, Johan Hammes wrote: > Hi > > I need a random number sequence with Gauss distribution. Do you know of an > algorithm that can do this. I asume that rand() generates white noise. I've been using this: double dgauss() { return sqrt(-2 * log(drand())) * cos(6.283185307 * drand()); } drand() gives evenly distributed numbers. The other alternative is sum of n evenly distributed numbers, with n = 30 the result should have gaussian distribution. AFAIK. Search for "+random +number +gaussian +generator +source +code". Does anyone know of a good book or other reference that'd explain various aspects of generating random numbers to someone that's not so much mathematically inclined? E.g. how to test whether a random number generator is good etc? Ismo -------------------| M.Sc., Assistant | My ehticator machine must've had a built-in moral Dept. of CS | compromise spectral release phantasmatron! I'm a Univ. of Joensuu | genius! ia...@cs... | -- Calvin Tel:(013)251 5329 | GSM: 040 774 3722 | |