% PROGRAM TO DISPLAY THE POWER OF CENTRAL LIMIT THEOREM % Parameters and Storage Vectors clc; loops = 50000; n = 1; normmean = zeros(loops,1); cc = 1; % Loop to Draw from Chi-Square Probability Distribution while cc <= loops x = (randn(n,1)).^2; meanx = mean(x); normmean(cc,1) = sqrt(n)*(meanx - 1)/sqrt(2); cc = cc + 1; end % Graph Sampling Distribution hold on; histogram(normmean,50,'Normalization','pdf'); title('Simulated Sampling Distribution of Transformed Mean from Chi-Square(1) pdf'); % Superimposing Standard Normal Probability Distribution xvalues = (-5:0.01:5); f = (1/sqrt(2*pi))*exp(-0.5*xvalues.^2); plot(xvalues,f);