Web site translator - 118 RANDOM NUMBERS 3.4.1 To prove the validity
118 RANDOM NUMBERS 3.4.1 To prove the validity of this method, we use elementary analytic geometry and calculus: If 5 < 1 in step P3, the point in the plane with Cartesian coordinates (VI, VZ) is a random point uniformly distributed inside the unit circle. Transforming to polar coordinates VI = R cos 0, V2 = R sin 0, we find S = R2, Xi = &%n??cos 0, Xz = dm sin 0. Using also the polar coordinates X1 = R cos Q , X2 = R sin O , we find that 0 = 0 and R = dn. It is clear that R and 0 are independent, since R and 0 are independent inside the unit circle. Also, 0 is uniformly distributed between 0 and 215 and the probability that R < T is the probability that -2lnS < r2, i.e., the probability that S 2 ~ 27~. This equals 1 -e-r2/2, since S = E2 is uniformly distributed between zero and one. The probability that R lies between T and r+dr is therefore the derivative of l-eerai2, namely, ~e+ /~ dr. Similarly, the probability that 0 lies between 6 and 0 + d0 is (1/27r) &9. The joint probability that Xr 5 x1 and that Xz 2 52 now can be computed, it is -e --72/2 r dr de J 1 {(r,e)Ircoselsl,rsinB~zz}2~ 1 dz dy =---- ,-(~2+Y2)/2 27r J{(~,Y)I~l~l,Yl~Z) = 1 21 -x=/2 da: 1 x2 -Y=/2& . V-J5 -me WJ -me > 277 This proves that Xi and X2 are independent and normally distributed, as desired. (L?) The rectangle-wedge-tail method, introduced by G. Marsaglia. In this method we use the distribution (12) so that F(z) gives the distribution of the absolute value of a normal deviate. After X has been computed according to distribution (12), we will attach a random sign to its value, and this will make it a true normal deviate. The rectangle-wedge-tail approach is based on several important general techniques that we shall explore as we develop the algorithm. The first key idea is to regard F(z) as a mixture of several other functions, namely to write F(z) = PlFl(Z) + P2J72(Z) + . . . + P?zFn(Z>, (13) where Fi, F., . . . . F, are appropriate distributions and pl, pz, . . . , p, are nonnegative probabilities that sum to 1. If we generate a random variable X by choosing distribution Fj with probability pj, it is easy to see that X will have distribution F overall. Some of the distributions Fj(Z) may be rather difficult to handle, even harder than F itself, but we can usually arrange things so that the