Conditional Probability
More examples:
- A card is drawn at random from a standard $52$-card deck. Let event A be "the card is a queen" and the event B be "the card is a face card" (there are $12$ face cards: King, Queen, and Jack $\times 4$, and $4$ queens.)
Solution: $P(\text{queen} \mid \text{face}) \;$$= \frac{P(\text{queen} \cap \text{face})}{P(\text{face})} \;$$= \frac{4/52}{12/52} \;$$= \frac{4}{12} \;$$= \frac{1}{3}$.
- In a certain region, $10\%$ of users run outdated software. Among them, $40\%$ experience a crash. Find the probability a user experiences a crash given they run outdated software.
Solution: $P(\text{crash} \mid \text{outdated}) \;$$= \frac{P(\text{crash} \cap \text{outdated})}{P(\text{outdated})} \;$$= \frac{0.4 \times 0.1}{0.1} \;$$= \frac{4/100}{1/10} \;$$= \frac{4}{10}$.
- In a dataset, $30\%$ of emails are spam. Among spam emails, $80\%$ contain the word "free". Find the probability that an email contains "free" given that it is spam.
Solution: $P(\text{contains "free"} \mid \text{spam}) \;$$= \frac{P(\text{contains "free"} \cap \text{spam})}{P(\text{spam})} \;$$= \frac{0.8 \times 0.3}{0.3} \;$$= \frac{0.24}{0.3} \;$$= 0.8$.