Math Core

Lesson 12.3 · Probability

Conditional probability

New information changes probabilities. The chance that a random roll of two number cubes has a sum of 1212 is 136\dfrac{1}{36}. But if a friend peeks and tells you "at least one cube shows a 66," the chance jumps. Conditional probability is the tool for updating a probability once you know something has happened.

Shrinking the sample space

Definition

Conditional probability

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

Knowing that AA happened throws away every outcome outside AA. The event AA becomes your new, smaller sample space, and you ask what fraction of it also lies in BB.

Worked example: Given a sum of 8

You roll two number cubes. Given that the sum is 88, what is the probability that one of the cubes shows a 33?

The condition "sum is 88" leaves only these outcomes:

(2,6),(3,5),(4,4),(5,3),(6,2).(2, 6), \quad (3, 5), \quad (4, 4), \quad (5, 3), \quad (6, 2).

That's the new sample space: 55 equally likely outcomes. Two of them contain a 33: (3,5)(3, 5) and (5,3)(5, 3). So

P(a 3∣sum is 8)=25.P(\text{a } 3 \mid \text{sum is } 8) = \frac{2}{5}.

Compare this with P(a 3)=1136P(\text{a } 3) = \dfrac{11}{36} with no information. Knowing the sum changed the probability.

The formula

Counting inside the smaller sample space works when outcomes are equally likely. In general, you divide the probability of the overlap by the probability of the condition.

Conditional probability formula

If P(A)>0P(A) > 0, then

P(B∣A)=P(A∩B)P(A).P(B \mid A) = \frac{P(A \cap B)}{P(A)}.

With equally likely outcomes this is the same as number of outcomes in A∩Bnumber of outcomes in A\dfrac{\text{number of outcomes in } A \cap B}{\text{number of outcomes in } A}.

For the sum-of-88 example: P(A∩B)=236P(A \cap B) = \dfrac{2}{36} and P(A)=536P(A) = \dfrac{5}{36}, so P(B∣A)=2/365/36=25P(B \mid A) = \dfrac{2/36}{5/36} = \dfrac{2}{5}, the same answer.

Common mistake

P(B∣A)P(B \mid A) and P(A∣B)P(A \mid B) are usually different. The probability that a person is a professional basketball player, given that they are over 77 feet tall, is fairly high. The probability that a person is over 77 feet tall, given that they are a professional basketball player, is much lower. The event after the bar is the one you know; it goes in the denominator.

The general multiplication rule

Multiply both sides of the formula by P(A)P(A) and you get a rule for "and" that works even when events are dependent.

General multiplication rule

P(A∩B)=P(A)⋅P(B∣A).P(A \cap B) = P(A) \cdot P(B \mid A).

If AA and BB are independent, then P(B∣A)=P(B)P(B \mid A) = P(B) and this becomes the rule from the last lesson, P(A∩B)=P(A)⋅P(B)P(A \cap B) = P(A) \cdot P(B).

This is exactly what you need for drawing without replacement: the second probability is conditional on what happened in the first draw.

Worked example: Drawing without replacement

A bag has 44 red and 66 blue marbles. You draw two marbles without putting the first one back. What is the probability that both are red?

P(1st red)=410.P(\text{1st red}) = \frac{4}{10}.

Given that the first was red, 33 red marbles remain among 99:

P(2nd red∣1st red)=39.P(\text{2nd red} \mid \text{1st red}) = \frac{3}{9}.P(both red)=410⋅39=1290=215.P(\text{both red}) = \frac{4}{10} \cdot \frac{3}{9} = \frac{12}{90} = \frac{2}{15}.

With replacement, the answer would have been 410⋅410=425\dfrac{4}{10} \cdot \dfrac{4}{10} = \dfrac{4}{25}, a bit larger.

Independence, again

The definition of independence ("knowing AA doesn't change the chance of BB") now has a symbolic form.

Independence using conditional probability

AA and BB are independent exactly when P(B∣A)=P(B)P(B \mid A) = P(B) (equivalently, P(A∣B)=P(A)P(A \mid B) = P(A)).

For example, if P(B)=0.3P(B) = 0.3 and P(B∣A)=0.5P(B \mid A) = 0.5, then learning that AA happened raised the chance of BB, so the events are dependent.

Tree diagrams

When an experiment happens in stages, draw a tree. Write the probability on each branch; branches after the first split are conditional probabilities. Multiply along a path to get the probability of that path, and add paths that lead to the same result.

Worked example: Two machines

A factory has two machines. Machine A makes 60%60\% of the parts, and 3%3\% of its parts are defective. Machine B makes the other 40%40\%, and 5%5\% of its parts are defective. A part is chosen at random.

  1. What is the probability that it is defective?
  2. If the part is defective, what is the probability that Machine A made it?

The tree has these four paths:

  • A, defective: 0.60×0.03=0.0180.60 \times 0.03 = 0.018
  • A, not defective: 0.60×0.97=0.5820.60 \times 0.97 = 0.582
  • B, defective: 0.40×0.05=0.0200.40 \times 0.05 = 0.020
  • B, not defective: 0.40×0.95=0.3800.40 \times 0.95 = 0.380

The four path probabilities add to 11, a good check.

  1. Two paths end in "defective": P(D)=0.018+0.020=0.038P(D) = 0.018 + 0.020 = 0.038.
  2. Use the formula with "defective" as the condition:
P(A∣D)=P(A∩D)P(D)=0.0180.038=1838=919≈0.47.P(A \mid D) = \frac{P(A \cap D)}{P(D)} = \frac{0.018}{0.038} = \frac{18}{38} = \frac{9}{19} \approx 0.47.

Even though Machine A makes most of the parts, a defective part is slightly more likely to have come from Machine B.

Tip

Before computing P(B∣A)P(B \mid A), say the condition out loud: "Out of all the times AA happens, how often does BB happen?" Whatever follows "out of" goes in the denominator.

Practice

Practice 1

P(A)=0.5P(A) = 0.5 and P(A∩B)=0.2P(A \cap B) = 0.2. Find P(B∣A)P(B \mid A).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

You roll one number cube. Given that the result is odd, what is the probability that it is greater than 22?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

P(B)=0.3P(B) = 0.3 and P(A∣B)=0.5P(A \mid B) = 0.5. Find P(A∩B)P(A \cap B).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

A bag has 55 green and 33 yellow marbles. You draw two without replacement. Given that the first marble is yellow, what is the probability that the second is green?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Two cards are drawn from a standard 5252-card deck without replacement. What is the probability that both are aces?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

You roll two number cubes. Given that at least one cube shows a 66, what is the probability that the sum is at least 1010?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

On any given morning there is a 30%30\% chance of rain. When it rains, Jada's bus is late 40%40\% of the time. When it doesn't rain, the bus is late 10%10\% of the time. What is the probability that the bus is late on a random morning?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

Use the bus situation from the previous problem. Given that the bus is late, what is the probability that it rained that morning?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.