Let A_{1}, …, A_{n} be a partition of a sample space where P (A_{i}) > 0 for all i. Let B be an event with P (B) > 0. Then

P (A_{i} | B) = \frac{P (B | A_{i})P (A_{i})}{P (B | A_{1})P (A_{1}) + ⋯ + P (B | A_{n})P (A_{n})}