Xref: utzoo comp.lang.c:7396 sci.math:2872 Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c,sci.math Subject: Re: random number generator Message-ID: <2629@haddock.ISC.COM> Date: 18 Feb 88 17:41:29 GMT References: <11809@brl-adm.ARPA> <225800004@uxe.cso.uiuc.edu> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Followup-To: sci.math Organization: Interactive Systems, Boston Lines: 16 Followups to sci.math; this has nothing to do with C anymore. >[A good approximation to a Gaussian distribution can be obtained by >generating about 12 independent random numbers uniformly from [0,1), adding >them together, and dividing by 12.] Actually, the reason for using 12 of them (not "about 12") is that you don't need to rescale. The variance of the uniform distribution is 1/12, so adding 12 of them gives you a distribution with variance 1. If you subtract 6, you then have a good approximation of a standard Gaussian. I happen to prefer the polar-coordinate version, because it's mathematically exact, requires only one call to the uniform RNG per result, and is faster (or so I've been told). Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint