bad random generation

lance.norskog lance at motcsd.csd.mot.com
Tue May 14 11:54:05 AEST 1991


yedidya at bimacs.BITNET (Yedidya Israel) writes:

>To whom it may concern:

>        Recently I used the random generator  random()  with the default
>seed to generate input for sorting programs.  While scanning the results,
>I noticed two pairs of very close numbers in the output.  When I then
>reviewed the input, I was disturbed to find that these numbers came from
>nearby positions in the input list, in positions 26 and 29, 27 and 30,
>respectively.  Since I am not an expert in random number generation, I
>should appreciate your reaction.

Ha ha ha!

The standard Unix distributions have always had buggy random number 
generators.  You're lucky you were printing them out.  Most of us
learned this one by writing a game or simulation, and then
wondering why some things never ever happened.

One of the Knuth books has an exhaustive (you will crawl for three days)
treatment of good random number generation.  Check it out.  Check them
all out.  The Knuth opus is a wellspring of practical software.

Lance



More information about the Comp.unix.wizards mailing list