From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: randN Date: Tue, 23 Nov 1999 09:16:55 +0200 Organization: NetVision Israel Lines: 15 Message-ID: References: <383904BA DOT AE45DCDE AT mpx DOT com DOT au> <81bigt$1i5 AT acp3bf DOT knirsch DOT de> NNTP-Posting-Host: is.elta.co.il Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: news.netvision.net.il 943341325 4483 199.203.121.2 (23 Nov 1999 07:15:25 GMT) X-Complaints-To: abuse AT netvision DOT net DOT il NNTP-Posting-Date: 23 Nov 1999 07:15:25 GMT X-Sender: eliz AT is In-Reply-To: <81bigt$1i5@acp3bf.knirsch.de> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 22 Nov 1999, Hans-Bernhard Broeker wrote: > The typical method works by transforming the distribution. A much simpler way is to generate 6 uniform random number (by calling e.g. rand() 6 times), then return their average, suitably scaled to give the normal Gaussian deviate (if I'm not mistaken, subtract 3 from the average and divide the result by the square root of 2). While seemingly stupid, this method is actually good enough to be included as part of respectable numerical libraries such as IMSL. The theory behind it is the well-known theorem which states that the sum of a large number of independent random numbers approaches the normal distribution.