% LMex020413_4th.m
% Example 2.4.13 Bayes theorem & polygraph p 64-65 in
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th edition
% Written by Eugene Gallagher
% Eugene.Gallagher@umb.edu
% Revised 1/3/2010
% Application of Bayes theorem
% P (Suspect innocent | Polygraph says guilty) = P
% P (Polygraph says guilty | Suspect innocent) = .02 % False positive
% P (Suspect innocent) = 1-12/100 =PI
% P (Polygraph says guilty | suspect guilty) = .9
% A1 = Suspect innocent
% PA2B= Probability of Tails given that the chip was white.
P=BayesTheorem(.02,1-12/100,.9) % Calls a function
P2=.02*(1-12/100)/(.02*(1-12/100)+.9*12/100)