% LMex040205_4th.m
% Example 4.2.5 page 292 in 
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th edition
% Written by Eugene.Gallagher@umb.edu for EEOS601
% If the Perseid meteor shower has a rate of 40 per hour, Poisson
% distributed, calculate the probability that someone would have to wait 5
% minutes before seeing another.
% y= interval in minutes between consecutive sightings
% Using the symbolic math toolbox
fprintf('Exact P=\n')
syms y; disp(int(40/60*exp(-40/60*y),5,inf))
P=eval(int(40/60*exp(-40/60*y),5,inf));
fprintf('If the Perseids have a Poisson parameter = 40/60 per min., \n')
fprintf('an observer would have p=%6.4f of waiting 5 or more \n',P)
fprintf('minutes between consecutive meteors.\n')