Law of total probability

In statistics, the law of total probability is that "the prior probability of A is equal to the prior expected value of the posterior probability of A." That is, for any random variable $$N$$,


 * $$\Pr(A)=E(\Pr(A\mid N))$$

where $$\Pr(A\mid N)$$ is the conditional probability of A given N.

Law of alternatives
The term law of total probability is sometimes taken to mean the law of alternatives, which is a special case of the law of total probability applying to discrete random variables. It is the proposition that if { Bn : n = 1, 2, 3, ... } is a finite or countably infinite partition of a probability space and each set Bn is measurable, then for any event A we have


 * $$\Pr(A)=\sum_{n} \Pr(A\cap B_n)\,$$

or, alternatively,


 * $$\Pr(A)=\sum_{n} \Pr(A\mid B_n)\Pr(B_n).\,$$