Law of Large Numbers and the Central Limit Theorem:
Generate N random variables that are uniformly distributed on [0,1] and find the average (e.g., in Matlab you can use sum(rand(1,N))/N). Is this number close to the expected
value of a uniform random variable? Plot this average versus N, and observe whether
it converges to the expected value.
Now do the same as above, except we subtract the mean, and normalize with √N instead of N, so that you have sum(rand(1,N)-0.5)/sqrt(N). Do this many (say M) times, which will give you M numbers at the end. What distribution should these
numbers follow if N is large? Draw a histogram of these M numbers using the hist
command to get a clue. Comment on the reason. What is the effect of N on your
conclusion. Say, if N = 2 would this work? What about N = 10? Include a brief
discussion that addresses these questions. Write a Python code.