# Understanding Bayes' Theorem

I worked through some examples of Bayes' Theorem and now was reading the proof.

Bayes' Theorem states the following:

Suppose that the sample space S is partitioned into disjoint subsets $$B_1, B_2,...,B_n$$. That is, $$S = B_1 \cup B_2 \cup \cdots \cup B_n$$, $$\Pr(B_i) > 0$$ $$\forall i=1,2,...,n$$ and $$B_i \cap B_j = \varnothing$$ $$\forall i\ne j$$. Then for an event A,

$$\Pr(B_j \mid A)=\cfrac{B_j \cap A}{\Pr(A)}=\cfrac{\Pr(B_j) \cdot \Pr(A \mid B_j)}{\sum\limits_{i=1}^{n}\Pr(B_i) \cdot \Pr(A \mid B_i)}\tag{1}$$

The numerator is just from definition of conditional probability in multiplicative form.

For the denominator, I read the following:

$$A= A \cap S= A \cap (B_1 \cup B_2 \cup \cdots \cup B_n)=(A \cap B_1) \cup (A\cap B_2) \cup \cdots \cup(A \cap B_n)\tag{2}$$

Now this is what I don't understand:

The sets $$A \cup B_i$$ are disjoint because the sets $$B_1, B_2, ..., B_n$$ form a partition.$$\tag{\clubsuit}$$

I don't see how that is inferred or why that is the case. What does B forming a partition have anything to do with it being disjoint with A. Can someone please explain this conceptually or via an example?

I worked one example where you had 3 coolers and in each cooler you had either root beer or soda. So the first node would be which cooler you would choose and the second nodes would be whether you choose root beer or soda. But I don't see why these would be disjoint. If anything, I would say they weren't disjoint because each cooler contains both types of drinks.

• The sets $A \cap B_i$ are disjoint, because the sets $B_i$ are. However, the sets $A \cup B_i$ are not disjoint, since they all contain $A$. I think the statement concerns the sets $A \cap B_i$. May 24, 2013 at 18:05
• @Tharsis: Your comment cannot be correct. A and $B_i$ MUST be mutually exclusive because this is what will allow you to implement the 3rd Axiom of Probability and convert unions into a sum of probabilities when calculating the probability of A. May 24, 2013 at 18:11
• Notice the difference between $\cup$ and $\cap$. This statement is true only for the sets $A \cap B_i$. May 24, 2013 at 18:18
• @user1527227 I think Tharsis is pointing out that, e.g., $(A \cap B_1)$ is disjoint from $(A \cap B_2)$, but $A \cup B_1$ is not disjoint from $A \cup B_2$. Pay attention to the $\cap, \cup$: May 24, 2013 at 18:19
• @amWhy: OH THAT WOULD MAKE A LOT MORE SENSE. Thanks for clearing that up. May 24, 2013 at 18:20

As Tharsis pointed out, and was clarified in the comments, it is all of sets of the given by $\;(A \cap B_i),\; 1 \leq i \leq n\;$ that are pairwise disjoint.

$$\;(A \cap B_i)\cap (A \cap B_j) = \varnothing,\;\;\;\forall i, j,\;\;\text{s.t.}\;\;1 \leq i, j\leq n\;\;\text{and}\;\;i\neq j$$

e.g., $(A\cap B_1)$ is disjoint from $(A\cap B_2)$, but $(A\cup B_1)$ is certainly not disjoint from $(A\cup B_2)$, etc.

Pay attention to the distinction between $∩,∪.$

• always sound advice! =1 May 25, 2013 at 0:50

It is the sets $A\cap B_i$ that are pairwise disjoint, and that is precisely what you need to calculate the probability in the denominator.

You can easily show this using set theoretic arguement.

$A \cap S= A \cap (B_1 \cup B_2 \cup \cdots \cup B_n)=(A \cap B_1) \cup (A\cap B_2) \cup \cdots \cup(A \cap B_n)$

Here is a write that describes Bayes theorem in detail along with a bunch of examples on how to use it (different write ups)