Math Core

Lesson 4.3 · Probability, Random Variables and Distributions

Conditional probability

Knowing that one event happened often changes the probability of another. A positive medical test changes the chance you have a disease, and knowing a student is a senior changes the chance they have a driver's license. Conditional probability is the tool for updating probabilities when you learn new information.

What "given" means

The conditional probability of AA given BB, written P(A∣B)P(A \mid B), is the probability that AA happens when you already know BB happened. Knowing BB happened shrinks the sample space: you only look at outcomes inside BB, and ask what fraction of them are also in AA.

Definition

Conditional probability

For events AA and BB with P(B)>0P(B) > 0,

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

In a two-way table, this means: restrict to the row or column of the given event, then divide by that row or column total, not by the grand total.

Worked example: Conditional probability from a two-way table

A survey of 220 students recorded grade level and phone type.

iPhoneAndroidTotal
9th grade382260
10th grade453580
11th grade522880
Total13585220

Find (a) P(Android∣11th grade)P(\text{Android} \mid \text{11th grade}) and (b) P(11th grade∣Android)P(\text{11th grade} \mid \text{Android}).

Solution.

(a) Restrict to the 80 eleventh graders. Of them, 28 use Android:

P(Android∣11th)=2880=0.35.P(\text{Android} \mid \text{11th}) = \dfrac{28}{80} = 0.35.

(b) Restrict to the 85 Android users. Of them, 28 are eleventh graders:

P(11th∣Android)=2885≈0.329.P(\text{11th} \mid \text{Android}) = \dfrac{28}{85} \approx 0.329.

Same cell, different denominators, different answers.

Common mistake

P(A∣B)P(A \mid B) and P(B∣A)P(B \mid A) are usually not equal. The event after the bar is the one you know happened, and its total goes in the denominator. Reading the question carefully for words like "given", "of those who", or "among" tells you which group to restrict to.

The general multiplication rule

Rearranging the definition gives a rule for "and" probabilities:

General multiplication rule

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

The probability that both happen is the probability the first happens times the probability the second happens given the first.

This is exactly what you use when drawing without replacement: the second draw's probabilities depend on what the first draw removed.

Worked example: Drawing without replacement

A bag has 10 marbles: 4 red and 6 blue. You draw two marbles without replacement. Find the probability both are red.

Solution.

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

After one red is removed, only 3 of the remaining 9 marbles are red.

Tree diagrams

When a process happens in stages, a tree diagram organizes the multiplication rule. Each first-level branch shows a probability; each second-level branch shows a conditional probability given the branch it grows from. Multiply along a path to get the probability of that whole path, and add paths to get the probability of an event that can happen several ways.

Worked example: A screening test

A disease affects 2%2\% of a population. A screening test gives a positive result for 95%95\% of people who have the disease and for 8%8\% of people who don't. A randomly chosen person tests positive. What is the probability the person actually has the disease?

Solution. Set up the tree.

  • Disease (0.020.02), then positive (0.950.95): 0.02×0.95=0.0190.02 \times 0.95 = 0.019.
  • Disease (0.020.02), then negative (0.050.05): 0.02×0.05=0.0010.02 \times 0.05 = 0.001.
  • No disease (0.980.98), then positive (0.080.08): 0.98×0.08=0.07840.98 \times 0.08 = 0.0784.
  • No disease (0.980.98), then negative (0.920.92): 0.98×0.92=0.90160.98 \times 0.92 = 0.9016.

The four paths add to 11, a good check. Two paths lead to a positive test:

P(positive)=0.019+0.0784=0.0974.P(\text{positive}) = 0.019 + 0.0784 = 0.0974.

Now use the definition of conditional probability:

P(disease∣positive)=P(disease and positive)P(positive)=0.0190.0974≈0.195.P(\text{disease} \mid \text{positive}) = \dfrac{P(\text{disease and positive})}{P(\text{positive})} = \dfrac{0.019}{0.0974} \approx 0.195.

Only about 20%20\% of people who test positive have the disease. Because the disease is rare, most positive results come from the huge group of healthy people.

That last example shows why conditional probability matters in the real world: the answer is far from the 95%95\% many people would guess.

Tip

For "reverse" questions like P(disease∣positive)P(\text{disease} \mid \text{positive}), the recipe is always the same: the numerator is the one path you want, and the denominator is the sum of all paths that match the given information.

Practice

Practice 1

For events AA and BB, P(A and B)=0.12P(A \text{ and } B) = 0.12 and P(B)=0.4P(B) = 0.4. Find P(A∣B)P(A \mid B).

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

Practice 2

A random sample of 400 adults were asked whether they exercise regularly.

YesNoTotal
Under 4012872200
40 and over96104200
Total224176400

Find the probability that a randomly chosen adult from this sample exercises regularly, given that the person is under 40.

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

Practice 3

Using the table in the previous problem, find the probability that a randomly chosen adult is 40 or over, given that the person does not exercise regularly. Give an exact fraction or a decimal rounded to 3 places.

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

Practice 4

A box contains 12 light bulbs, 3 of which are defective. Two bulbs are chosen at random without replacement. Find the probability that both are defective. Give an exact fraction or a decimal rounded to 3 places.

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

Practice 5

A store finds that 60%60\% of its orders are placed online and 40%40\% in the store. Of online orders, 5%5\% are returned; of in-store orders, 3%3\% are returned. What is the probability that a randomly chosen order is returned?

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

Practice 6

In the previous problem, a randomly chosen order was returned. What is the probability it was placed online? Give an exact fraction or a decimal rounded to 3 places.

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

Practice 7

At a college, 30%30\% of students are engineering majors, and 80%80\% of engineering majors took calculus in high school. Which statement is correct?