Bayes' Theorem/General Result

Theorem
Let $\Pr$ be a probability measure on a probability space $\left({\Omega, \Sigma, \Pr}\right)$. Let $\left\{{B_1, B_2, \ldots}\right\}$ be a partition of the event space $\Sigma$.

Then, for any $B_i$ in the partition:


 * $\displaystyle \Pr \left({B_i \mid A}\right) = \frac {\Pr \left({A \mid B_i}\right) \Pr \left({B_i}\right)} {\Pr \left({A}\right)} = \frac {\Pr \left({A \mid B_i}\right) \Pr \left({B_i}\right)} {\sum_j \Pr \left({A \mid B_j}\right) \Pr \left({B_j}\right)}$

where $\displaystyle \sum_j$ denotes the sum over $j$.

Proof
Follows directly from the Total Probability Theorem:
 * $\displaystyle \Pr \left({A}\right) = \sum_i \Pr \left({A \mid B_i}\right) \Pr \left({B_i}\right)$

and Bayes' Theorem:
 * $\displaystyle \Pr \left({B_i \mid A}\right) = \frac {\Pr \left({A \mid B_i}\right) \Pr \left({B_i}\right)} {\Pr \left({A}\right)}$