Skip to content
BIASED

Conditional probability and Bayes' formula

Block 1 of 7~3 min

When we learn something

The topic Kolmogorov's axioms gave us a probability space: a sample space Ω\Omega, a collection of events and a measure PP that obeys three axioms. Once chosen, PP stays fixed. But most reasoning under uncertainty is about updating. A spam filter sees a word, a doctor sees a test result, a language model sees the start of a sentence. Each needs probabilities that account for what it has just learned.

Roll two fair dice: all 36 outcomes are equally likely. Someone tells you the sum is 8. Five outcomes remain: (2,6)(2,6), (3,5)(3,5), (4,4)(4,4), (5,3)(5,3), (6,2)(6,2). The other 31 are ruled out, and the five survivors are still equally likely to one another. So the probability that the first die shows 3 is now 1/51/5, not 1/61/6.

Learning that BB happened does two things. It throws away every outcome outside BB, and it rescales what is left so that the total is 1 again. That is the definition of the conditional probability of AA given BB:

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.

Now swap the roles. Given that the first die shows 3, the sum is 8 only for (3,5)(3,5), so the probability of a sum of 8 is 1/61/6. Both questions share the intersection, with probability 1/361/36, but divide by different events. In general P(A∣B)≠P(B∣A)P(A \mid B) \ne P(B \mid A), and mixing the two up is the most common mistake in this topic.

For a fixed BB, the map A↦P(A∣B)A \mapsto P(A \mid B) satisfies all three axioms. It is a new probability measure that lives on BB, so every rule from the previous topic holds conditionally, for example P(Ac∣B)=1−P(A∣B)P(A^c \mid B) = 1 - P(A \mid B). The condition P(B)>0P(B) > 0 matters. For a single point of [0,1][0, 1] under the uniform distribution, the formula divides by zero. Conditioning on such events needs densities and waits for the topic Joint distributions and independence.

Answers are saved on the server and tied to this browser until you sign in.

Go deeper — optional

Code and labs do not count toward the main percentage or the certificate.

  • Bayes: coin from two urnsoptional

    Update P(urn|data) after a heads/tails sequence; match the table.

    ~20 min · easier on a computer · The matching course topic has been read.

    Self-check in the notebook — not part of mastery or the certificate.