home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / sci / math / stat / 1702 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  1.7 KB

  1. Path: sparky!uunet!centerline!noc.near.net!news.Brown.EDU!qt.cs.utexas.edu!cs.utexas.edu!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
  2. From: hrubin@pop.stat.purdue.edu (Herman Rubin)
  3. Newsgroups: sci.math.stat
  4. Subject: Re: Generating a set of random bits
  5. Message-ID: <57248@mentor.cc.purdue.edu>
  6. Date: 19 Aug 92 14:44:11 GMT
  7. References: <36984@sdcc12.ucsd.edu>
  8. Sender: news@mentor.cc.purdue.edu
  9. Organization: Purdue University Statistics Department
  10. Lines: 27
  11.  
  12. In article <36984@sdcc12.ucsd.edu> whart@cs.ucsd.edu (Bill Hart) writes:
  13. >I have an application for which I need to generate a random 'vector' of 
  14. >bits of length N.  I have looked at stuff in Numerical Recipies for
  15. >generating a random sequence of bits, but it remains unclear whether
  16. >such a generator would be appropriate for generating a random
  17. >vector of bits.
  18.  
  19. >I need/want to have the distribution of vectors remain 'random'.  Right
  20. >now I'm generating a random float in [0,1> and testing to see
  21. >if it is less than 0.5 or not.  This works, but I'm sure there is
  22. >a better way of doing this.
  23.  
  24. >Any ideas or pointers?
  25.  
  26.  
  27. I would suggest using a long-gap shift-register procedure, using
  28. XOR or + (if full word integer addition is possible).  By long-gap,
  29. I mean something like using the n-406 and the n-607 words to get
  30. the n-th word.  If the appropriate length seed (here 607 words) is
  31. something like physically generated (or even the noise from usenet
  32. news), the individual bits should be fairly good, at least after a
  33. few runs to hand initial bias.
  34. -- 
  35. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  36. Phone: (317)494-6054
  37. hrubin@pop.stat.purdue.edu (Internet, bitnet)  
  38. {purdue,pur-ee}!pop.stat!hrubin(UUCP)
  39.