Path: utzoo!mnetor!uunet!mcvax!ukc!stc!root44!gwc From: gwc@root.co.uk (Geoff Clare) Newsgroups: comp.lang.c Subject: Re: random number generator Message-ID: <551@root44.co.uk> Date: 1 Mar 88 13:25:41 GMT References: <11809@brl-adm.ARPA> <225800004@uxe.cso.uiuc.edu> Reply-To: gwc@root44.UUCP (Geoff Clare) Organization: UniSoft Ltd, London, England Lines: 24 In article <225800004@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes: > >>Simplistic, but this works: >>Generate about 12 random numbers (assuming 0.0 <= i <1.0) > > ADD THEM TOGETHER SUBTRACT 6 !!!! > >>and divide by 12. This is sufficiently close to gaussian distribution >>for most purposes. The more numbers you generate before you do the >>division, the closer you will get to purely gaussian distribution. NO NO NO NO NO! Only *exactly* 12 random numbers used in this way will give an approximate Gaussian. Any other number will not give the right variance. (The variance of a uniform distribution over [0,1] is 1/12). -- Geoff Clare UniSoft Limited, Saunderson House, Hayne Street, London EC1A 9HH gwc@root.co.uk ...!mcvax!ukc!root44!gwc +44-1-606-7799 FAX: +44-1-726-2750