# Law of Total Probability

Let $S=k=1∑n B_{k}$ , where $B_{i}∩B_{j}=∅$ if $i=j$, then for any event $A$, $P(A)=R=1∑n P(A∣B_{R})⋅P(B_{R})$.

Example

You have one fair coin and a biased coin that lands on heads with a probability of $43 $ . If you pick a random coin and toss it three times, find the probability that all three tosses are heads.

Draw the probability tree.

$P(A)=P(A∣B_{1})⋅P(B_{1})+P(A∣B_{2})⋅P(B_{2})$ $P(A)=(21 )_{3}⋅0.5+(43 )_{3}⋅0.5$

### LOTP with Conditioning

This is an extension to LOTP introduced in CS287.

$P(x)=∑_{y}P(x,y)$ $P(x∣z)=∑_{y}P(y∣z)P(x∣y,z)$