> [!NOTE] Theorem (Bayes)
> Let $(\Omega,\mathcal{F}, \mathbb{P})$ be a [[Probability Space|probability space]]. Let $\{ B_{n} \}_{n=1}^{N}$ be a [[Countable Set|countable]] [[Partition of a Set|partition]] of the [[Sample Space|sample space]] $\Omega$ such that for all $n=1,2,\dots,N,$ $\mathbb{P}(B_{n})>0.$ Let $A\in \mathcal{F}$ such that $\mathbb{P}(A)>0.$ For all $n=1,\dots,N,$ $\mathbb{P}(B_{n}\mid A)= \frac{\mathbb{P}(A \mid B_{n}) \mathbb{P}(B_{n})}{\sum_{n=1}^{N} \mathbb{P}(A\mid B_{n})\mathbb{P}(B_{n})}$where $\mathbb{P}(B\mid A)$ denotes the [[Conditional Probability|conditional probability]] of $B$ given $A.$
###### Proof
By definition of conditional probability and [[Law of Total Probability]]: $\mathbb{P}(B_{n} \mid A)= \frac{\mathbb{P}(B_{n}\cap A)}{\mathbb{P}(A)} = \frac{\mathbb{P}(A\mid B_{n})\mathbb{P}(B_{n})}{\mathbb{P}(A)}= \frac{\mathbb{P}(A \mid B_{n}) \mathbb{P}(B_{n})}{\sum_{n=1}^{N} \mathbb{P}(A\mid B_{n})\mathbb{P}(B_{n})}.$