Gaussian random values. Implement the no-argument gaussian() function in StdRandom (Program 2.2.1) using the Box-Muller formula (see
Question:
Gaussian random values. Implement the no-argument gaussian() function in StdRandom (Program 2.2.1) using the Box-Muller formula (see ExerCISE 1.2.27). Next, consider an alternative approach, known as Marsaglia's method, which is based on generating a random point in the unit circle and using a form of the Box-Muller formula (see the discussion of do-while at the end of Section 1.3).
For each approach, generate 10 million random values from the Gaussian distribution, and measure which is faster.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction To Programming In Java An Interdisciplinary Approach
ISBN: 9780672337840
2nd Edition
Authors: Robert Sedgewick, Kevin Wayne
Question Posted: