Box-Muller Transformation

Although Excel has a variety of commands for generating Normally distributed random variables, the Box-Muller technique is useful in the absence of Excel paraphernalia.

Box-Muller Transformation goes like so:

Let X and Y be two uniformly distributed, independent random variables lying between 0 and 1 and define:
      P = SQRT(-2 * lnX) cos(2π*Y)
      Q = SQRT(-2 * lnX) sin(2π*Y)

Then
      (P2 + Q2) /2= - lnX [cos2(2π*Y) + sin2(2π*Y)] = -ln X

Hence
      X = e- (P2 + Q2) /2