From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,13a53a863bda3aeb X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Source for Random Number Generator Date: 1997/02/08 Message-ID: #1/1 X-Deja-AN: 215207213 references: <5d8b95$oec@zeus.orl.mmc.com> <19970206153301.KAA04399@ladder01.news.aol.com> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1997-02-08T00:00:00+00:00 List-Id: In article <19970206153301.KAA04399@ladder01.news.aol.com> johnherro@aol.com writes: > The only guarantees are that it IS quick and it IS dirty! It'll > work in Ada 83 as well as Ada 95. Some mathematicians out there > will undoubtedly be able to improve on this: With a disclaimer like that from John, I can't be TOO hard on him, but...this sequence is anything but random. I can cite dozens of papers on the problems with LCGs, especially those with short periods and small multipliers. If you want to see the problem with this generator grapically, write a program that graphs the data. Either take pairs of numbers and use them as x and y coordinate values or better plot triples in three dimensions. Everything will line up in lines or planes, with large empty spaces in between. Some of the other generators that have been posted here are somewhat better, but only somewhat. I wouldn't use any of them to choose what I was going to have for dinner. ;-) If anyone wants to get serious about this, I have a set of tests I'll send them the source of. But the easiest thing to do is to use the generator built into GNAT. I could go into lots of gory details, but just say that there are lots of tests of randomness it can be proven will not fail, and there are lots of tests obvious and subtle that I have run against it. It works. Well if you need more than about 10 million random values per run talk to me. That is approaching the point where the theoretical proofs no longer apply, and is the limit of the testing I have done. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...