Central Limit Theorem. Let X1, X2, X3, ... be a sequence of i.i.d. random variables with finite mean μ and finite variance σ^2, and let Zn be the mean of the first n random variables in the sequence:
Zn = (X1 + X2 + ... + Xn) / n
(a) Let Xi, for i = 1, 2, ... be a uniform continuous random variable taking values in the interval (3, 7). Write a MATLAB program to plot the pdf of Zn. Consider n = 1, 2, 3, 10, 30, 100 and compare your results across different n's.
(b) Calculate analytically the mean and the variance of Xi and of Zn in part (a).
(c) Write a MATLAB program to generate a Gaussian random variable with the same mean and variance as Zn. Superimpose its pdf on the plots from part (a).
(d) Repeat parts (a), (b), and (c) with Xi representing a toss of a 5-sided that is described in Problem 1(d). Note that Xi and Zn are discrete in this case.
Hint. You can calculate the PDF analytically or empirically. For the later method, use t = 10^4 samples and while plotting histogram for discrete data, use 'BinWidth' as 1 / (n+1).