Educerie · IB Diploma · Mathematics: analysis and approaches
IB Mathematics AA 4.11 · SL and HL
Conditional probability and independence
Once you know that one thing has happened, how should the probability of another change, and how do you show that it does not change at all?
What you will learn
Understand that a conditional probability treats the known event as the new sample space
Know the definition P(A|B) = P(A and B) / P(B) and its rearranged form P(A and B) = P(B)P(A|B)
Understand that events are independent when P(A|B) = P(A) = P(A|B'), which is the same as P(A and B) = P(A)P(B)
Know that independent and mutually exclusive mean different things
You must be able to
Calculate a conditional probability from a Venn diagram, a table, a tree or a normal or binomial variable
Determine whether two events are independent, showing both values and a conclusion
Calculate a reversed conditional probability from a tree, such as P(rain | late)
Solve for an unknown probability given that two events are independent
Draw a tree for picking without replacement and use it for given that questions
Explain why mutually exclusive events with non-zero probabilities cannot be independent
In the exam. across recent papers mostly Paper 2, less often Paper 1, as short parts of a longer probability question, and nearly always as "Find". The most common Paper 2 setting is a "given that" question about a normal or binomial variable; the others are a conditional probability from a Venn diagram, a table or a tree, a tree read backwards, sampling without replacement, finding an unknown from independence, and "determine whether A and B are independent". Paper 1 wants exact values; Paper 2 accepts 3 significant figures. At HL the same ideas are the engine of Bayes' theorem in 4.13.
1Conditioning shrinks the sample space to B
Take a gym, with its members as the sample space. Let A be "a member uses the pool" and B "a member attends a group class". Records show P(A)=0.45, P(B)=0.30 and P(A∩B)=0.12.
Figure 1(a) fills in the Venn diagram:
0.12 in the overlap.
0.45−0.12=0.33 in A only.
0.30−0.12=0.18 in B only.
1−(0.33+0.12+0.18)=0.37 outside both.
Figure 1 · Given B, the sample space shrinks to B
Now you are told the member attends a class. Everyone outside B is irrelevant. Figure 1(b) keeps only circle B, of probability 0.30. The part also in A is 0.12. The answer is the fraction of B that lies in A:
P(A∣B)=P(B)P(A∩B), for P(B)>0. From the formula booklet.
P(A∣B)=P(B)P(A∩B)=0.300.12=0.4
So 40% of class-goers use the pool, against 45% of members overall.
The order matters.P(B∣A) asks a different question: of the pool users, what fraction attend a class?
P(B∣A)=P(A)P(A∩B)=0.450.12=154≈0.267
Same overlap on top, a different event underneath, a different answer. You always divide by the event after the bar, because that is the one you know has happened.
Mixing up P(A∣B) and P(B∣A) is the costliest slip in probability. 4.13 (HL) is built on the gap.
Two limiting cases.
If A and B cannot both happen, then P(A∩B)=0 and P(A∣B)=0. Knowing B rules A out.
If B sits entirely inside A, then A∩B=B and P(A∣B)=P(B)P(B)=1. Knowing B guarantees A.
The complement
Given B, either A happens or it does not, so the conditional probabilities add to 1: P(A′∣B)=1−P(A∣B). In the gym, P(A′∣B)=1−0.4=0.6.
The condition stays fixed. P(A∣B)+P(A∣B′) is not 1 in general.
From counts, no formula needed. With a table of counts, look only at the row or column you were told about and read the fraction inside it. The guide allows this route.
Example: a library surveys 200 members on two habits, reading fiction (F) and borrowing audiobooks (U).
Audiobooks
No audiobooks
Total
Fiction
25
55
80
Not fiction
50
70
120
Total
75
125
200
"Given that a member borrows audiobooks, find the probability that they read fiction." Only the audiobook column counts: 75 members, 25 of whom read fiction.
P(F∣U)=7525=31. The formula agrees: 75/20025/200=7525. The other way round: P(U∣F)=8025=165.
From a sample space diagram. Two fair dice are rolled. Given that at least one die shows a 6, find the probability that the total is 8. Each cell holds the total, and the 36 cells are equally likely (4.5).
Die 1 / die 2
1
2
3
4
5
6
1
2
3
4
5
6
7
2
3
4
5
6
7
8
3
4
5
6
7
8
9
4
5
6
7
8
9
10
5
6
7
8
9
10
11
6
7
8
9
10
11
12
The condition keeps only the cells in bold, the last row and the last column. That is 6+6−1=11 cells, because the cell for 6 and 6 lies in both.
Of those 11, two have a total of 8: die 1 showing 2 with die 2 showing 6, and the reverse. So P(total 8∣at least one 6)=112.
Turn it round and the restricted space changes. Five cells have a total of 8 (2 and 6, 3 and 5, 4 and 4, 5 and 3, 6 and 2). Two of them contain a 6. So P(at least one 6∣total 8)=52.
Divide by the cells left after the condition, never by 36. 362 is the overlap, the probability of both events, not either conditional.
A Venn diagram with an unknown. Sometimes the overlap is the thing you must find first.
Example: in a village, 70% of households have broadband, 45% have a streaming subscription and 20% have neither. Let B be broadband and S streaming.
The households with at least one of the two are 100−20=80%. By the addition rule, 70+45−P(B∩S)=80, so P(B∩S)=35%. Now any conditional probability is a quick division:
P(S∣B)=0.700.35=0.5of the broadband homes, half also streamP(B∣S)=0.450.35=97
2The multiplication form, and why trees work
Multiply the definition by P(B) to get the guide's alternate form:
P(A∩B)=P(B)P(A∣B)
For A and B both to happen, B must happen, then A given B. That is what you do when you multiply along the branches of a tree. It is why the second branches on any tree carry conditional probabilities.
Example: a commuter's morning bus is late more often in the rain. Let R be "it rains" and L "the bus is late". On a given morning P(R)=0.3, P(L∣R)=0.4 and P(L∣R′)=0.1.
Figure 2 draws the tree. The first branches are P(R) and P(R′). Each second branch is a probability given the branch it grows from.
Figure 2 · The second branches of a tree are conditional
P(R∩L)=P(R)×P(L∣R)=0.3×0.4=0.12P(R′∩L)=P(R′)×P(L∣R′)=0.7×0.1=0.07P(L)=0.12+0.07=0.19two separate paths end in L, so add them
As a formula, P(L)=P(L∣R)P(R)+P(L∣R′)P(R′). It holds whenever the first split covers every outcome with no overlap.
3Reading a tree backwards
Now the question Paper 2 likes best: given that the bus was late, find the probability that it rained.
The tree has rain first, so P(R∣L) is on no branch. Return to the definition.
You know L happened, so L is the new sample space, of probability 0.19. The part where it also rained is 0.12.
P(R∣L)=P(L)P(R∩L)=0.190.12=1912≈0.632on top: the rain path that ends in Lunderneath: every path that ends in L
Knowing the bus was late raises the chance of rain from 0.3 to 0.632, because rain makes lateness four times as likely.
The recipe never changes: the path you want on top, all paths consistent with what you know underneath. At HL, written as a formula, it is Bayes' theorem (4.13).
Example 1 · a second tree, reversed. A garden centre buys 60% of its seeds from supplier S and 40% from supplier T. Seeds from S germinate with probability 0.9 and seeds from T with probability 0.75. A packet fails to germinate. Find the probability that it came from T.
P(S∩fail)=0.6×0.1=0.06P(T∩fail)=0.4×0.25=0.10P(T∣fail)=0.06+0.100.10=0.160.10=85the one path over both failing paths
The failure probabilities are 1−0.9 and 1−0.75: the complement rule on a branch.
4Picking without replacement
When items are taken and not put back, what is left depends on what came out. The draws are dependent, and the second branches of the tree are genuine conditional probabilities.
Example: a box holds 11 pens, 4 of them blue. Two are taken in turn and kept. Let B1 and B2 be "the first pen is blue" and "the second pen is blue".
P(B1∩B2)=114×103=11012one blue gone, 3 blue left among 10P(B1′∩B2)=117×104=11028a non-blue gone, still 4 blue among 10P(B2)=11012+11028=11040=114P(B1∣B2)=40/11012/110=103
The draws are dependent. P(B2∣B1)=103, but P(B2)=114, and the two differ.
Had each pen been put back before the next was chosen, every second branch would have been 114 and the draws would be independent. So: with replacement, independent; without replacement, dependent.
5Independent events: knowing B tells you nothing about A
Two events are independent when the occurrence of one does not change the probability of the other:
A and B are independent if P(A∣B)=P(A)=P(A∣B′).
Whether B happens, does not happen, or is unknown, the probability of A is one number. B carries no information about A.
Figure 3 makes this visible. Each square has area 1, split into a strip for B and a strip for B′, with widths P(B) and P(B′).
Inside each strip the shaded band is A. Its height is the probability of A within that strip, P(A∣B) or P(A∣B′).
Panel (a): level band.A takes 30% of B and 30% of B′. Knowing the strip tells you nothing.
Panel (b): stepped band.A takes 60% of B but only 20% of B′. Being in B triples the chance of A.
Figure 3 · Independent means the A band is level across B and B′
From the definition to the multiplication rule. Put P(A∣B)=P(A) into the alternate form:
P(A∩B)=P(B)P(A∣B)P(A∩B)=P(B)P(A)replace P(A∣B) by P(A)
For independent events, P(A∩B)=P(A)P(B). From the formula booklet.
In panel (a) of Figure 3 the A-and-B rectangle is 0.4 wide and 0.3 high. Its area is 0.4×0.3=0.12=P(A)P(B).
In panel (b) it is 0.4×0.6=0.24. But P(A)=0.24+0.6×0.2=0.36 and P(A)P(B)=0.36×0.4=0.144. They differ, so those events are not independent.
The other statements come free. If P(A∩B)=P(A)P(B), the part of A outside B is P(A∩B′)=P(A)−P(A)P(B)=P(A)P(B′). Divide by P(B′):
P(A∣B′)=P(B′)P(A∩B′)=P(B′)P(A)P(B′)=P(A)
So P(A∣B)=P(A), P(A∣B′)=P(A) and P(A∩B)=P(A)P(B) stand or fall together.
The same argument shows that if A and B are independent, so are A and B′, A′ and B, and A′ and B′. Independence is symmetric: P(A∣B)=P(A) also gives P(B∣A)=P(B).
More than two events
The product rule extends to events that are independent of one another: P(A∩B∩C)=P(A)P(B)P(C).
This is the idea behind the binomial distribution in 4.8.
Example 2 · independence given, several events. Two sensors guard a door and work independently. Sensor 1 detects an intruder with probability 0.7, sensor 2 with probability 0.85. Find the probability that exactly one detects, and that at least one does.
P(exactly one)=0.7×0.15+0.3×0.85=0.105+0.255=0.36two disjoint cases, each a productP(at least one)=1−0.3×0.15=1−0.045=0.955complement: neither detects
6Testing for independence
To test, compute two quantities that must be equal if the events are independent, and compare them. Any of these three comparisons is a valid test. Choose the one the data make easiest.
Compare
Independent if
Best when you have
P(A∩B) with P(A)×P(B)
they are equal
the three probabilities, or a Venn diagram
P(A∣B) with P(A)
they are equal
a conditional probability already worked out
P(A∣B) with P(A∣B′)
they are equal
a tree, or a two-way table split by B
Example 3 · from probabilities. For the gym, P(A)=0.45, P(B)=0.30 and P(A∩B)=0.12.
P(A)×P(B)=0.45×0.30=0.135P(A∩B)=0.12=0.135so A and B are not independent
Equally, P(A∣B)=0.4=0.45=P(A). Show both numbers, the = sign and the conclusion in words.
Example 4 · from a two-way table, in a medical study. Researchers use this test to spot risk factors. A disease more likely among people with a habit than without it is not independent of the habit.
The data below are invented. A clinic records, for 500 adults, whether each smokes (S) and whether each has a persistent cough (C).
Cough
No cough
Total
Smoker
48
72
120
Non-smoker
57
323
380
Total
105
395
500
P(C∣S)=12048=0.40P(C∣S′)=38057=0.15P(C)=500105=0.21P(C∣S)=P(C∣S′),so C and S are not independent
Figure 4 puts the three figures side by side. A smoker here is 0.150.40≈2.7 times as likely to have a cough as a non-smoker.
In context, the question wants a sentence like this:
"Smokers in this sample are more likely to have a persistent cough, so the events are not independent. Smoking appears to be a risk factor."
Figure 4 · Testing independence from a two-way table
Two cautions for the comment:
Compare exactly. Unless a formal test is requested, treat the counts given as the whole population. 0.40=0.15 means not independent.
Not a cause. "Not independent" does not prove that one event causes the other. Say "associated with" or "more likely among", never "causes".
Example 5 · using independence to find an unknown (Paper 1). Events A and B are independent, with P(A)=x, P(B)=0.3 and P(A∪B)=0.72. Find x.
P(A∪B)=P(A)+P(B)−P(A∩B)0.72=x+0.3−0.3xindependent, so P(A∩B)=0.3x0.42=0.7xx=0.6
Check: P(A∩B)=0.18 and 0.6+0.3−0.18=0.72.
The method mark is for replacing P(A∩B) with the product first. If both probabilities are unknown but linked, the substitution gives a quadratic. Reject any root outside 0 to 1 (Q6).
7Independent is not the same as mutually exclusive
These two ideas mean nearly opposite things, and exams use that.
Mutually exclusive:A and B cannot happen together. P(A∩B)=0. On a Venn diagram the circles do not overlap.
Independent:A and B can happen together, and the chance of one is untouched by the other. P(A∩B)=P(A)P(B). On a Venn diagram the circles overlap by exactly that amount.
Figure 5 draws both with the same P(A)=0.3 and P(B)=0.5.
Figure 5 · Mutually exclusive is not independent
In panel (a), learning that B happened tells you that A did not: P(A∣B)=0, the strongest possible influence.
Formally, if P(A)>0 and P(B)>0 then P(A)P(B)>0, but P(A∩B)=0. So the multiplication rule fails. Mutually exclusive events with non-zero probabilities are never independent.
In panel (b) the overlap is 0.3×0.5=0.15, and P(A∣B)=0.50.15=0.3, which is P(A) again.
Events can be both mutually exclusive and independent only if one of them has probability 0. Then P(A∩B) and P(A)P(B) are both 0.
8Conditional probability with a distribution
The definition does not care where the probabilities come from. A question may give a normal or binomial variable, or a table, and say "given that". The events are then statements about the variable, such as T>35.
Put those statements into P(A∣B)=P(B)P(A∩B). Find the overlap, and divide. Write P(T<50∣T>35) with the real events, not just P(A∣B), so the conditional structure shows.
The overlap is usually an interval: "both T>35 and T<50" is 35<T<50. If one condition contains the other, the overlap is the narrower one. T>64 and T>58 together are T>64.
Example 6 · normal (Paper 2). The life L hours of a battery is modelled by L∼N(52,72). Given that a battery has already lasted more than 45 hours, find the probability that it fails before 60 hours.
P(L<60∣L>45)=P(L>45)P(45<L<60)=0.84134…0.71479…=0.850 (3 s.f.)both probabilities from the calculator’s normal cdf
The numerator is notP(L<60): that would include lifetimes below 45, which the condition has discarded. Keep the unrounded calculator values for the division.
Example 7 · binomial (Paper 2). Each of 30 bulbs in a batch is faulty with probability 0.06, independently. Let X be the number of faulty bulbs, so X∼B(30,0.06). Given that at least one is faulty, find the probability that at most three are.