home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / sci / math / stat / 1516 < prev    next >
Encoding:
Internet Message Format  |  1992-07-27  |  2.0 KB

  1. Path: sparky!uunet!mcsun!uknet!warwick!cam-cl!cam-cl!nmm
  2. From: nmm@cl.cam.ac.uk (Nick Maclaren)
  3. Newsgroups: sci.math.stat
  4. Subject: Re: C source for Park-Miller "minimal std. generator":
  5. Keywords: pseudo-random, C , uniform, normal
  6. Message-ID: <1992Jul27.091110.23852@cl.cam.ac.uk>
  7. Date: 27 Jul 92 09:11:10 GMT
  8. References: <1992Jul25.191638.16109@samba.oit.unc.edu> <l73ggjINNh52@almaak.usc.edu>
  9. Sender: news@cl.cam.ac.uk (The news facility)
  10. Reply-To: nmm@cl.cam.ac.uk (Nick Maclaren)
  11. Organization: U of Cambridge Computer Lab, UK
  12. Lines: 34
  13.  
  14. In article <l73ggjINNh52@almaak.usc.edu>, ajayshah@almaak.usc.edu (Ajay
  15. Shah) writes:
  16. |> #include <stdio.h>
  17. |> 
  18. |> /* This file implements the "minimal standard" RNG
  19. |>    from the paper "RNGs: Good Ones are Hard to Find" by Park and
  20. |>    Miller, CACM, Volume 31, Number 10, October 1988. */
  21. |>
  22. |> ...
  23.  
  24. PLEASE, PLEASE don't use this generator for serious work (i.e. any project
  25. which uses more than a million numbers or so IN ALL) without checking!
  26.  
  27. Park and Miller's paper is quite good, but is rather optimistic in their
  28. ideas of what is a minimal reliable generator.  Unfortunately, the same is
  29. true of Marsaglia's (with co-authors) papers "Towards a Universal Random
  30. Number Generator" and "A Random Number Generator for PCs", and Marsaglia
  31. is one of the people who lead this field!  Good RNGs are very, very hard to
  32. find.
  33.  
  34. Any generator which EITHER has a 32-bit seed OR is based on conventional
  35. single-precision starts to give seriously misleading results for sequences
  36. of a few million numbers.  See N.M. Maclaren "A Limit of the Usable Length
  37. of a Pseudo-random Sequence" J.Statist.Comput.Simul. 42 pp 47-54 for the
  38. proof of the first statement - the proof of the second is trivial to derive
  39. using the same techniques, because of the 24-bit precision limit.
  40.  
  41. Nick Maclaren
  42. University of Cambridge Computer Laboratory,
  43. New Museums Site, Pembroke Street,
  44. Cambridge CB2 3QG, England.
  45. Email:  nmm@cl.cam.ac.uk
  46. Tel.:   +44 223 334761
  47. Fax:    +44 223 334679
  48.