% sample_mean.m
% Demonstrate how the mean and variance of the sample mean change with
% sample size.
% Author: David Pan (for EE 385)

sample_size = 10
run = 100000
Xavg = zeros(1, run);

for i = 1: run
    X = randn (1, sample_size);
    Xavg(i) = mean (X);
end

disp('E[X_bar] =');
mean(Xavg)
disp('Var[X_bar] =');
var(Xavg)