% LMex040311_4th.m
% Example 4.3.11 Aptitude tests for a corporation Pages 313-314 in
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th edition
% Based on LMex040306_4th.m
% Written Fall 2010 by Eugene Gallagher for EEOS601 Revised: 1/8/11
% Eugene.Gallagher@umb.edu 
% http://alpha.es.umb.edu/faculty/edg/files/edgwebp.html
% The personnel department gives a verbal (Y1) and quantitative aptitude
% (Y2)test to all applicants. Y1 is normally distributed with mu1=50 and
% sigma1=20 and Y2 has mu2=100 and sigma2=20. Scores are independent. A
% composit score is assigned to each applicant: Y=3Y1+2Y2. The company
% rejects any applicant whose score is less than 375. If six individuals
% apply, what are the chances that fewer than half will fail the screening
% test?
mu1=50;
sigma1=10;
mu2=100
sigma2=20
cutoff=375;
n=6;
EY=3*mu1+2*mu2;
VarY=3^2*sigma1^2+2^2*sigma2^2;
fprintf('For a single applicant, the expected score is %3.0f with ',EY)
fprintf('variance = %4.0f\n',VarY);
Zscore=((375-EY)/sqrt(VarY))
P=normcdf(Zscore,0,1);
fprintf(...
    'The probability of a single applicant being rejected is %6.4f.\n',P)
fprintf(...
    'What is the probability that at most 2 of 6 will fail the test?\n');
P2=binocdf(2,6,P);
fprintf('The probability that fewer than half of 6 applicants will fail\n')
fprintf('the test is %6.4f.\n',P2)
