function PAjB=BayesTheorem(PBAj,PAj, PBnotAj)
% format PAjB=LMTheorem020402(PBAj,PAj,PBnotAj)
% output PAjB = P(A_j|B)
% input  PBAj = P(B|A_j)
%        PAj  = P(A_j)
%     PBnotAj = P(B | ~A_j)
% Theorem 2.4.2 page 63 in
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th edition
% Written by Eugene.Gallagher@umb.edu 1/15/11
% http://alpha.es.umb.edu/faculty/edg/files/edgwebp.html
PAjB=PBAj*PAj/(PBAj*PAj+PBnotAj*(1-PAj))