MATH 494: Mathematical Foundations of Machine Learning

 

Assignment #3

 

(Due Monday, February 26, 2024)

 

 

 

The  goal of this assignment is to familiarize you with the practice of pseudo-random numbers generation. PRNGs are extensively used in machine learning for creating synthetic datasets to test various ML methods.

 

Generate M (the way to find M is explained below) pseudo-random numbers (PRNs) from the distribution U(0, 1) available in numpy, and find their sum. Repeat this N times, where N is a large number, for instance, 10000 or 100000. This way, you will obtain N numbers (sums). Obtain a histogram or a plot that illustrates their distribution. Compare it - preferably on the same plot - with the normal distribution, which you will obtain by showing the histogram (or plot) of N PRNs from the normal distribution generator in numpy, with appropriate parameters (mu and sigma). In the script comments, explain how you know what the appropriate parameters are.

 

M should be the sum of the last four digits of your USD ID #. I recommend using histograms, with options  bins=50  and  histtype='step'. I am sending you the code of  m494s24c9demo.py,  to help with the basics of PRN generation.