Skip to content

Unit 2: Probability, Random Variables, and Probability Distributions

Conditional Probability

Compute a probability given that another event happened, from a two-way table, a tree diagram, or the formula, and use the general multiplication rule.

Topic 2.6 · 7 min read

A streaming service tracked 2,000 new subscribers for a year. Overall, 24% canceled. But among subscribers on the cheaper ad-supported plan, 30% canceled, and among premium subscribers only 15% did. Each of those percentages is a probability of canceling, computed after narrowing attention to one group, and the narrowing is what conditional probability is.

Probability given that something happened

The conditional probability of AA given BB, written P(A∣B)P(A \mid B), is the probability that AA occurs when you already know that BB has occurred. Read the bar as "given."

Knowing BB happened rules out every outcome outside BB. The outcomes in BB become the whole sample space, and AA can now happen only through outcomes that are in both AA and BB. So P(A∣B)P(A \mid B) is the share of BB's probability that also lies in AA:

Here are the streaming service's data:

CanceledStayedTotal
Ad-supported3608401,200
Premium120680800
Total4801,5202,000

For a subscriber chosen at random, P(canceled∩ad)=3602000=0.18P(\text{canceled} \cap \text{ad}) = \frac{360}{2000} = 0.18 and P(ad)=12002000=0.6P(\text{ad}) = \frac{1200}{2000} = 0.6, so

P(canceled∣ad)=0.180.6=0.30.P(\text{canceled} \mid \text{ad}) = \frac{0.18}{0.6} = 0.30.

The shortcut gives the same thing: given ad-supported, you're choosing from the 1,200 subscribers in that row, and 360 of them canceled, so 3601200=0.30\frac{360}{1200} = 0.30. The grand total 2,000 cancels out of the formula, which is why the table method works.

A conditional probability is still a probability: it's between 0 and 1, and the complement rule from topic 2.4 holds inside the condition. P(stayed∣ad)=1−0.30=0.70P(\text{stayed} \mid \text{ad}) = 1 - 0.30 = 0.70.

The order of the condition matters

P(A∣B)P(A \mid B) and P(B∣A)P(B \mid A) have the same numerator, P(A∩B)P(A \cap B), and different denominators, so they are usually different numbers. From the table:

  • P(canceled∣ad)=3601200=0.30P(\text{canceled} \mid \text{ad}) = \frac{360}{1200} = 0.30: of the ad-supported subscribers, 30% canceled.
  • P(ad∣canceled)=360480=0.75P(\text{ad} \mid \text{canceled}) = \frac{360}{480} = 0.75: of the subscribers who canceled, 75% were on the ad-supported plan.

Both are true, and they answer different questions. The first is what the company would use to predict whether a new ad-plan customer will leave. The second describes who is leaving. To tell which one a question wants, find the group it says you know about ("of those who...", "given that...", "if a subscriber is...") and put that event after the bar. That event's total goes in the denominator.

The general multiplication rule

Write the definition with AA as the condition, P(B∣A)=P(A∩B)P(A)P(B \mid A) = \frac{P(A \cap B)}{P(A)}, and multiply both sides by P(A)P(A). The result finds "both" from a chain of steps:

This is how you handle a process that happens in stages, where the first stage changes the odds of the second. A drawer holds 10 batteries, and 3 of them are dead. You grab two without putting the first back. The chance the first is dead is 310\frac{3}{10}. Given that it was, 9 batteries are left and 2 are dead, so the chance the second is also dead is 29\frac{2}{9}. Then

P(both dead)=310⋅29=690=115≈0.0667.P(\text{both dead}) = \frac{3}{10} \cdot \frac{2}{9} = \frac{6}{90} = \frac{1}{15} \approx 0.0667.

Using 310\frac{3}{10} for the second draw too would give 0.090.09, which is wrong because the first draw changed what was left in the drawer.

Tree diagrams

A tree diagram lays out a two-stage process. The first set of branches shows the first stage with its probabilities. From the end of each first branch, a second set shows the second stage, labeled with conditional probabilities given that branch. Multiplying along a path applies the general multiplication rule, and the path products of the whole tree add to 1.

A basketball player takes two free throws. She makes the first 80% of the time. If she makes it, she makes the second 85% of the time; if she misses the first, she makes the second only 60% of the time.

