🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.math.stat
Article #85

Re: C source for Park-Miller "minimal std. generator":

#85
From: Nick Maclaren
Date: Mon, 27 Jul 1992 09:11
34 lines
2048 bytes
In article <l73ggjINNh52@almaak.usc.edu>, ajayshah@almaak.usc.edu (Ajay
Shah) writes:
|> #include <stdio.h>
|> 
|> /* This file implements the "minimal standard" RNG
|>    from the paper "RNGs: Good Ones are Hard to Find" by Park and
|>    Miller, CACM, Volume 31, Number 10, October 1988. */
|>
|> ...

PLEASE, PLEASE don't use this generator for serious work (i.e. any project
which uses more than a million numbers or so IN ALL) without checking!

Park and Miller's paper is quite good, but is rather optimistic in their
ideas of what is a minimal reliable generator.  Unfortunately, the same is
true of Marsaglia's (with co-authors) papers "Towards a Universal Random
Number Generator" and "A Random Number Generator for PCs", and Marsaglia
is one of the people who lead this field!  Good RNGs are very, very hard to
find.

Any generator which EITHER has a 32-bit seed OR is based on conventional
single-precision starts to give seriously misleading results for sequences
of a few million numbers.  See N.M. Maclaren "A Limit of the Usable Length
of a Pseudo-random Sequence" J.Statist.Comput.Simul. 42 pp 47-54 for the
proof of the first statement - the proof of the second is trivial to derive
using the same techniques, because of the 24-bit precision limit.

Nick Maclaren
University of Cambridge Computer Laboratory,
New Museums Site, Pembroke Street,
Cambridge CB2 3QG, England.
Email:  nmm@cl.cam.ac.uk
Tel.:   +44 223 334761
Fax:    +44 223 334679
Technical Details
Message-ID: <1992Jul27.091110.23852@cl.cam.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!warwick!cam-cl!cam-cl!nmm
References: <1992Jul25.191638.16109@samba.oit.unc.edu> <l73ggjINNh52@almaak.usc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!warwick!cam-cl!cam-cl!nmm
From: nmm@cl.cam.ac.uk (Nick Maclaren)
Newsgroups: sci.math.stat
Subject: Re: C source for Park-Miller "minimal std. generator":
Keywords: pseudo-random, C , uniform, normal
Message-ID: <1992Jul27.091110.23852@cl.cam.ac.uk>
Date: 27 Jul 92 09:11:10 GMT
References: <1992Jul25.191638.16109@samba.oit.unc.edu> <l73ggjINNh52@almaak.usc.edu>
Sender: news@cl.cam.ac.uk (The news facility)
Reply-To: nmm@cl.cam.ac.uk (Nick Maclaren)
Organization: U of Cambridge Computer Lab, UK
Lines: 34