home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #23 / NN_1992_23.iso / spool / sci / math / stat / 2155 < prev    next >
Encoding:
Internet Message Format  |  1992-10-16  |  1.2 KB

  1. Path: sparky!uunet!know!hri.com!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!ncar!csn!yuma!lamar!mglacy
  2. From: mglacy@lamar.ColoState.EDU
  3. Newsgroups: sci.math.stat
  4. Subject: Another RNG question
  5. Message-ID: <Oct16.195957.45264@yuma.ACNS.ColoState.EDU>
  6. Date: 16 Oct 92 19:59:57 GMT
  7. Sender: news@yuma.ACNS.ColoState.EDU (News Account)
  8. Organization: Colorado State University, Fort Collins, CO  80523
  9. Lines: 16
  10. Nntp-Posting-Host: lamar.acns.colostate.edu
  11.  
  12. I've been trying out a new RNG code. It appears to yield  a very
  13. nice random u.r.v (0,1).  (At least it looks fine under k-s tests,
  14. which is sufficient for my purposes.)  However,  when I use it  to
  15. generate uniformly distributed random *integers*, it produces lousy
  16. results.  I've just been multiplying each random real by 
  17. some N, and then truncating the result to an integer. To make
  18. the range be 1..N, I've then been adding 1 to the truncated result.
  19.  
  20. Any suggestions on why might be going wrong here?  Is this to
  21. be expected?
  22.  
  23. Thanks.
  24. =-=-=-=-=-=-=-=-=-==-=-=-=
  25. Mike Lacy, Sociology Dept.      CSU and I have a deal: We don't take
  26. Colo. State Univ.               responsibility for one another's opinions.
  27. Fort Collins CO 80523           voice (303) 491-6721
  28.