%prob3

intensity = 0.1;

for i=1:1000;
u_1 = random('uniform',0,1,i);
d_1 =-log(u_1)/intensity;
time1 = zeros(1,i);

	for j=2:i;
		time1(j) = time1(j-1) + d_1(j-1);
	end;

sum_1=0;

	for k=1:i;
		if time1(k)>=10 && time1(k)<=20;
			sum_1=sum_1 + 1;
		else
			sum_1 = sum_1;
		end;
	end;

ht(i) = sum_1;
end;
figure(1)
hist(ht);
saveas(figure(1),['HW1 prob 3.png'])