Mail Archives: djgpp/1997/03/12/23:42:12
George Foot (gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk) wrote:
: Dave Cigna (cigna AT helios DOT phy DOT OhioU DOT Edu) wrote:
: : The numbers will still not be uniformly distributed. Smaller values are
: : more likely than large ones. To understand why, remember that random()
: For the record, random() returns numbers from 0 to MAXINT, which is one
: less than power of two. It also guarantees that *any* bit combination
: you choose will return a uniformly random distribution; e.g. random()&5
: will give numbers from {0,1,4,5} with a uniform distribution.
There is something to be said for using a portable RNG that produces the
output that you want (I use the Wychman & Hill Appl Statist Algorithm 186
which is supposed to be fairly good -- run through f2c -- though I have
recently downloaded "ranlux"). David Duffy.
- Raw text -