Conditional Probability

Conditional probability is the probability of an event when you already know that another event happened. It is written P(A | B) and read “the probability of A given B.” The formula is P(A | B) = P(A and B) ÷ P(B). In a two-way table, you just use the row or column for B as the whole.

Before this lesson: Addition Rule and Mutually Exclusive Events, Probability Rules and Two-Way Tables

What “given” does

Knowing that something happened shrinks the set of possible outcomes. Suppose you roll a die and someone tells you the result is even. Now only 2, 4 and 6 are possible. The chance that it is a 6 is no longer 1/6. It is 1 out of 3.

The vertical bar in P(A \mid B) means “given.” The event after the bar, B, is the new whole. You ask what share of B is also A.

Conditional probability formula

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

This works whenever P(B) \gt 0. With counts, such as in a two-way table, it is the count for “A and B” divided by the count for B.

Multiplying both sides by P(B) gives the general multiplication rule. It finds the chance that two events both happen:

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

The same rule works in the other order: P(A \text{ and } B) = P(A) \cdot P(B \mid A). A tree diagram uses this rule. You multiply along each branch.

Conditional probability examples

Example 1: Use a two-way table

A survey asks 250 adults whether they pay for a streaming service (example data):

StreamsDoesn’t streamTotal
Under 409624120
40 or older7852130
Total17476250

Find the probability that a person streams, given that the person is under 40.

\text{given under 40: use the row total } 120

The Under 40 row is the new whole.

\text{under 40 and streams: } 96

Find the cell for both events.

P(\text{streams} \mid \text{under 40}) = \dfrac{96}{120}

Divide the cell by the row total.

\dfrac{96}{120} = 0.8

Divide.

Answer: 0.8. Of the adults under 40, 80% stream.

Example 2: Switch the order

Use the same table. Find the probability that a person is under 40, given that the person streams.

\text{given streams: use the column total } 174

Now the Streams column is the new whole.

\text{streams and under 40: } 96

The cell for both events is the same.

P(\text{under 40} \mid \text{streams}) = \dfrac{96}{174}

Divide the cell by the column total.

\dfrac{96}{174} \approx 0.552

Divide.

Answer: about 0.552. Compare it with 0.8 from Example 1. P(A \mid B) and P(B \mid A) are usually different, because the whole is different.

Example 3: Use the formula

At a high school, 30% of students take chemistry, and 12% take both chemistry and physics. Find the probability that a student takes physics, given that the student takes chemistry.

P(\text{P} \mid \text{C}) = \dfrac{P(\text{P and C})}{P(\text{C})}

Write the formula with C for chemistry and P for physics.

P(\text{P} \mid \text{C}) = \dfrac{0.12}{0.30}

Substitute the probabilities.

\dfrac{0.12}{0.30} = 0.4

Divide.

Answer: 0.4. Of the chemistry students, 40% also take physics.

Example 4: Drawing without replacement

Two cards are drawn from a standard 52-card deck without putting the first one back. Find the probability that both are aces.

P(\text{1st ace}) = \dfrac{4}{52}

There are 4 aces in 52 cards.

P(\text{2nd ace} \mid \text{1st ace}) = \dfrac{3}{51}

After one ace is gone, 3 aces are left in 51 cards.

P(\text{both aces}) = \dfrac{4}{52} \cdot \dfrac{3}{51}

Use the general multiplication rule.

\dfrac{4}{52} \cdot \dfrac{3}{51} = \dfrac{12}{2652}

Multiply the numerators and the denominators (see multiplying fractions).

\dfrac{12}{2652} = \dfrac{1}{221}

Simplify: divide the top and bottom by 12 (see fractions).

\dfrac{1}{221} \approx 0.0045

Divide.

Answer: 1/221, or about 0.0045. The second draw depends on the first, so the second probability is a conditional one.

Example 5: A tree diagram (word problem)

At a school, 60% of students ride the bus. Of the bus riders, 15% are late on a given day. Of the other students, 5% are late. Find the probability that a random student rides the bus and is late, and the probability that a random student is late.

Tree diagram. The first branches are bus, 0.6, and no bus, 0.4. From bus, the branches are late, 0.15, and on time, 0.85. From no bus, the branches are late, 0.05, and on time, 0.95. The ends show bus and late 0.09, bus and on time 0.51, no bus and late 0.02, and no bus and on time 0.38.
Multiply along each path. The four path probabilities add to 1.
P(\text{bus and late}) = 0.6 \cdot 0.15

Multiply along the bus, late path.

0.6 \cdot 0.15 = 0.09

Multiply (see operations with decimals).

P(\text{no bus and late}) = 0.4 \cdot 0.05

Multiply along the no bus, late path.

0.4 \cdot 0.05 = 0.02

Multiply.

P(\text{late}) = 0.09 + 0.02

Add the two paths that end in late.

0.09 + 0.02 = 0.11

Add.

Answer: P(bus and late) = 0.09, and P(late) = 0.11. The paths are mutually exclusive, so their probabilities add.

Common mistakes

