function q78
%takes a bootstrap sample of x 1000 times in order to estimate the var(S^2)
x=[5,4,9,6,21,17,11,20,7,10,21,15,13,16,8]; p=length(x)/(length(x)-1);
S2=[];
for i=1:10000
    bootx=sample(x,length(x));
    S2=[S2 p*var(bootx)];
end
disp(['bootstrap estimate of var(S^2) = ' num2str(var(S2))])