Lesson 42 of 46 · Data analysis

Probability: compound events and conditional probability

Find probabilities by counting, combine events with "and", "or" and "not", draw without replacement, and read conditional probabilities from a two-way table.

About 24 minutes

In this lesson

  • Compute a probability by counting equally likely outcomes, and use the complement for "at least one".
  • Combine events with the addition rule and, for independent or dependent events, the multiplication rule.
  • Find a conditional probability from a two-way table and tell P(A given B) from P(B given A).

The idea

Probability as a fraction of outcomes

When every outcome is equally likely,

P(event)=number of favourable outcomestotal number of outcomes.P(\text{event}) = \frac{\text{number of favourable outcomes}}{\text{total number of outcomes}}.

A probability is always between 0 (impossible) and 1 (certain). Drawing one marble from a bag of 5 red, 3 blue and 2 green, P(blue)=310P(\text{blue}) = \frac{3}{10}. Everything in this lesson either counts outcomes like this or combines probabilities you already have.

"Not": the complement

The probability that an event does not happen is

P(not A)=1−P(A).P(\text{not } A) = 1 - P(A).

This is the tool for "at least one". Counting all the ways to get at least one success is messy; the only way to fail is to get no successes, which is usually one simple case. So P(at least one)=1−P(none)P(\text{at least one}) = 1 - P(\text{none}).

"Or": the addition rule

P(A or B)=P(A)+P(B)−P(A and B)P(A \text{ or } B) = P(A) + P(B) - P(A \text{ and } B)

The subtraction removes outcomes counted in both, exactly as in a Venn diagram. If AA and BB cannot happen together (they are mutually exclusive), P(A and B)=0P(A \text{ and } B) = 0 and the probabilities simply add. Rolling a fair six-sided die, "even" and "greater than 4" overlap at 6, so P=36+26−16=46=23P = \frac{3}{6} + \frac{2}{6} - \frac{1}{6} = \frac{4}{6} = \frac{2}{3}; listing the outcomes 2, 4, 5, 6 confirms it.

"And": the multiplication rule

Two events are independent if knowing that one happened does not change the probability of the other: separate coin tosses, separate dice, draws with replacement. For independent events,

P(A and B)=P(A)×P(B).P(A \text{ and } B) = P(A) \times P(B).

When the first event changes the situation for the second, the events are dependent, and you multiply by the probability of the second given the first:

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

Drawing without replacement is the usual case. From the bag of 10 marbles above, the probability that two draws are both red is 510×49\frac{5}{10} \times \frac{4}{9}, because after one red marble is gone, 4 of the 9 left are red.

Do not confuse "independent" with "mutually exclusive". Mutually exclusive events with positive probabilities are never independent: if one happens, the other's probability drops to 0.

Probability by counting

When the process is a selection, counting methods give the probability directly. The chance that a random group of 2 from the 10 marbles is both red is

(52)(102)=1045=29,\frac{\binom{5}{2}}{\binom{10}{2}} = \frac{10}{45} = \frac{2}{9},

the same as 510×49=2090=29\frac{5}{10} \times \frac{4}{9} = \frac{20}{90} = \frac{2}{9}. Having two routes gives you a check.

When an outcome can happen in more than one order (one red and one blue, say), multiplying along one order counts only that order. Either add the orders, or count unordered groups.

Conditional probability

P(A∣B)P(A \mid B), read "the probability of AA given BB", is the probability of AA when you already know BB happened. Knowing BB shrinks the set of possible outcomes to BB itself:

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

With a two-way table of counts, this is just a fraction of one row or one column: the count in the cell for "AA and BB" divided by the total for BB. The word after "given" (or after "of those who", "among") names the total you divide by.

P(A∣B)P(A \mid B) and P(B∣A)P(B \mid A) are different numbers in general, because they divide by different totals. The probability that a randomly chosen basketball player is tall is high; the probability that a randomly chosen tall person plays basketball is low.

Two events are independent exactly when P(A∣B)=P(A)P(A \mid B) = P(A): knowing BB tells you nothing new about AA. A two-way table lets you test this by comparing a row's proportion with the overall proportion.

A routine for any question

  1. Decide what one outcome is, and whether outcomes are equally likely.
  2. Translate the words: "and" multiplies, "or" adds (minus the overlap), "not" and "at least one" use the complement, "given" divides by a smaller total.
  3. Check independence before multiplying.
  4. Sanity-check: the answer lies between 0 and 1, and an "and" probability is no larger than either event alone.

Worked examples

Example 1: Two draws without replacement

