MathClario
← Back to High school
High school🎲Probability●●●○○· 5 min
🎯

Conditional probability: $P(A|B)$ without getting it wrong

« Probability of A **given** B ». Simple formula, but 90% of errors come from picking the wrong universe. Here's how never to slip.

The formula

P(AB)=P(AB)P(B)(with P(B)>0)P(A \mid B) = \dfrac{P(A \cap B)}{P(B)} \quad \text{(with } P(B) > 0\text{)}

In English: among the cases where B happens, what fraction also realizes A.

The mental trick: « restrict the universe »

When you see P(AB)P(A \mid B), imagine that you ignore everything that isn’t B. Then count the proportion of A in this new universe.

A concrete example

In a class of 30:

  • 12 are girls.
  • 8 students wear glasses, including 5 girls.

P(glassesgirl)=?P(\text{glasses} \mid \text{girl}) = ?

Restrict to girls: 12 students. Among them, 5 wear glasses. So P=5/12P = 5/12.

Verify with the formula

  • P(glassesgirl)=5/30P(\text{glasses} \cap \text{girl}) = 5/30.
  • P(girl)=12/30P(\text{girl}) = 12/30.
  • P(glassesgirl)=5/3012/30=5/12P(\text{glasses} \mid \text{girl}) = \dfrac{5/30}{12/30} = 5/12 ✓.

The costly mistake

P(AB)P(BA)P(A \mid B) \ne P(B \mid A) in general.

Example: P(being blackbeing a raven)P(\text{being black} \mid \text{being a raven}) ≈ 100%. But P(being a ravenbeing black)P(\text{being a raven} \mid \text{being black}) is tiny.

Bayes’ formula (bonus)

P(AB)=P(BA)P(A)P(B)P(A \mid B) = \dfrac{P(B \mid A) \cdot P(A)}{P(B)}

Key of medicine, machine learning, and decision theory.

?Your turn

You draw a card from a deck of 52. Given the card is red, what's the probability it's a heart?

#probability#conditional#given

You might also like