Tree diagram. First shot: make 0.80, miss 0.20. After a make, second shot make 0.85, miss 0.15. After a miss, second shot make 0.60, miss 0.40. Path probabilities: make-make 0.80 times 0.85 = 0.68, make-miss 0.80 times 0.15 = 0.12, miss-make 0.20 times 0.60 = 0.12, miss-miss 0.20 times 0.40 = 0.08.

The four paths are mutually exclusive (topic 2.5) and cover every possibility: 0.68+0.12+0.12+0.08=10.68 + 0.12 + 0.12 + 0.08 = 1. An event that several paths lead to gets the sum of their products. She makes exactly one shot on the make-miss and miss-make paths, so P(exactly one)=0.12+0.12=0.24P(\text{exactly one}) = 0.12 + 0.12 = 0.24. She makes the second shot on two paths, so P(makes second)=0.68+0.12=0.80P(\text{makes second}) = 0.68 + 0.12 = 0.80.

The tree also answers "backward" questions, where the condition is the second stage. Given that she made the second shot, what's the chance she missed the first? Use the definition: the "both" path is miss-make, and the condition's probability is the sum just found.

P(missed first∣made second)=0.120.80=0.15.P(\text{missed first} \mid \text{made second}) = \frac{0.12}{0.80} = 0.15.

Worked examples

Worked exampleExample 1: reading conditionals from a table

A pizza shop recorded the size and the type of its 250 orders on a Friday night.

DeliveryPickupTotal
Small203050
Medium4555100
Large7525100
Total140110250

One order is chosen at random. Find (a) P(large∣delivery)P(\text{large} \mid \text{delivery}), (b) P(delivery∣large)P(\text{delivery} \mid \text{large}), and (c) the probability the order was picked up, given that it was not large.

Show solution

(a) Given delivery, the order is one of the 140 in the Delivery column, and 75 of those are large: P(large∣delivery)=75140≈0.536P(\text{large} \mid \text{delivery}) = \frac{75}{140} \approx 0.536.

(b) Given large, the order is one of the 100 in the Large row, and 75 were delivered: P(delivery∣large)=75100=0.75P(\text{delivery} \mid \text{large}) = \frac{75}{100} = 0.75.

Same cell, two answers: (a) asks what share of deliveries were large, (b) what share of large orders were delivered.

(c) "Not large" is the Small and Medium rows together, 50+100=15050 + 100 = 150 orders, of which 30+55=8530 + 55 = 85 were picked up: P(pickup∣not large)=85150≈0.567P(\text{pickup} \mid \text{not large}) = \frac{85}{150} \approx 0.567.

Worked exampleExample 2: choosing without replacement

A class of 24 students includes 9 seniors. The teacher picks two different students at random to present first and second. Find the probability that (a) both are seniors and (b) exactly one is a senior.

Show solution

(a) The first pick is a senior with probability 924\frac{9}{24}. Given that, 23 students remain and 8 are seniors. By the general multiplication rule,

P(both seniors)=924⋅823=72552≈0.130.P(\text{both seniors}) = \frac{9}{24} \cdot \frac{8}{23} = \frac{72}{552} \approx 0.130.

(b) Exactly one senior happens two ways, which are mutually exclusive: senior then non-senior, or non-senior then senior.

P(S then N)=924⋅1523=135552,P(N then S)=1524⋅923=135552.P(S \text{ then } N) = \frac{9}{24} \cdot \frac{15}{23} = \frac{135}{552}, \qquad P(N \text{ then } S) = \frac{15}{24} \cdot \frac{9}{23} = \frac{135}{552}.

Adding, P(exactly one senior)=270552≈0.489P(\text{exactly one senior}) = \frac{270}{552} \approx 0.489. The two orders have the same probability because the same factors appear in each product, just in a different order.

Worked exampleExample 3: exam-style free response

At an airport, 4% of checked bags contain an item that is not allowed. A scanner flags 95% of the bags that contain such an item. It also flags 8% of the bags that do not.

(a) What is the probability that a randomly selected checked bag is flagged by the scanner?

(b) A bag has just been flagged. What is the probability that it actually contains an item that is not allowed? Show your work.

Show solution

