RE: Generating a normal 0,1
- To: mathgroup at yoda.ncsa.uiuc.edu
- Subject: RE: Generating a normal 0,1
- From: blachman%gtewd.dnet at gte.com (NELSON M. BLACHMAN)
- Date: Wed, 23 Jan 91 17:11:49 -0500
Generating a single standard normal random variable x is somewhat hard and slow, but generating two independent ones, x and y, is easy. Let u and v be two independent reals distributed uniformly between 0 and 1. Then x = Sqrt[-2 Log[u]] Cos[2 Pi v] and y = Sqrt[-2 Log[u]] Sin[2 Pi v] are independent zero-mean normal random variables with unit variance. This is established by noticing that the angle ArcTan[y/x] must have a uniform distribution like v/(2 Pi), and r = Sqrt[x^2 + y^2] must have a Rayleigh distribution with cumulative distribution function 1 - E^(-r^2/2), which can be set equal to 1 - u. Nelson M. Blachman GTE Government Systems Corp. Mountain View, California blachman%gtewd.dnet at gte.com