function statsOfmean(N,M,a)
    x = -a*log(rand(N,M));
    mu = mean(x,1);
    figure(1)
    histogram(mu,'normalization','pdf');
    mean_mu = mean(mu);
     std_mu =  std(mu);
    mean_theory = a;
     std_theory = a/sqrt(N);
    str = sprintf('\\mu=%0.3f, \\mu_{theory}=%0.3f, \\sigma=%0.3f, \\sigma_{theory}=%0.3f',mean_mu,mean_theory,std_mu,std_theory);
    title(str)
    xlabel('x')
    ylabel('probability density')
    if N==18
    graphToPDF(sprintf('statsOfmean%d.pdf',N),4,3)
    end
 
end