Let DD = the bag contains an item that is not allowed, and FF = the scanner flags the bag. The givens are P(D)=0.04P(D) = 0.04, P(F∣D)=0.95P(F \mid D) = 0.95, and P(F∣DC)=0.08P(F \mid D^C) = 0.08, so P(DC)=0.96P(D^C) = 0.96. A tree has DD and DCD^C as the first branches and flagged or not as the second.

(a) A bag is flagged along two paths, which are mutually exclusive:

P(D∩F)=P(D) P(F∣D)=0.04⋅0.95=0.038P(D \cap F) = P(D)\,P(F \mid D) = 0.04 \cdot 0.95 = 0.038
P(DC∩F)=P(DC) P(F∣DC)=0.96⋅0.08=0.0768P(D^C \cap F) = P(D^C)\,P(F \mid D^C) = 0.96 \cdot 0.08 = 0.0768
P(F)=0.038+0.0768=0.1148.P(F) = 0.038 + 0.0768 = 0.1148.

The probability that a randomly selected checked bag is flagged is 0.1148.

(b) The question gives the flag and asks about the contents, so the condition is FF:

P(D∣F)=P(D∩F)P(F)=0.0380.1148≈0.331.P(D \mid F) = \frac{P(D \cap F)}{P(F)} = \frac{0.038}{0.1148} \approx 0.331.

Only about 33.1% of flagged bags actually contain an item that is not allowed.

Why these moves: the tree organizes the givens, which are all conditional on the bag's contents, and the definition of conditional probability turns them around to condition on the flag. Every product and sum is written out, because on the exam the work earns the credit as much as the final number. The result is low because bags without a forbidden item are so common (96%) that even 8% of them outnumber the flagged bags that do have one: 0.0768 against 0.038.

Where students lose points

Check yourself

  1. Question 1

    For two events, P(A)=0.5P(A) = 0.5, P(B)=0.4P(B) = 0.4, and P(A∩B)=0.1P(A \cap B) = 0.1. What is P(A∣B)P(A \mid B)?

    1. A

      0.100.10

    2. B

      0.200.20

    3. C

      0.250.25

    4. D

      0.500.50

    Show answer

    C

    P(A∣B)=P(A∩B)P(B)=0.10.4=0.25P(A \mid B) = \frac{P(A \cap B)}{P(B)} = \frac{0.1}{0.4} = 0.25. Choice B divides by P(A)P(A) instead, which gives P(B∣A)P(B \mid A): the condition decides the denominator.

  2. Question 2

    At a cafe, 30% of customers order a pastry, and 60% of the customers who order a pastry also order coffee. What is the probability that a randomly chosen customer orders both a pastry and coffee?

    Show answer

    0.30×0.60=0.180.30 \times 0.60 = 0.18

    The 60% is P(coffee∣pastry)P(\text{coffee} \mid \text{pastry}), so the general multiplication rule gives P(pastry∩coffee)=P(pastry)⋅P(coffee∣pastry)=0.18P(\text{pastry} \cap \text{coffee}) = P(\text{pastry}) \cdot P(\text{coffee} \mid \text{pastry}) = 0.18.

  3. Question 3

    Using only the cafe information in the previous question, what is the probability that a customer who orders coffee also orders a pastry?

    1. A

      0.180.18

    2. B

      0.300.30

    3. C

      0.600.60

    4. D

      It cannot be determined from the information given.

    Show answer

    D

    P(pastry∣coffee)=P(pastry∩coffee)P(coffee)P(\text{pastry} \mid \text{coffee}) = \frac{P(\text{pastry} \cap \text{coffee})}{P(\text{coffee})}, and nothing tells you what fraction of all customers order coffee. Choice C is tempting, but 0.60 is the probability with the condition the other way around.

  4. Question 4

    Events AA and BB are mutually exclusive and P(A)=0.3P(A) = 0.3. What is P(B∣A)P(B \mid A), and why?

    Show answer

    P(B∣A)=0P(B \mid A) = 0.

    Mutually exclusive means P(A∩B)=0P(A \cap B) = 0 (topic 2.5), so P(B∣A)=00.3=0P(B \mid A) = \frac{0}{0.3} = 0. Once you know AA happened, BB cannot have happened.

Go deeper