Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!nosc!manta!north From: north@manta.NOSC.MIL (Mark H. North) Newsgroups: comp.lang.pascal Subject: Re: help on random number generator & t Summary: Beware of random number generators Message-ID: <1157@manta.NOSC.MIL> Date: 25 Jul 90 00:41:51 GMT References: <23899@adm.BRL.MIL> <13000011@uxh.cso.uiuc.edu> Organization: Naval Ocean Systems Center, San Diego Lines: 29 In the first place I wouldn't trust Press, et al since I found them to be quite confused concerning deconvolution -- perhaps they are not so confused in other areas, I don't know. Secondly, I wouldn't trust any canned 'random number generator' without testing. They usually aren't documented very well so you don't know what you are getting. And even if you are told what kind of RNG is being used you don't know if it is being implemented properly. For example, the multiplicative congruential RNG is one of the best (I have found) but its performance is dependent on the seed chosen. If the seed is even you can end up with very short sequences before repeat (as small as 2). There are other restrictions depending on the generator. The way some implementers deal with this is by resorting to jiggery-pokery with your seed to force it to conform to requirements. Unfortunately, by this we have lost all control of the situation. There are a number of tests used for RNGs such as the poker test, the run test, etc. However, the ultimate test for a RNG is in YOUR application. There is no substitute for sanity checks on what you are getting in your application. Unfortunately, when a RNG fails to perform in one's particular use the failure can be quite subtle, so beware. Anyone who blindly uses a RNG for a serious application is either ignorant or a fool. The best advice I can give is read and understand Knuth and the references he gives and then proceed with caution. Mark