myLearning

Topic 1 of 7

Step 22: Probability theory

Counting, conditional probability, and Bayes' rule

Step 22 · Probability theory topics

Compute probabilities by counting equally likely outcomes, update them with conditional probability, and turn conditional probabilities around with Bayes' rule.

Counting outcomes

When all outcomes are equally likely, P(A) is the number of outcomes in A divided by the total. Counting tools, such as products, permutations and combinations, do the work.

Example: Two dice

Roll two fair dice. What is the probability that the total is 7?

  1. There are 36 equally likely outcomes.
  2. Six give 7: (1, 6), (2, 5), (3, 4), (4, 3), (5, 2) and (6, 1).

Answer636=16\frac{6}{36} = \frac{1}{6}

Example: A committee

A committee of 3 is chosen at random from 5 women and 4 men. What is the probability it is all women?

  1. There are (93)=84\binom{9}{3} = 84 committees, and (53)=10\binom{5}{3} = 10 of them are all women.

Answer1084\frac{10}{84}, about 0.12

Example: Shared birthdays

In a group of 23 people, what is the probability that at least two share a birthday?

  1. Find the complement: all 23 birthdays different.
  2. That is 365×364×⋯×34336523\frac{365 \times 364 \times \cdots \times 343}{365^{23}}, about 0.493.

AnswerAbout 0.507: better than even

Conditional probability

P(A | B) is the probability of A once you know B happened: the share of B's probability that also lies in A. Rearranged, it gives the multiplication rule.

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

Example: Two aces

Two cards are drawn without replacement. What is the probability that both are aces?

  1. P(first is an ace) = 4/52.
  2. P(second is an ace | first is an ace) = 3/51.

Answer452×351=1221\frac{4}{52} \times \frac{3}{51} = \frac{1}{221}

Example: Total probability

Factory A makes 60% of the parts, 2% of them faulty; factory B makes 40%, 5% of them faulty. What fraction of all parts are faulty?

  1. Split by factory: 0.6 × 0.02 + 0.4 × 0.05.
  2. 0.012 + 0.02 = 0.032.

Answer0.032, or 3.2%

Bayes' rule

Bayes' rule turns P(B | A) into P(A | B). It updates a starting belief, the prior P(A), into a new belief, the posterior P(A | B), in light of the evidence B.

P(A∣B)=P(B∣A) P(A)P(B)P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}

Example: A faulty part

A part from those factories is faulty. What is the probability it came from B?

  1. P(faulty | B) × P(B) = 0.05 × 0.4 = 0.02.
  2. Divide by P(faulty), which is 0.032.

Answer0.625: more than B's 40% share of the parts

Example: A medical test

A condition affects 1% of people. A test catches 95% of cases but also flags 10% of people without it. Given a positive test, what is the chance of having the condition?

  1. P(positive) = 0.95 × 0.01 + 0.1 × 0.99 = 0.1085.
  2. P(condition | positive) = 0.0095 ÷ 0.1085.

AnswerAbout 0.088: under 9%

Try it yourself

Work each one on paper first, then open the answer to check.

  1. Roll one die. What is P(even or 5)?

    Show answer

    23\frac{2}{3}

  2. Draw 2 cards. What is P(both hearts)?

    Show answer

    1352×1251=117\frac{13}{52} \times \frac{12}{51} = \frac{1}{17}

  3. P(A ∩ B) = 0.1 and P(B) = 0.4. What is P(A | B)?

    Show answer

    0.25

  4. Toss 4 coins. What is P(exactly 2 heads)?

    Show answer

    616=38\frac{6}{16} = \frac{3}{8}

  5. P(B | A) = 0.8, P(A) = 0.25 and P(B) = 0.5. What is P(A | B)?

    Show answer

    0.4

  6. In the medical test example, what is P(no condition | negative test)?

    Show answer

    About 0.999

What next?