Java example
In Figure 3-11, we simulated a time series using random integers for the event times. To properly simulate events occurring at random times, we should instead use a process that generates timestamps whose elapsed time between events is exponentially distributed.
The CDF for any probability distribution is an equation that relates the probability P = F(t) to the independent variable t. A simulation uses random numbers that represent probabilities. Therefore, to obtain the corresponding time t for a given random probability P, we must solve following the equation for t:

That is:

Here, y = ln(x) is the natural logarithm, which is the inverse of the exponential function x = ey.
To apply this to our preceding Help Desk example, where λ = 0.25, we have:

Note that, this time, t will be positive because the expression on the right is a double negative (ln (1–P) will be negative since 1 – P < 1).
The program in Listing 3-7 implements that formula at lines 14-17. At line 15, the time()
method...