Topic 1 of 7
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?
- There are 36 equally likely outcomes.
- Six give 7: (1, 6), (2, 5), (3, 4), (4, 3), (5, 2) and (6, 1).
Answer
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?
- There are committees, and of them are all women.
Answer, about 0.12
Example: Shared birthdays
In a group of 23 people, what is the probability that at least two share a birthday?
- Find the complement: all 23 birthdays different.
- That is , 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.
Example: Two aces
Two cards are drawn without replacement. What is the probability that both are aces?
- P(first is an ace) = 4/52.
- P(second is an ace | first is an ace) = 3/51.
Answer
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?
- Split by factory: 0.6 × 0.02 + 0.4 × 0.05.
- 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.
Example: A faulty part
A part from those factories is faulty. What is the probability it came from B?
- P(faulty | B) × P(B) = 0.05 × 0.4 = 0.02.
- 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?
- P(positive) = 0.95 × 0.01 + 0.1 × 0.99 = 0.1085.
- 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.
Roll one die. What is P(even or 5)?
Show answer
Draw 2 cards. What is P(both hearts)?
Show answer
P(A ∩ B) = 0.1 and P(B) = 0.4. What is P(A | B)?
Show answer
0.25
Toss 4 coins. What is P(exactly 2 heads)?
Show answer
P(B | A) = 0.8, P(A) = 0.25 and P(B) = 0.5. What is P(A | B)?
Show answer
0.4
In the medical test example, what is P(no condition | negative test)?
Show answer
About 0.999