The probability of two events
A and
B happening,
P(A∩B), is the probability of
A (P(A)),times the probability of
B given that
A has occurred
(P(B|A)).
P(A∩B)=P(A)P(B|A) ....(1)
On the other hand, the probability of A and B is also equal to the probability of B times the probability of A given B.
P(A∩B)=P(B)P(A|B) ....(2)
Equating the two yields:
P(B)P(A|B)=P(A)P(B|A) .....(3)
and thus
P(A|B)=P(A)P(B|A)P(B) ....(4)
This equation, known as Bayes' theorem is the basis of statistical inference.