Conditional probability · Mathematics Class 11–12 | StemPy Lab
Course 16.1·Lesson 1 of 3
Conditional probability
A probability can change when you learn something new. Once you know that event B has happened, the sample space shrinks to B, and the probability of A
Lesson 1 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
shrink the sample space when you are told that an event has happened;
use P(A∣B)=P(B)P(A∩B) and read it from a count, a table or a diagram;
tell P(A∣B) apart from P(B∣A).
The die behind the screen
You roll a fair die and hide it behind a screen. The chance of a six is 61. Now a friend peeks and says, "The number is even." Is the chance of a six still 61?
No. The number can only be 2, 4 or 6, and these three are equally likely. So the chance of a six is 31. The news made every odd number impossible. The sample space shrank from six outcomes to three. That is the whole idea of this lesson.
The definition
Let A and B be two events of the same experiment, with P(B)>0. The conditional probability of A given B is
P(A∣B)=P(B)P(A∩B).
Read the bar as the word "given". The event B is the new sample space. On top is the part of B where A also happens. At the bottom is all of B. For the die, B is "even", A is "six", and A∩B is "six", so P(A∣B)=3/61/6=31.
A word on notation. Many Indian books write P(A/B). A-Level, IB and AP write P(A∣B). A slash looks like a division, so this book keeps the bar. All of them mean the same thing.
When all outcomes are equally likely, the formula becomes a count:
P(A∣B)=n(B)n(A∩B).
Count the outcomes in B. Then count how many of those are also in A.
A six by six grid of the 36 outcomes of two dice, with the first die along the bottom and the second die up the side. Five cells where the sum is 8 are shaded: 2,6 and 6,2 in red letters because they contain a six, and 3,5, 4,4 and 5,3 in black. The other 31 cells are grey. The title says that given a sum of 8, two of the five remaining outcomes have a six, so the probability is 2 over 5.
A worked example with two dice
Two fair dice are thrown. Given that the sum is 8, what is the chance that at least one die shows a six?
The new sample space. A sum of 8 happens in five ways: (2,6), (3,5), (4,4), (5,3) and (6,2).
The part with a six. Two of these ways have a six: (2,6) and (6,2).
The ratio. The probability is 52.
Now check with the formula. The sum is 8 in 5 of the 36 outcomes, and the sum is 8 with a six in 2 of them. So P(A∣B)=5/362/36=52. The counting method and the formula always agree.
Reading a two-way table
A class has 60 students. Of them, 36 study music, 20 are in the football team and 12 do both.
P(football∣music)=3612=31. Look only at the 36 music students.
P(music∣football)=2012=53. Look only at the 20 footballers.
The two answers differ because the group after the bar is different. In general P(A∣B) and P(B∣A) are different numbers.
Three facts about conditional probability
Once B is given, probabilities behave as they always do:
0≤P(A∣B)≤1, and P(B∣B)=1;
P(A′∣B)=1−P(A∣B), where A′ is the complement of A (written Aˉ or Ac in some books);
P(A∪C∣B)=P(A∣B)+P(C∣B)−P(A∩C∣B).
Finding a conditional probability from other probabilities
Suppose P(A)=0.6, P(B)=0.4 and P(A∪B)=0.7. First find the overlap: P(A∩B)=0.6+0.4−0.7=0.3. Then
P(A∣B)=0.40.3=0.75,P(B∣A)=0.60.3=0.5.
The numerator is the same in both. Only the denominators differ.
Practise with new numbers
Try it in Python
The program lists all 36 outcomes of two dice and finds a conditional probability by counting. It uses exact fractions, so the answers are written as fractions and not as decimals.
Common mistakes
Dividing by the wrong probability.P(A∣B) divides by P(B), the event after the bar.
Swapping the two events. "A given B" and "B given A" are different questions with different answers.
Counting outcomes outside B. After "given B", ignore every outcome that is not in B.
Using an impossible condition.P(A∣B) is not defined when P(B)=0.
Remember these
Given B, the sample space is B, and P(A∣B)=P(B)P(A∩B) with P(B)>0.
For equally likely outcomes, P(A∣B)=n(B)n(A∩B).
P(A′∣B)=1−P(A∣B).
P(A∣B) and P(B∣A) share a numerator but have different denominators.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
A fair die is thrown. Given that the number is greater than 2, what is the probability that it is even?
For two events, P(A∩B)=0.18 and P(B)=0.45. Find P(A∣B).
Of 80 cyclists, 50 have a light, 30 have a bell and 20 have both. Find the probability that a cyclist has a light, given that the cyclist has a bell. Then find the probability of a bell, given a light.
Two fair coins are tossed. Given that at least one is a head, what is the probability that both are heads?
If P(A∣B)=0.3, find P(A′∣B).
References
OpenStax, Introductory Statistics, Chapter 3, sections on the two basic rules of probability and on contingency tables.
NCERT, Mathematics Part II for Class XII, Chapter 13, section on conditional probability.
Enroll free in Conditional Probability and Independent Events
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.