A bag holds 5 red, 3 blue and 2 green marbles. Two marbles are drawn at random without replacement. What is the probability that both are red?

  1. First draw: 5 of the 10 marbles are red, so P(first red)=510P(\text{first red}) = \frac{5}{10}.

  2. Given that a red marble is gone, 4 of the remaining 9 are red: P(second red∣first red)=49P(\text{second red} \mid \text{first red}) = \frac{4}{9}.

  3. Multiply: 510×49=2090=29\frac{5}{10} \times \frac{4}{9} = \frac{20}{90} = \frac{2}{9}.

  4. Check by counting: (52)=10\binom{5}{2} = 10 red pairs out of (102)=45\binom{10}{2} = 45 pairs in all, and 1045=29\frac{10}{45} = \frac{2}{9}.

Answer

The probability is 29\frac{2}{9}, about 0.22. Treating the draws as if the first marble were replaced gives 510×510=14\frac{5}{10} \times \frac{5}{10} = \frac{1}{4}, the tempting wrong answer.

Example 2: At least one, through the complement

On any day, a machine breaks down with probability 0.1, independently of other days. What is the probability that it breaks down on at least one of three days?

  1. "At least one" has several cases (one, two or three breakdowns). Its complement, "no breakdown on any day", is a single case.

  2. No breakdown on one day: 1−0.1=0.91 - 0.1 = 0.9. On three independent days: 0.9×0.9×0.9=0.7290.9 \times 0.9 \times 0.9 = 0.729.

  3. At least one breakdown: 1−0.729=0.2711 - 0.729 = 0.271.

Answer

The probability is 0.271. Adding 0.1+0.1+0.1=0.30.1 + 0.1 + 0.1 = 0.3 is the tempting wrong answer: it counts the days with two or three breakdowns more than once, and with enough days it would exceed 1.

Example 3: Conditional probability from a two-way table

A firm's 200 employees, by department and where they work:

Remote Office Total
Engineering 48 32 80
Sales 36 84 120
Total 84 116 200

An employee is chosen at random. Find P(remote∣engineering)P(\text{remote} \mid \text{engineering}) and P(engineering∣remote)P(\text{engineering} \mid \text{remote}), and decide whether working remotely is independent of department.

  1. Given engineering, the total is the Engineering row, 80, and 48 of them are remote: 4880=0.6\frac{48}{80} = 0.6.

  2. Given remote, the total is the Remote column, 84, and 48 of them are in engineering: 4884=47≈0.571\frac{48}{84} = \frac{4}{7} \approx 0.571.

  3. Overall, P(remote)=84200=0.42P(\text{remote}) = \frac{84}{200} = 0.42.

  4. Since P(remote∣engineering)=0.6P(\text{remote} \mid \text{engineering}) = 0.6 is not 0.420.42, knowing the department changes the probability: the events are not independent.

Answer

P(remote∣engineering)=0.6P(\text{remote} \mid \text{engineering}) = 0.6, P(engineering∣remote)=47≈0.571P(\text{engineering} \mid \text{remote}) = \frac{4}{7} \approx 0.571, and the events are not independent. Using 48200=0.24\frac{48}{200} = 0.24 for either conditional probability is the common slip: that is the probability of "remote and engineering".

Common traps

  • Adding probabilities that overlap

    P(A)+P(B)P(A) + P(B) counts the outcomes in both events twice. Subtract P(A and B)P(A \text{ and } B) unless the events cannot happen together. A sum above 1 is a sure sign of this error.

  • Multiplying dependent events as if independent

    Without replacement, the second draw comes from a smaller, changed collection. Reduce both the favourable count and the total before multiplying.

  • Reversing a conditional probability

    "Of the remote workers, what fraction are engineers?" divides by the remote total; "of the engineers, what fraction work remotely?" divides by the engineering total. Name the total after "given" or "of those" before writing the fraction.

  • Counting only one order

    "One red and one blue" can happen as red then blue or blue then red. Multiplying along one order gives half the answer; add both orders, or count unordered selections.

Check yourself

Answer each question before you open its answer.

Question 1: One of each colour

Data Analysis: probability

A box contains 4 white tokens and 6 black tokens. Two tokens are drawn at random without replacement. What is the probability that one token is white and the other is black?

  1. A.215\frac{2}{15}
  2. B.415\frac{4}{15}
  3. C.13\frac{1}{3}
  4. D.1225\frac{12}{25}
  5. E.815\frac{8}{15}
Show the answer

Answer: E. 815\frac{8}{15}

Working

