Bayes' Theorem

Theorem
Let $$\Pr$$ be a probability measure on a probability space $$\left({\Omega, \Sigma, \Pr}\right)$$.

Let $$\Pr \left({A | B}\right)$$ denote the conditional probability of $A$ given $B$.

Let $$\Pr \left({A}\right) > 0$$ and $$\Pr \left({B}\right) > 0$$.

Then:
 * $$\Pr \left({B | A}\right) = \frac {\Pr \left({A | B}\right) \Pr \left({B}\right)} {\Pr \left({A}\right)}$$

Proof
From the definition of conditional probabilities, we have:


 * $$\Pr \left({A | B}\right) = \frac{\Pr \left({A \cap B}\right)} {\Pr \left({B}\right)}$$


 * $$\Pr \left({B | A}\right) = \frac{\Pr \left({A \cap B}\right)} {\Pr \left({A}\right)}$$

After some algebra:


 * $$\Pr \left({A | B}\right) \Pr \left({B}\right) = \Pr \left({A \cap B}\right) = \Pr \left({B | A}\right) \Pr \left({A}\right)$$

Dividing both sides by $$\Pr \left({A}\right)$$ (we are told that it is non-zero), the result follows:
 * $$\Pr \left({B | A}\right) = \frac {\Pr \left({A | B}\right) \Pr \left({B}\right)} {\Pr \left({A}\right)}$$

Note
The formula:
 * $$\Pr \left({A | B}\right) \Pr \left({B}\right) = \Pr \left({A \cap B}\right) = \Pr \left({B | A}\right) \Pr \left({A}\right)$$

is sometimes called the product rule for probabilities.