Conditional Probability & Expected Value
Conditional Probability & Expected Value
The probability of $A$ given that $B$ has occurred:
$$P(A|B) = \frac{P(A \cap B)}{P(B)}, \quad P(B) > 0$$
$$P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}$$
For a discrete random variable $X$ with values $x_i$ and probabilities $p_i$:
$$E(X) = \sum_{i} x_i \cdot p_i$$
A bag has 4 red and 6 blue marbles. Two drawn without replacement. Given the first is red, what is $P(\text{second red})$?
After removing 1 red: 3 red left out of 9 total.
$$P(\text{2nd red} | \text{1st red}) = \frac{3}{9} = \frac{1}{3}$$
1% of a population has a disease. A test has 99% sensitivity (true positive rate) and 95% specificity (true negative rate). If someone tests positive, what is the probability they have the disease?
Let $D$ = disease, $T^+$ = positive test.
$P(D) = 0.01$, $P(T^+|D) = 0.99$, $P(T^+|D^c) = 0.05$.
$$P(T^+) = 0.01(0.99) + 0.99(0.05) = 0.0099 + 0.0495 = 0.0594$$
$$P(D|T^+) = \frac{0.0099}{0.0594} \approx 0.167 \approx 16.7\%$$
A game costs \$5 to play. You win \$20 with probability $1/4$ and \$0 otherwise. Find the expected net profit.
$$E(\text{profit}) = \frac{1}{4}(20 - 5) + \frac{3}{4}(0 - 5) = \frac{15}{4} - \frac{15}{4} = 0$$
The game is fair (expected profit = 0).
Practice Problems
Show Answer Key
1. $0.12 / 0.4 = 0.3$
2. $1/4$
3. Even and $>2$: $\{4,6\}$. $>2$: $\{3,4,5,6\}$. $P = 2/4 = 1/2$
4. $1(0.3) + 2(0.5) + 3(0.2) = 0.3 + 1.0 + 0.6 = 1.9$
5. $E = \frac{1}{50}(100-2) + \frac{49}{50}(-2) = 1.96 - 1.96 = 0$
6. $0.4 \times 0.5 = 0.2 = P(A \cap B)$, yes they are independent
7. $P(B) = 0.6(0.3) + 0.4(0.1) = 0.22$. $P(A|B) = 0.18/0.22 \approx 0.818$
8. $(1+2+3+4+5+6)/6 = 3.5$
9. $P(HH)/P(\text{≥1 H}) = (1/4)/(3/4) = 1/3$
10. $0.7 \times 0.5 = 0.35$
11. $0(0.5) + 10(0.3) + 50(0.2) = 0 + 3 + 10 = 13$
12. $P(A)$ (the occurrence of $B$ gives no information about $A$)