Total probability

If $$A_1,A_2,...,A_n$$ represent a complete event-space (mutually exclusive, and exhaustive) and P(B) represents some other event, then the law of total probably can be written as;

$$P(B)=\sum_{r=1}^n P(B|A_r) P(A_r)$$

and for smaller n, such as 2 this reduces to;

$$P(B)= P(B|A_1) P(A_1) + P(B|A_2) P(A_2)$$