Conditional Probability

Look out of the window. What's the chance it's raining right now? Maybe you'd guess low. But now suppose I tell you one extra fact: the sky is grey and heavy. Suddenly your answer jumps up. Nothing about the weather changed — but what you know did, and that shifted the probability.

That is the whole idea of conditional probability: the chance of one thing once you already know that another thing has happened. "The chance of rain, given a grey sky." "The chance of passing, given you revised." The little word given is doing all the work — it hands you a clue, and a good clue changes the odds.

Writing it down

Sometimes you already know that one thing has happened, and you want the chance of another. The conditional probability of B given that A has happened is written P(B \mid A).

Knowing that A happened shrinks the sample space to just the A outcomes — the world of "everything that could happen" collapses down to "everything that could happen now that we're inside A." So out of those, you ask how many are also B:

P(B \mid A) = \frac{P(A \text{ and } B)}{P(A)}

On a tree diagram, the second-stage branches are exactly these conditional probabilities — each one assumes the first-stage outcome has already happened.

See it: given A, look only inside A

Here A has 6 + 4 = 10 people in it. Once you are told the person is in A, ignore everyone else — the chance they are also in B is the 4 overlap out of those 10.

Worked example 1: "without replacement" is secretly conditional

A bag holds 3 red and 2 blue counters. You take one out, keep it, then take a second — without replacement. The first pick changes what's left in the bag, so it changes the odds of the second pick. That "changed" second-pick chance is a conditional probability.

Say the first counter was red. Now the bag holds only 2 red and 2 blue — 4 counters. So

P(\text{2nd red} \mid \text{1st red}) = \frac{2}{4} = 0.5.

Notice it is not \tfrac{3}{5} any more. The clue "the first was red" reshaped the bag. To get the chance of red then red, multiply along the path: \tfrac{3}{5} \times \tfrac{2}{4} = \tfrac{6}{20} = 0.3.

Worked example 2: reading a two-way table

A survey asked 50 students whether they walk to school and whether they own a bike:

Owns a bikeNo bikeTotal
Walks to school12820
Does not walk181230
Total302050

Question: given that a student walks to school, what's the chance they own a bike? "Given they walk" throws away the 30 non-walkers — we live inside the walk row only, which has 20 students. Of those 20, twelve own a bike:

P(\text{bike} \mid \text{walks}) = \frac{12}{20} = 0.6.

Compare that with the plain chance of owning a bike, \tfrac{30}{50} = 0.6 — here they happen to match, which means these two facts are (near enough) independent. When the conditional and the plain probability differ, the clue is telling you something.

Worked example 3: straight from the formula

Suppose P(A \text{ and } B) = 0.24 and P(A) = 0.6. Then

P(B \mid A) = \frac{P(A \text{ and } B)}{P(A)} = \frac{0.24}{0.6} = 0.4.

Turned around, this is also how you build the "and" probability from a tree: P(A \text{ and } B) = P(A) \times P(B \mid A). Multiply the first branch by the (conditional) second branch — exactly what you did with the counters.

Swapping the two around is one of the most common — and most damaging — mistakes in all of probability. They are different questions with wildly different answers.

Think about measles and a rash. The probability of a rash given measles is very high — measles almost always brings a rash. But the probability of measles given a rash is very low — heaps of things cause rashes (heat, allergies, other bugs), and measles is rare. Same two events, condition flipped, answers at opposite ends.

The trap is called the base-rate fallacy: people quietly ignore how rare the thing itself is. Untangling P(A \mid B) from P(B \mid A) properly is exactly the job of Bayes' theorem — a tool you'll meet soon.

Get conditional probability backwards in a courtroom and it has a name: the prosecutor's fallacy. A lawyer says "the chance of this DNA matching if the defendant were innocent is one in a million — so they're surely guilty." But that quietly swaps two very different things: the chance of a match given innocence is NOT the chance of innocence given a match. In a big city, a one-in-a-million match might still point at several innocent people. Real convictions have been overturned once mathematicians pointed this out.

The flip side: this same idea, done right, is one of the most powerful tools in modern science and technology. Every time a spam filter decides an email is junk, a medical test is interpreted, or an AI model updates a guess from new evidence, it is computing a conditional probability. The humble P(B \mid A) is the seed of Bayes' theorem — and Bayes' theorem quietly runs a huge slice of the modern world.

See it explained