# Bayes' theorem

## In words...

Bayes' theorem allows the conditional probability of an event $A$ given another event $B$ to be expressed in terms of the conditional probability of $B$ given $A$ and the probabilities of $A$ and $B$.

## In maths...

Given two events $A$ and $B$, we have $$P(A|B) = \frac{P(B|A) P (A)}{P(B)}$$

The proof is a direct consequence of the definition of the conditional probabilities, $$P(A|B) = \frac{P(A\cap B)}{P(B)}$$ and $$P(B|A) = \frac{P(A\cap B)}{P(A)} ,$$ which implies $$P(A|B) P(B) = P(A\cap B) = P(B|A)P(A) .$$