STAT 400

Wed. February 5th, 2020


Conditional Probability cont.

Recall our definition of conditional probability from the last lecture: P(AB)=P(AB)P(B), P(B)>0P(A\mid B)=\frac{P(A\cap B)}{P(B)},\ P(B)>0.

If we know P(AB)P(A\mid B) and P(B)P(B), we get P(AB)=P(AB)P(B)P(A\cap B)=P(A\mid B)\cdot P(B).
Applying this fact twice, P(ABC)=P(ABC)P(BC)=P(ABC)P(BC)P(C)P(A\cap B\cap C)=P(A\mid B\cap C)\cdot P(B\cap C)=P(A\mid B\cap C)\cdot P(B\mid C)\cdot P(C).


Ex. Using the example from last time:

12100\frac{12}{100} customers bought diapers (P(C)P(C)). Among them, 1012\frac{10}{12} bought milk products (P(BC)P(B\mid C)).
Additionally, among customers that bought both diapers and milk products, 810\frac{8}{10} of them bought cribs (P(ABC)P(A\mid B\cap C)).

What is the probability that someone bought all three items? P(ABC)=810101212100=8100.P(A\cap B\cap C)=\frac{8}{10}\cdot \frac{10}{12}\cdot \frac{12}{100}=\frac{8}{100}.


Ex. In a store, 50% of DVDs sold are from Brand 1, 30% are from Brand 2, and 20% are from Brand 3. Among them, 25% of discs from Brand 1 will break within a year, as will 20% from Brand 2 and 10% from Brand 3.

a) What is the probability that a DVD sold from this store needs repair within a year? A1={Brand 1}, A2={Brand 2}, A3={Brand 3}B={need repair in a year}\begin{gathered} A_1=\{\text{Brand 1}\},\ A_2=\{\text{Brand 2}\},\ A_3=\{\text{Brand 3}\}\\ B=\{\text{need repair in a year}\}\\ \end{gathered}P(B)=P(BA1)+P(BA2)+P(BA3)=P(BA1)P(A1)+P(BA2)P(A2)+P(BA3)P(A3)=2510050100+2010030100+1010020100=0.125+0.06+0.02=0.205.\begin{aligned} P(B)&=P(B\cap A_1)+P(B\cap A_2)+P(B\cap A_3)\\ &=P(B\mid A_1)\cdot P(A_1)+P(B\mid A_2)\cdot P(A_2)+P(B\mid A_3)\cdot P(A_3)\\ &=\frac{25}{100}\cdot \frac{50}{100}+\frac{20}{100}\cdot \frac{30}{100}+\frac{10}{100}\cdot \frac{20}{100}\\ &=0.125+0.06+0.02\\ &=0.205. \end{aligned}

b) Given a DVD that breaks within a year, what is the probability that it was made by each brand? P(A1B)=P(A1B)P(B)=P(BA1)P(A1)P(B)=0.250.50.2050.61.\begin{aligned} P(A_1\mid B)&=\frac{P(A_1\cap B)}{P(B)}=\frac{P(B\mid A_1)\cdot P(A_1)}{P(B)}\\ &=\frac{0.25\cdot 0.5}{0.205}\\ &\approx 0.61. \end{aligned} In general, P(AjB)=P(BAj)P(Aj)P(B).\begin{gathered} P(A_j\mid B)&=\frac{P(B\mid A_j)\cdot P(A_j)}{P(B)}. \end{gathered}


Total Probability

Definition. The event {A1...Ak}\{A_1...A_k\} is exhaustive if one of AiA_i must occur, i.e. S=A1A2...AkS=A_1\cup A_2...\cup A_k.

The Law of Total Probability

Let {A1...Ak}\{A_1...A_k\} be exhaustive and exclusive (all of its members are disjoint with each other). Then, given another event BB, P(B)=P(BA1)P(A1)+P(BA2)P(A2)+...+P(BAk)P(Ak)=i=1kP(BAi)P(Ai).\begin{aligned} P(B)&=P(B\mid A_1)P(A_1)+P(B\mid A_2)P(A_2)+...+P(B\mid A_k)P(A_k)\\ &=\sum_{i=1}^k P(B\mid A_i)P(A_i). \end{aligned}

We implicitly used this rule to calculate P(B)P(B) in the previous example, because the three brands were exhaustive (you couldn’t buy any other brands of DVDs at the store) and exclusive (each DVD was made by only one brand).

Bayes’s Theorem

Using the same constraints on {A1...Ak}\{A_1...A_k\}, Bayes’s theorem states:

P(AjB)=P(AjB)P(B)=P(BAj)P(Aj)i=1kP(BAi)P(Ai).P(A_j\mid B)=\frac{P(A_j\cap B)}{P(B)}=\frac{P(B\mid A_j)P(A_j)}{\sum_{i=1}^k P(B\mid A_i)P(A_i)}.

Here P(Aj)P(A_j) is called the prior probability of event AjA_j, and P(AjB)P(A_j\mid B) is called the posterior probability of event AjA_j given that BB occurred.


Independence

Definition. Two events AA and BB are independent if P(AB)=P(A).P(A\mid B)=P(A). Otherwise, we say they are dependent.

The intuition for this is that knowing whether BB did or didn’t occur doesn’t give you any more information about the chance of AA occurring.