Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 exptools 1/6/84; site ihuxp.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!ihuxp!sesv From: sesv@ihuxp.UUCP (Steve Sommars) Newsgroups: net.math.stat Subject: Re: Need tests for random number generators Message-ID: <954@ihuxp.UUCP> Date: Fri, 11-Jan-85 15:42:57 EST Article-I.D.: ihuxp.954 Posted: Fri Jan 11 15:42:57 1985 Date-Received: Sat, 12-Jan-85 07:14:13 EST References: <553@oddjob.UChicago.UUCP> <467@ecsvax.UUCP> <220@uwstat.UUCP> Organization: AT&T Bell Labs, Naperville, IL Lines: 36 On a related topic, here is one non-obvious programming bug which bit me in an old Monte Carlo. I was using a random number generator several places in the program. The format of the call (translated from FORTRAN) value = random(&x); If 0 < x < 1, use x as the seed in the random number generator, x is modified in the process. After testing the subroutines individually (successfully), I combined them & tested the entire Monte Carlo. Wow! I was finding new resonances, elementary particles, etc. The whole framework of particle physics was shaken. My elation was quenched when I realized that I was using the random number generator as: value1 = random(&x1); value2 = random(&x2); value3 = random(&x3); The calculated result depended upon value1, value2 and value3. Since the random number was based upon a linear congruence generator, I was marching along a single sequence of numbers three times with constant phase difference. The three values turned out to be strongly correlated, this caused the erroneous Monte Carlo Results. The moral is, "In addition to all other testing of random number generators, make sure that they are initialized exactly once." Steve Sommars AT&T Bell Labs ...!ihnp4!ihuxp!sesv