1. Exponential
The exponential law is given by
It will be useful to calculate the probability that x be lower than
a given value X:
To generate a random number according to a given law, it is enough to generate
a random number r uniformly distributed beween 0 and 1 and to solve
for X. In the case of the exponential law, it is particularly easy to solve.
Combining (2) and (3) gives
Since r and (1-r) have exactly the same distribution, we can replace (1-r) by r and
finally obtain the formula to generate a random number X distributed according to
(1):
We will keep the same notation thoughout the remain of the text:
all the represent random
numbers following a uniform law on ]0,1].
|