Conditional probability is the chance of something given that you already know something else happened. You can almost always find it by asking one question: out of the cases where the given thing happened, what fraction also have the thing I want?
It’s written P(A | B), read “the probability of A given B.” The bar means “given.”
Start with a two-way table
A school surveyed 120 students:
| Plays a sport | No sport | Total | |
|---|---|---|---|
| 9th grade | 30 | 40 | 70 |
| 10th grade | 20 | 30 | 50 |
| Total | 50 | 70 | 120 |
P(plays a sport | 9th grade). You’re told the student is in 9th grade, so only the 9th grade row counts. There are 70 of them, and 30 play a sport: 30/70 ≈ 0.43.
P(9th grade | plays a sport). Now you’re told the student plays a sport, so only that column counts. There are 50 of them, and 30 are in 9th grade: 30/50 = 0.6.
Same 30 students on top. Different total on the bottom. The “given” part decides which total you divide by.
The formula
The table method is the formula in disguise:
P(A | B) = P(A and B) / P(B)
For the first question, P(sport and 9th) = 30/120 and P(9th) = 70/120. Divide them, and the 120s cancel, leaving 30/70.
Example P(A and B) = 0.12 and P(B) = 0.3. Find P(A | B).
P(A | B) = 0.12/0.3 = 0.4.
Rearranged, the same formula gives the multiplication rule, which is how you find the chance of two things both happening:
P(A and B) = P(B) × P(A | B)
Drawing without replacement
When you pull things out one at a time and don’t put them back, the second draw is conditional on the first.
Example A bag has 5 red and 3 blue marbles. You draw two without looking. What’s the chance both are red?
- First draw: P(red) = 5/8.
- One red is gone, so 4 red are left out of 7: P(red | first was red) = 4/7.
- Multiply: 5/8 × 4/7 = 20/56 = 5/14 ≈ 0.36.
If you put the first marble back, the second draw would be 5/8 again, and the answer would be 25/64 ≈ 0.39.
Trees
A tree diagram lays the same idea out in stages. Each branch is labeled with a conditional probability, and you multiply along a path.
Example Two draws from the same bag. Find P(one red and one blue, in either order).
- Red then blue: 5/8 × 3/7 = 15/56.
- Blue then red: 3/8 × 5/7 = 15/56.
- Add the two paths: 30/56 = 15/28 ≈ 0.54.
Multiply along a path, add across paths. That one rule handles almost every tree problem.
Independence
Two events are independent when knowing one happened doesn’t change the chance of the other:
P(A | B) = P(A)
An equivalent test, and usually the quicker one, is P(A and B) = P(A) × P(B).
Example A card is drawn from a standard deck. Are “king” and “heart” independent?
- P(king) = 4/52 = 1/13.
- P(king | heart) = 1/13, since one of the 13 hearts is a king.
- They match, so the events are independent.
Example P(A) = 0.5, P(B) = 0.4 and P(A and B) = 0.2. Independent?
0.5 × 0.4 = 0.2, which equals P(A and B). Yes.
Back to the survey. P(sport) = 50/120 ≈ 0.417, and P(sport | 9th grade) ≈ 0.429. They’re close but not equal, so with this data, playing a sport and grade level are not independent. With real survey numbers, “close” usually means the connection is weak. A statistics course has tests for deciding how close is close enough.
Mixing up independent and mutually exclusive
Mutually exclusive events can’t both happen, like rolling a 2 and a 5 on one die. They are about as dependent as events get: if one happens, the other’s chance drops to 0.
P(A | B) is not P(B | A)
This is the mistake that causes real trouble outside math class. Most professional basketball players are tall. That doesn’t mean most tall people play professional basketball.
Medical tests are the classic case.
Example A condition affects 1% of people. A test catches it 95% of the time, but also gives a false positive to 10% of healthy people. You test positive. What’s the chance you have it?
- Picture 10,000 people. 100 have the condition and 9,900 don’t.
- Of the 100, the test catches 95.
- Of the 9,900, it wrongly flags 10%, which is 990.
- Total positives: 95 + 990 = 1,085.
- P(have it | positive) = 95/1,085 ≈ 0.088, about 9%.
P(positive | have it) is 95%, but P(have it | positive) is only about 9%, because healthy people outnumber sick people so heavily. Picturing a round number of people, as in step 1, is the easiest way to get these right. The probability basics guide covers the counting underneath.
Practice set
Using the survey table, find P(no sport | 10th grade).
Show answer
30/50 = 0.6.
Using the survey table, find P(10th grade | no sport).
Show answer
30/70 ≈ 0.43.
Two dice are rolled. The first shows 3. What’s the chance the sum is 8?
Show answer
The second die must be 5, so 1/6.
Two cards are drawn without replacement. What’s the chance both are aces?
Show answer
4/52 × 3/51 = 1/221.
P(A) = 0.6, P(B) = 0.5 and P(A and B) = 0.25. Are A and B independent?
Show answer
No. 0.6 × 0.5 = 0.3, which isn’t 0.25.
A coin is flipped twice. Given that at least one flip is heads, what’s the chance both are heads?
Show answer
The cases with at least one head are HH, HT, TH. Only one is HH, so 1/3.
40% of a class walks to school. Of those, 25% bring lunch. What fraction of the class walks and brings lunch?
Show answer
0.4 × 0.25 = 0.1, so 10%.