dis=ones(6,1);
dis_cum=ones(6,1);

for i=1: 99
    
    dis_cum=conv(dis,dis_cum);
   
if i==1
    subplot(2,2,1);
    elements=length(dis_cum);
    xincs=[i+1:(elements+(i))];
    xvals=xincs*6/(length(dis_cum)+i);
    final=dis_cum/(6^(i+1));
    plot(xvals,final);
    sum(final);
    axis([1,6,0,max(final)+.05]);
    xlabel(strcat('Empirical Average at N=',num2str(i+1)));
    ylabel('P(x)dx');
end
if i==9
    subplot(2,2,2);
    elements=length(dis_cum);
    xincs=[i+1:(elements+(i))];
    xvals=xincs*6/(length(dis_cum)+i);
    final=dis_cum/(6^(i+1));
    plot(xvals,final);
    sum(final);
    axis([1,6,0,max(final)+0.05/i]);
    xlabel(strcat('Empirical Average at N=',num2str(i+1)));
    ylabel('P(x)dx');
end
if i==99
    subplot(2,2,3);
    elements=length(dis_cum);
    xincs=[i+1:(elements+(i))];
    xvals=xincs*6/(length(dis_cum)+i);
    final=dis_cum/(6^(i+1));
    plot(xvals,final);
    sum(final);
    axis([1,6,0,max(final)+0.05/i]);
    xlabel(strcat('Empirical Average at N=',num2str(i+1)));
    ylabel('P(x)dx');
end


end