
196 Simulation Technologies in Networking and Communications
Listing 6: Implementation of acceptance–rejection method
Output:
>>> myrandom()
0.45907346850
7.3.4 misCellaneous meThoDs
There are many other methods to generate random variables from a given distribution. Some tech-
niques exploit the salient properties of the distributions to generate random variables from them. In
this section, we discuss some of those for both continuous and discrete cases.
7.3.5 example from ConTinuous DisTriBuTion
7.3.5.1 Example: The Erlang Distribution
The Erlang distribution is a continuous probability distribution that has relationship to the exponen-
tial and ...