

clear all
close all
  disp('Proportion of 6 in 2000 Rolls of a Fair Die Evaluated 2000 Times')
  lw = 2; 
  set(0, 'DefaultAxesFontSize', 16);
  rand('twister',0)
  fs = 15;

%die
M=2000; %M is number of different simulations
N=2000; %N is number of flipps
% psixs =[]; 
% for i = 1:M
% nsix=0;
% for j= 1:N
%     nsix = nsix + (rand<1/6);
% end
% psix = nsix/N;
% psixs = [psixs psix]; %collect all approximate probabilities
% end
     psixs = mean(unidrnd(6,N,M)==6);  %
figure(1)
hist(psixs, 20)
hold on
plot([1/6 1/6],[0 400],'r-', 'linewidth',4)
hold off




