Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!clyde!cuae2!ihnp4!inuxc!pur-ee!uiucdcs!uiucdcsb!kenny From: kenny@uiucdcsb.cs.uiuc.edu Newsgroups: sci.math Subject: Re: Need formula for Normal Distributio Message-ID: <9700056@uiucdcsb> Date: Tue, 28-Oct-86 14:50:00 EST Article-I.D.: uiucdcsb.9700056 Posted: Tue Oct 28 14:50:00 1986 Date-Received: Wed, 29-Oct-86 21:51:25 EST References: <146@helm.UUCP> Lines: 45 Nf-ID: #R:helm.UUCP:146:uiucdcsb:9700056:000:1637 Nf-From: uiucdcsb.cs.uiuc.edu!kenny Oct 28 13:50:00 1986 Excuse me for posting to the net; my mailer can't find a return path to your site. Date: Tue, 28 Oct 86 11:25:48 CST From: kenny@b (Kevin Kenny) Message-Id: <8610281725.AA17014@b.cs.uiuc.edu> To: helm!dlbaer Subject: Need formula for Normal Distributio /* Written 1:33 am Oct 26, 1986 by dlbaer@helm.UUCP in uiucdcsb:net.math */ /* ---------- "Need formula for Normal Distributio" ---------- */ >I need a formula for a simulation for a normal distribution. Send >email please. There are any number of ways for generating random variables having a Gaussian distribution. Probably the simplest is the ``polar method'' of Box, Muller and Marsaglia. V1 = 2*RND - 1 <--------+ V2 = 2*RND - 1 | S = V1*V1 + V2*V2 | IF S >= 1 THEN GOTO ----+ X1 = V1 * SQRT (-2 * LOG(S) / S) X2 = V2 * SQRT (-2 * LOG(S) / S) (Note that LOG here refers to the natural logarithm; some BASICs use LN to denote this function.) X1 and X2 are independent random variables of normal distribution with mean 0 and standard deviation 1. To get variables with mean M and standard deviation S, do Y = S * X + M There are any number of other methods; most of them are reviewed in Knuth Donald E. _The_Art_Of_Computer_Programming._ Voulme 2: _Semi- Numerical_Algorithms._ 2nd ed. Reading, Massachusetts, Addison-Wesley, 1981, pp. 117-127. Any decent library will have this reference. Kevin Kenny UUCP: {ihnp4,pur-ee,convex}!uiucdcs!kenny Department of Computer Science ARPA: kenny@B.CS.UIUC.EDU (kenny@UIUC.ARPA) University of Illinois CSNET: kenny@UIUC.CSNET 1304 W. Springfield Ave. Urbana, Illinois, 61801 Voice: (217) 333-7980