Database web hosting - 128 RANDOM NUMBERS 3.4.1 D. The exponential distribution.
128 RANDOM NUMBERS 3.4.1 D. The exponential distribution. After uniform deviates and normal deviates, the next most important random quantity is an exponential deviate. Such numbers occur in arrival time situations; for example, if a radioactive substance emits alpha particles at a rate so that one particle is emitted every p seconds on the average, then the time between two successive emissions has the exponential distribution with mean p. This distribution is defined by the formula F(x) = 1 - e–s/P, x 2 0. (31) (1) Logarithm method. Clearly, if y = F(z) = 1 -e+/p, then z = F- (y) = –I-L ln(1 -y). Therefore by Eq. (7), -p ln(1 -U) has the exponential distribu- tion. Since 1 - U is uniformly distributed when U is, we conclude that X = -plnU (32) is exponentially distributed with mean CL. (The case U = 0 must be avoided.) (2) Random minimization method. We saw in Algorithm F that there are simple and fast alternatives to calculating the logarithm of a uniform deviate. The following especially efficient approach has been developed by G. Marsaglia, M. Sibuya, and J. H. Ahrens. Algorithm S (Exponential distribution with mean CL). This algorithm produces exponential deviates on a binary computer, using uniform deviates with t-bit accuracy. The constants should be precomputed, extending until Q[k] > 1 - 21mt. Sl. [Get U and shift.] Generate a t-bit uniform random binary fraction U = (.blbz . . . bt)2; locate the first zero bit bj, and shift off the leading j bits, setting U + (.bj+l . . . bt)2. (As in Algorithm F, the average value of j is 2.) 52. [Immediate acceptance?] If U < In 2, set X t p(j In 2 + U) and terminate the algorithm. (Note that Q[l] = ln2.) 53. [Minimize. ] Find the least k 2 2 such that U < Q[k]. Generate k new uniform deviates VI, . . . , uk and set V t min(Ui, . . . , uk). S4. [Deliver the answer.] Set X c p(j + V) In 2. 1 Alternative ways to generate exponential deviates (e.g., a ratio of uniforms as in Algorithm R) might also be used.