function y=function1
intensity=.1;
time(1)=0;
i=2;

while intensity>0
    n_1(i-1)=(-1/intensity)*log(rand);
    time(i)=n_1(i-1)+time(i-1);
    if time(i)<=100
    i=i+1;
    else 
        break
    end
end
 
for n=1:i-1
    f_1(n)=time(n);
end

n=[0:1:i-2];
figure(1);
stairs(f_1,n);
xlabel('time')
ylabel('count')
saveas(figure(1),['HW1 prob 2.png'])