Given x and y independently uniformly distributed in [-1,1], set r = x2+y2. If r = 0 or r > 1, throw them away and try another pair (x, y). Thus, all points left after this filtering process will be uniformly distributed within a unit circle. Then, for these filtered points, compute:
<math>
z_0 = x \cdot \sqrt{\frac{-2 \ln r}{r}}
</math>
and
<math>
z_1 = y \cdot \sqrt{\frac{-2 \ln r}{r}}
</math>
The second method is faster because it uses only one transcendental function[?] instead of three, even though it throws away 21% of the numbers.
... the population is spread out with 24.7% under the age of 18, 7.4% from 18 to 24, 32.6% from 25 to 44, 23.2% from 45 to 64, and 12.2% who are 65 years of age or older. The ...