White then black: 410×69=2490\frac{4}{10} \times \frac{6}{9} = \frac{24}{90}. Black then white: 610×49=2490\frac{6}{10} \times \frac{4}{9} = \frac{24}{90}. Total: 4890=815\frac{48}{90} = \frac{8}{15}. By counting: 4×6=244 \times 6 = 24 mixed pairs out of (102)=45\binom{10}{2} = 45 pairs, and 2445=815\frac{24}{45} = \frac{8}{15}. As a further check, 215+13+815=2+5+815=1\frac{2}{15} + \frac{1}{3} + \frac{8}{15} = \frac{2 + 5 + 8}{15} = 1.

Why the other options are wrong

  • A. This is the probability that both are white, 410×39\frac{4}{10} \times \frac{3}{9}.
  • B. This counts only one order, white then black (410×69\frac{4}{10} \times \frac{6}{9}); black then white is equally likely and must be added.
  • C. This is the probability that both are black, 610×59\frac{6}{10} \times \frac{5}{9}.
  • D. This is 2×410×6102 \times \frac{4}{10} \times \frac{6}{10}, which treats the draws as if the first token were put back.

What carries over

For a mixed outcome, count every order or count unordered groups; the two routes must agree.

Question 2: "Or" for independent events

Quantitative Comparison

Events AA and BB are independent, with P(A)=0.5P(A) = 0.5 and P(B)=0.4P(B) = 0.4.

Quantity A Quantity B
The probability that AA or BB (or both) occurs 0.7
  1. A.Quantity A is greater.
  2. B.Quantity B is greater.
  3. C.The two quantities are equal.
  4. D.The relationship cannot be determined from the information given.
Show the answer

Answer: C. The two quantities are equal.

Working

Because the events are independent, P(A and B)=0.5×0.4=0.2P(A \text{ and } B) = 0.5 \times 0.4 = 0.2. Then P(A or B)=0.5+0.4−0.2=0.7P(A \text{ or } B) = 0.5 + 0.4 - 0.2 = 0.7. Through the complement: P(neither)=0.5×0.6=0.3P(\text{neither}) = 0.5 \times 0.6 = 0.3, and 1−0.3=0.71 - 0.3 = 0.7.

Why the other options are wrong

  • A. This adds 0.5+0.4=0.90.5 + 0.4 = 0.9 without removing the outcomes where both events occur.
  • B. This comes from subtracting too much, for example treating "or" as "exactly one of them" (0.9−2×0.2=0.50.9 - 2 \times 0.2 = 0.5).
  • D. The overlap is not given directly, but independence fixes it: P(A and B)=0.5×0.4P(A \text{ and } B) = 0.5 \times 0.4.

What carries over

Independence gives you the overlap; then use the addition rule or the complement.

Question 3: Given that they prefer tea

Data Analysis: conditional probability

A survey of 150 people:

Prefers tea Prefers coffee Total
Under 30 18 42 60
30 and over 54 36 90
Total 72 78 150

One of the people who prefer tea is chosen at random. What is the probability that this person is under 30?

  1. A.325\frac{3}{25}
  2. B.14\frac{1}{4}
  3. C.310\frac{3}{10}
  4. D.25\frac{2}{5}
  5. E.1225\frac{12}{25}
Show the answer

Answer: B. 14\frac{1}{4}

Working

The person is known to prefer tea, so the total is the tea column, 72. Of these, 18 are under 30: 1872=14\frac{18}{72} = \frac{1}{4}.

Why the other options are wrong

  • A. This is 18150\frac{18}{150}, the probability that a person from the whole survey is both under 30 and prefers tea.
  • C. This is 1860\frac{18}{60}, the probability of preferring tea given under 30: the condition is reversed.
  • D. This is 60150\frac{60}{150}, the share of everyone surveyed who are under 30, ignoring that the person prefers tea.
  • E. This is 72150\frac{72}{150}, the probability of preferring tea, not of being under 30.

What carries over

The condition names the row or column you divide by; the cell where both hold goes on top.

Key points

  • "And" multiplies (using the updated probability if events are dependent); "or" adds and subtracts the overlap.

  • For "at least one", subtract the probability of "none" from 1.

  • Without replacement, both the favourable count and the total shrink.

  • P(A∣B)P(A \mid B) divides by the total for BB; it is generally not equal to P(B∣A)P(B \mid A).

All questions here are original and written for UniExamer; none comes from the test maker.

Written by the UniExamer team with AI assistance. Every worked example and check question was re-solved by an independent checker before publication. No subject expert has reviewed this lesson yet. If you find a mistake, write to support@uniexamer.com.

Poćwicz ten temat

Nowe pytania z tej umiejętności, z rozwiązaniami. Ćwiczenia wymagają Single Exam Pass lub Plus.