Skip to content
LeetQuant
Probability for Quant Interviews

Module 1 · Conditioning and Counting

Conditional Probability & Bayes' Theorem

Update beliefs correctly, avoid base-rate neglect, and recognise how the way information arrives changes the answer.

20 min

Conditioning restricts the world

The conditional probability of AA given BB is

P(A∣B)=P(A∩B)P(B),P(B)>0.P(A \mid B) = \frac{P(A \cap B)}{P(B)}, \qquad P(B) > 0 .

Read it as: among the outcomes where BB happened, what fraction also have AA? Conditioning throws away every outcome inconsistent with what you learned and renormalises what is left.

Two consequences are used constantly:

  • Multiplication rule: P(A∩B)=P(A∣B) P(B)P(A \cap B) = P(A \mid B)\,P(B).
  • Law of total probability: if B1,…,BnB_1, \dots, B_n partition the sample space, P(A)=∑iP(A∣Bi) P(Bi).P(A) = \sum_i P(A \mid B_i)\,P(B_i).

Bayes' theorem

Combining the two rules gives Bayes' theorem, which reverses the direction of conditioning:

P(H∣E)=P(E∣H) P(H)P(E)=P(E∣H) P(H)P(E∣H)P(H)+P(E∣Hc)P(Hc).P(H \mid E) = \frac{P(E \mid H)\,P(H)}{P(E)} = \frac{P(E \mid H)\,P(H)}{P(E \mid H)P(H) + P(E \mid H^c)P(H^c)} .

P(H)P(H) is the prior, P(E∣H)P(E \mid H) the likelihood, and P(H∣E)P(H \mid E) the posterior. In odds form, which is often faster in an interview:

P(H∣E)P(Hc∣E)⏟posterior odds=P(H)P(Hc)⏟prior odds×P(E∣H)P(E∣Hc)⏟likelihood ratio.\underbrace{\frac{P(H \mid E)}{P(H^c \mid E)}}_{\text{posterior odds}} = \underbrace{\frac{P(H)}{P(H^c)}}_{\text{prior odds}} \times \underbrace{\frac{P(E \mid H)}{P(E \mid H^c)}}_{\text{likelihood ratio}} .

Worked example

a biased coin in the bag

A bag holds 9 fair coins and 1 coin with heads on both sides. You draw a coin at random and flip it three times, getting three heads. What is the probability you drew the double-headed coin?

Show solution

Prior odds (double : fair) are 1:91 : 9. The likelihood ratio for three heads is 1(1/2)3=8\dfrac{1}{(1/2)^3} = 8. Posterior odds are 8:98 : 9, so

P(double∣HHH)=817≈0.47.P(\text{double} \mid HHH) = \frac{8}{17} \approx 0.47 .

Each additional head doubles the odds: after ten heads the posterior is 10241033≈0.991\frac{1024}{1033} \approx 0.991.

Knowledge check

A trader is right 60% of the time when markets are trending and 45% of the time otherwise. Markets trend 40% of the time. Given the trader was right today, which expression is P(trending∣right)P(\text{trending} \mid \text{right})?

How information arrives matters

The same words can describe different conditioning events. "At least one child is a boy" conditions on the event {BB,BG,GB}\{BB, BG, GB\} and gives P(BB)=13P(BB) = \tfrac13. "The older child is a boy" conditions on {BB,BG}\{BB, BG\} and gives 12\tfrac12.

In Monty Hall the host's choice is not random — he never reveals the prize — so his action carries information. Whenever a puzzle involves someone choosing what to reveal, model their selection rule explicitly.

Knowledge check

In the classic three-door Monty Hall game, what is the probability of winning if you always switch?

Practice problems

Finished reading?

Answer the 2 knowledge checks to complete this lesson (0 done).