Xref: utzoo comp.unix.questions:31290 comp.unix.wizards:25587 comp.unix.ultrix:7214 comp.unix.internals:2773 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!motcsd!lance From: lance@motcsd.csd.mot.com (lance.norskog) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.ultrix,comp.unix.internals Subject: Re: bad random generation Keywords: random Message-ID: <3927@motcsd.csd.mot.com> Date: 14 May 91 01:54:05 GMT References: <3262@bimacs.BITNET> Followup-To: comp.unix.questions Organization: Motorola CSD, Cupertino CA Lines: 24 yedidya@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