Generating random variables.

Suppose that we are given an random variable X that is uniformly distributed over the open interval (0,1) and that we wish to generate sample values for another random variable Y with probability distribution function F1(y). To do so, we find a monotonically increasing function y=g(x) and then simply evaluate it at sample values from the random variable X. The function y=g(x) is defined by the inverse of F1(y) restricted to the domain (0,1).

Example.

Suppose that we want to generate values from an exponential pdf F1(y)=1-exp(-a*y) if y is positive, and F1(y)=0 if y non-positive. Since F1-1(y) = -ln(1-y)/a, the function of interest is y=g(x)=-ln(1-x)/a.