You will implement three methods of generating random numbers from a standard normal. You will then compare them on the quality of the values they generated and the efficiency of the methods. Finally, you should analyze and present your findings in a well-written, well-organized report.
The main components that you have to implement for this assignment are three methods of generating random numbers that follow the standard normal distribution (more details below). Your top-level program should ask the user for a method and a number specifying how many values to generate. As with homework 2, you may develop your program in Java, C, C++, C#, Python, or a language of your choice (pending approval of the TA), and your program should provide some reasonable input prompts for the user, and its output should be stored and/or displayed in some reasonable way. For the core uniform random number generator, use the built-in library function.
You should prepare a README file (separate from the analysis report) for the grader. It should explain how to run your program and provide any other relevant information that might help the grader evaluate your program.
Since there is no closed form for the Standard Normal CDF, you must use an approximation. Bowling et al (2009) developed a closed-form approximation of the CDF that you should use:
Use the exponential with λ = 1 as your g(x). Keep track and report the average number of rejections in the write-up.
Use the most efficient version from the notes.
To compare the three methods, you should generate a large number of instances for each method (e.g., 10,000). Use the timer function that’s built in to your programming language to profile how long each method took. Build histograms of the generated numbers.
Describe your experiment in a report. Your report should include the following:
The assignment is due Thursday, March 3 by 11:59 pm.
Zip your source code files, your write-up, and your README into one zip file and upload it to CourseWeb, in the Homework 3 location.
For more advice on submitting your assignment, see the Assignments section of the Tips for Success page.