This isn't very efficient whenGenerate

arandom variates uniformly distributed over [0,1). Call themu,_{1}u, ..._{2}u._{a}Compute

L= -log(1-_{i}U) for_{i}i= 1 toa. Each of theLhas the Exp(1) distribution._{i}Let

Sbe the sum of all theL._{i}Return

S/bas the gamma(a,b) random variate.