Derivation of Bayes' Theorem

Bayes' Theorem is derived from the definition of conditional probability.

Definition of Conditional Probability:

The probability of AA given BB is:

P(AB)=P(AB)P(B),where P(B)>0P(A|B) = \frac{P(A \cap B)}{P(B)}, \quad \text{where } P(B) > 0

Similarly, the probability of BB given AA is:

P(BA)=P(AB)P(A),where P(A)>0P(B|A) = \frac{P(A \cap B)}{P(A)}, \quad \text{where } P(A) > 0

Where \cap means intersection, or joint probability, or the probability that AA and BB occur. Rearrange both equations:

From P(AB)P(A|B):

P(AB)=P(AB)P(B)P(A \cap B) = P(A|B) \cdot P(B)

From P(BA)P(B|A):

P(AB)=P(BA)P(A)P(A \cap B) = P(B|A) \cdot P(A)

Equate the two expressions for P(AB)P(A \cap B) and since both equations describe P(AB)P(A \cap B), set them equal:

P(AB)P(B)=P(BA)P(A)P(A|B) \cdot P(B) = P(B|A) \cdot P(A)

Then we solve for P(AB)P(A|B), divide through by P(B)P(B) (assuming P(B)>0P(B) > 0) to get the final form of Bayes' Theorem:

P(AB)=P(BA)P(A)P(B)P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}

where