home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / programm / 2317 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  1.8 KB

  1. Path: sparky!uunet!vtserf!creatures!csgrad.cs.vt.edu!lavinus
  2. From: lavinus@csgrad.cs.vt.edu (Joseph Lavinus)
  3. Newsgroups: comp.programming
  4. Subject: Re: Any simple Random Number generators?
  5. Message-ID: <3283@creatures.cs.vt.edu>
  6. Date: 14 Aug 92 14:28:43 GMT
  7. References: <13AUG199218224504@judy.uh.edu> <1992Aug14.104121.29374@corax.udac.uu.se>
  8. Sender: usenet@creatures.cs.vt.edu
  9. Organization: VPI&SU Computer Science Department, Blacksburg, VA
  10. Lines: 29
  11.  
  12. In article <1992Aug14.104121.29374@corax.udac.uu.se> pem@Minsk.DoCS.UU.SE (Per-Erik Martin) writes:
  13. >In article <13AUG199218224504@judy.uh.edu> cscc13@judy.uh.edu (NAVEED IQBAL) writes:
  14. >>I want to know how random numbers are generated.
  15.  
  16. >"Random number generators: Good ones are hard to find" by Stephen K. Park
  17. >and Keith W. Miller in Communications of the ACM October 1988 (v31n10).
  18. >This article also contains a proposed "minimal standard" generator which
  19. >is simple but yet quite good.
  20.  
  21. The article "Random Numbers for Simulation" by Pierre L'Ecuyer, from the
  22. October 1991 CACM (v33, page 85--97).  It contains some generators that
  23. are allegedly better than the minimal standard, and is a good article in
  24. general.
  25.  
  26. >>I want to get a "new" random number everytime I run the program.
  27.  
  28. >You simply "seed" the generator with the system clock when the program
  29. >is started.
  30.  
  31. Alternatively, each time the program finishes, generate one more random
  32. number and write it to a file.  Then, seed the generator with that number
  33. next time you run.
  34.  
  35. Joe
  36. -- 
  37. ______________________________________________________________________________
  38.  Joseph W. Lavinus (2816), Virginia Tech             email: lavinus@cs.vt.edu
  39.         "Few NP-hard problems remain difficult when restricted, say,
  40.            to the class of 1-vertex graphs." --- David S. Johnson
  41.