| Clearly,
Thus the inverse mapping is , then

The algorithmic steps for the inverse transform method for simulating discrete random variables are as follows:
- Generate a random number from
. Call it .
- Compute the value
such that .
- Take
to be the random number generated.
Generation of Bernoulli random numbers
Suppose we want to generate a random number from . Generate from the distribution set
|