MistakeExample of the errorFix
Dividing by the grand totalP(streams | under 40) = 96/250Divide by the total for the given event: 96/120.
Mixing up P(A | B) and P(B | A)Using 96/120 when asked for P(under 40 | streams)The event after the bar is the whole. Here divide by 174.
Using P(A and B) as the answerAnswering 0.12 for P(physics | chemistry)Divide by P(chemistry): 0.12 ÷ 0.30 = 0.4.
Forgetting the first draw changes the secondUsing 4/52 for the second aceWithout replacement, use 3/51 after an ace is drawn.
Adding along a branchP(bus and late) = 0.6 + 0.15Multiply along a branch; add across branches.
Branches that don’t add to 1Writing late 0.15 and on time 0.75 after busBranches from the same point must add to 1.

Related methods

Two-way tables and the addition rule

Two-way tables make conditional probability a simple division. The addition rule uses the same table to find “or” probabilities, and the complement from probability rules gives the missing branch in a tree.

Independence and Bayes’ theorem

If knowing B doesn’t change the chance of A, so that P(A \mid B) = P(A), the events are independent. That is the topic of the next lesson, Independent Events. Reversing a conditional probability, such as finding P(bus | late), is the job of Bayes’ theorem, later in this unit.

Practice problems

  1. Use the table in Example 1. Find P(doesn’t stream | 40 or older).
  2. Use the table in Example 1. Find P(40 or older | doesn’t stream).
  3. P(A and B) = 0.18 and P(B) = 0.45. Find P(A | B).
  4. P(A) = 0.5 and P(B | A) = 0.3. Find P(A and B).
  5. A die is rolled, and the result is even. Find the probability that it is greater than 3.
  6. Two cards are drawn without replacement. Find the probability that both are hearts.
  7. A bag has 5 red and 3 blue marbles. Two are drawn without replacement. Find the probability that both are red.
  8. Use the tree in Example 5. Find P(on time | bus) and P(bus and on time).
  9. Use the results of Example 5. Find the probability that a random student is not late.
  10. Explain in words why P(streams | under 40) and P(under 40 | streams) are different.
Show answers

1.

\dfrac{52}{130}

Divide the cell by the 40 or older row total.

\dfrac{52}{130} = 0.4

Divide.

Answer: 0.4

2.

\dfrac{52}{76}

Divide the cell by the doesn’t stream column total.

\dfrac{52}{76} \approx 0.684

Divide.

Answer: about 0.684

3.

\dfrac{0.18}{0.45} = 0.4

Use the conditional probability formula.

Answer: 0.4

4.

0.5 \cdot 0.3 = 0.15

Use the general multiplication rule.

Answer: 0.15

5.

\text{given even: } \{2, 4, 6\}

The new whole has 3 outcomes.

\text{greater than 3: } \{4, 6\}

Two of them are greater than 3.

\dfrac{2}{3} \approx 0.667

Divide.

Answer: 2/3

6.

\dfrac{13}{52} \cdot \dfrac{12}{51} = \dfrac{156}{2652}

After one heart, 12 hearts are left in 51 cards.

\dfrac{156}{2652} = \dfrac{1}{17}

Simplify: divide by 156.

Answer: 1/17, or about 0.0588

7.

\dfrac{5}{8} \cdot \dfrac{4}{7} = \dfrac{20}{56}

After one red, 4 red are left in 7 marbles.

\dfrac{20}{56} = \dfrac{5}{14}

Simplify: divide by 4.

Answer: 5/14, or about 0.357

8.

1 - 0.15 = 0.85

Branches from bus add to 1.

0.6 \cdot 0.85 = 0.51

Multiply along the bus, on time path.

Answer: P(on time | bus) = 0.85 and P(bus and on time) = 0.51

9.

1 - 0.11 = 0.89

Use the complement of P(late).

Answer: 0.89

10.

\text{different wholes}

The first divides by the 120 people under 40; the second divides by the 174 who stream.

Answer: the given event sets the group you look at; 80% of the under-40 group streams, but only about 55% of streamers are under 40

Conditional probability FAQ

What is the formula for conditional probability?

P(A \mid B) = \dfrac{P(A \text{ and } B)}{P(B)}. Divide the probability that both happen by the probability of the given event.

How do you find conditional probability from a two-way table?

Find the row or column for the given event and use its total as the denominator. The numerator is the cell where both events meet.

Is P(A | B) the same as P(B | A)?

Usually not. They divide by different totals, so in Examples 1 and 2 they are 0.8 and about 0.552.

What is the general multiplication rule?

It says P(A \text{ and } B) = P(A) \cdot P(B \mid A). You use it for draws without replacement and along the branches of a tree diagram.

Summary

  • P(A | B) is the probability of A given that B happened.
  • Formula: P(A \mid B) = \dfrac{P(A \text{ and } B)}{P(B)}. In a table, divide by the total for B.
  • P(A | B) and P(B | A) are usually different.
  • General multiplication rule: P(A \text{ and } B) = P(A) \cdot P(B \mid A).
  • In a tree diagram, multiply along branches and add across branches.

Previous lesson: Addition Rule and Mutually Exclusive Events

Next lesson: Independent Events

Back to the Statistics Index