Law of total probability

From CS2800 wiki

Often, we have several events that partition the sample space. For example, we may have events like "the die is even" (call this event [math]A_1 [/math]) and "the die is odd" (this event is [math]A_2 [/math]); one of the two must happen (so [math]A_1 \href{/cs2800/wiki/index.php/%E2%88%AA}{∪} A_2 = S [/math]) but they cannot both happen (so [math]A_1 \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A_2 = \href{/cs2800/wiki/index.php/%E2%88%85}{∅} [/math]).

In this case, there is an easy way to compute the probability of another event [math]B [/math] by considering it separately in the [math]A_1 [/math] case and the [math]A_2 [/math] case:

If [math]A_1 [/math], [math]A_2 [/math], [math]\dots [/math], [math]A_n [/math] partition the sample space, then for any [math]B [/math],


[math]\href{/cs2800/wiki/index.php/Pr}{Pr}(B) = \sum \href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A_i)\href{/cs2800/wiki/index.php/Pr}{Pr}(A_i) = \href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A_1)\href{/cs2800/wiki/index.php/Pr}{Pr}(A_1) + \href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A_2)\href{/cs2800/wiki/index.php/Pr}{Pr}(A_2) + \cdots + \href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A_n)\href{/cs2800/wiki/index.php/Pr}{Pr}(A_n) [/math]
Proof: Law of total probability
The proof is pretty clear from the following picture:

Law-of-total-probability.svg

Since the [math]A_i [/math] are disjoint, we have that the sets [math]B \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A_i [/math] are disjoint; and since every element of [math]S [/math] is in one of the [math]A_i [/math], we have that every element of [math]B [/math] is in one of the [math]B \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A_i [/math].

Therefore, we can apply the third Kolmogorov axiom to conclude

[math]\begin{aligned} \href{/cs2800/wiki/index.php/Pr}{Pr}(B) &= \href{/cs2800/wiki/index.php/Pr}{Pr}((B \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A_1) \href{/cs2800/wiki/index.php/%E2%88%AA}{∪} \cdots \href{/cs2800/wiki/index.php/%E2%88%AA}{∪} (B \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A_n)) && \text{as argued above} \\ &= \href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A_1) + \cdots + \href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A_n) && \href{/cs2800/wiki/index.php/Kolmogorov_axiom}{\text{Kologorov's third axiom}} \\ &= \href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A_1)\href{/cs2800/wiki/index.php/Pr}{Pr}(A_1) + \cdots + \href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A_n)\href{/cs2800/wiki/index.php/Pr}{Pr}(A_n) && \href{/cs2800/wiki/index.php/Conditional_probability}{\text{by definition of }Pr(B \mid A)} \end{aligned} [/math]

as required.