1. **State the problem:**
We have a spam detection system with the following probabilities:
- Probability an email is spam: $P(S) = 0.002$
- Probability an email is legitimate: $P(L) = 1 - P(S) = 0.998$
- The system always catches spam emails, so $P(\text{flagged}|S) = 1$
- The system falsely flags legitimate emails with probability $P(\text{flagged}|L) = 0.004$
We want to find:
(i) $P(S|\text{flagged})$ the probability an email is truly spam given it is flagged.
(ii) $P(L|\text{not flagged})$ the probability an email is legitimate given it is not flagged.
2. **Recall Bayes' theorem:**
$$
P(A|B) = \frac{P(B|A)P(A)}{P(B)}
$$
This allows us to find conditional probabilities.
3. **Calculate $P(\text{flagged})$:**
$$
P(\text{flagged}) = P(\text{flagged}|S)P(S) + P(\text{flagged}|L)P(L) = 1 \times 0.002 + 0.004 \times 0.998 = 0.002 + 0.003992 = 0.005992
$$
4. **Calculate $P(S|\text{flagged})$ using Bayes' theorem:**
$$
P(S|\text{flagged}) = \frac{P(\text{flagged}|S)P(S)}{P(\text{flagged})} = \frac{1 \times 0.002}{0.005992} = \frac{0.002}{0.005992}
$$
Simplify by dividing numerator and denominator:
$$
P(S|\text{flagged}) = \frac{\cancel{0.002}}{\cancel{0.005992}} = 0.3338 \approx 0.334
$$
5. **Calculate $P(\text{not flagged})$:**
$$
P(\text{not flagged}) = 1 - P(\text{flagged}) = 1 - 0.005992 = 0.994008
$$
6. **Calculate $P(L|\text{not flagged})$ using Bayes' theorem:**
$$
P(L|\text{not flagged}) = \frac{P(\text{not flagged}|L)P(L)}{P(\text{not flagged})}
$$
Where:
$$
P(\text{not flagged}|L) = 1 - P(\text{flagged}|L) = 1 - 0.004 = 0.996
$$
So:
$$
P(L|\text{not flagged}) = \frac{0.996 \times 0.998}{0.994008} = \frac{0.994008}{0.994008} = 1
$$
7. **Interpretation:**
- If an email is flagged, there is about a 33.4% chance it is truly spam.
- If an email is not flagged, it is almost certainly legitimate (probability approximately 1).
**Final answers:**
(i) $P(S|\text{flagged}) \approx 0.334$
(ii) $P(L|\text{not flagged}) \approx 1$
Conditional Probability Spam F6Ffef
Step-by-step solutions with LaTeX - clean, fast, and student-friendly.