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