The law of total probability is a theorem that states, in its discrete case, if $\{B_n:n=1,2,3,…\}$ is a finite or countably infinite set of mutually exclusive and collectively exhaustive vents, then for any event $A$
$$ P(A) = \sum_n{P(A, B_n)} = \sum_n{P(A \mid B_n)P(B_n)} $$
where, for any $n$, if $P(B_n) = 0$, then these terms are simply omitted from the summation since $P(A \mid B_n)$ is finite.
law of total probability는 위와 같은 $B_n$에 대한 조건부 확률에 대해서도 말합니다.
$$ \begin{align} P( {A \mid C} ) &= \frac{{P( {A,C} )}}{{P( C )}} = \frac{{\sum\limits_n {P( {A,{B_n},C} )} }}{{P( C )}} \nonumber\\ &= \frac{{\sum\limits_n P ( {A\mid {B_n},C} )P( {{B_n}\mid C} )P( C )}}{{P( C )}} \nonumber\\ &= \sum\limits_n P ( {A\mid {B_n},C} )P( {{B_n}\mid C} ) \nonumber \end{align} $$
여기서 $C$가 모든 $B_n$에 대해 독립인 사건이라면 아래와 같습니다.
$$ P(A \mid C) = \sum_n P(A \mid C,B_n) P(B_n) $$
The law of total probability extends to the case of conditioning on events generated by continuous random variables. Let $(\Omega, \mathcal{F}, P)$ be a probability space. Suppose $X$ is a random variable with distribution function $F_X$, and $A$ an event on $(\Omega, \mathcal{F}, P)$. Then the law of total probability states
$$ P(A) = \int_{-\infty}^\infty P(A |X = x) d F_X(x). $$
If $X$ admits a density function $f_X$, then the result is
$$ P(A) = \int_{-\infty}^\infty P(A |X = x) f_X(x) dx. $$