function q74
% simulated arrival at a bus stop-question 74
%X=.5*(1+sin(pi*(rand(1,10000)-.5)));  %beta distribution
%X=-.5*log(rand(1,100000));  % exponential distribution
X=(-.1*log(rand(1,100000))).^2;  %wweibull distribution
Z=[];
while (sum(X)>10)
    Y=cumsum(X);
    i=1+sum(Y<10);  Z=[Z Y(i)-10]; 
    X=X((i+1):length(X));
end
disp(['your average wait/average time between buses=' num2str(mean(Z)/mean(X))])
    
