More on Gaussian random numbers:

 

We wish to generate pseudo-random numbers from a probability density

                                                         (1)

We discussed one way of producing these numbers from pseudo-random numbers that are sampled from a uniform probability density between zero and one. The first procedure was based on the Central Limit Theorem.

 

Here we consider an alternative that is based on the inverse of the distribution function.

The distribution function is defined

                         (2)

 

While the  is pretty well known, there is no simple and close expression for  (the inverse of the distribution function). As a reminder, this inverse is really necessary, since the way we sample points is by

 

The lack of explicit expression for an inverse of a function is one of the common difficulties in using the above procedure. This is a point where there is a need to be creative in order to find a way around the problem. The Gaussian random numbers are so important that if a technique will not work in that case, it is a very bad sign…

 

Here is the solution for Gaussian pseudo-random numbers using an inverse of a distribution function:

 

The trick is to use a two-dimensional Gaussian instead of one-dimensional Gaussian. We have:

 

 

Consider the change of variable to  and

 

The probability density in the new variables is

 

The integral of the distribution function becomes (in the new variables)

 

 

If we now set  where is uniformly distributed, we have

We note that the angle  is already distributed uniformly between 0 and . To generate , we sample uniform numbers  between 0 and 1 and multiply the  by .

 

The two random number  and  are computed from the geometric relationship

 

 

or

 

 

 

It is possible to avoid the (expensive) calculation of trigonometric function by using yet another trick of sampling points on the unit circle: