function percentage = coinTossesHist(run_time, n)
% coinTosses should execute run_time flips of n coins, and return
% the percentage of time that the proportion of heads is between 0.4 & 0.6.
% Note: the answer you put in online at Project Probability should be
% the smallest n such that coinTosses(2000,n) consistently returns at least
% 95. (Reminder: percentage should be a number from 0 to 100.)
v=zeros(1,run_time); % initalize counter
for j = 1:run_time
flips = zeros(1,n);
% initialize the vector "flips" -- it starts off as a bunch of 0's
for i=1:n
flips(i) = randi(2)-1;
% at each cell of the vector, generator a random integer between 1 and
% 2 and subtract 1 from it (so we have a random integer between 0 and
% 1
end
proportion = sum(flips)/n;
v(j)=proportion;
end
percentage = 100*sum(v)/run_time; % percentage, so multiply proportion by 100.
hist(v,0:.01:1)
%%% All of your code should go above this line. %%%
end