% LMex040203_4th.m
% Example 4.2.3 Typographical Errors Page 285 in
% Larsen & Marx (2006) Introduction to Mathematical Statistics 4th Edition
% Written by Eugene Gallagher for EEOS601
% Eugene.Gallagher@umb.edu http://www.es.umb.edu/edgwebp.htm
% Written 1/7/2011, Revised 1/7/11
% Using the Poisson pdf
% ErrorRate=typographical Errors per page
% What is the probability that fewer than three typos will appear in a 16-
% page edition.
% X=Number of errors
ErrorRate=0.4;
lambda=ErrorRate*16;
fprintf('Using the Poisson cumulative distribution function:\n')
P=poisscdf(2,lambda);
fprintf('The probability that fewer than 3 typos will appear in a \n')
fprintf(...
'16-p document with an error rate of %3.1f per page is %5.3f.\n',...
lambda,P)
fprintf('\nUsing the Poisson probability distribution function:\n')
X=0:2;
P=sum(poisspdf(X,lambda));
fprintf('If the Poisson parameter = %3.1f, the probability of \n',lambda)
fprintf('fewer than 3 typos = %5.3f.\n',P)