Conditional Probability
What is it and why does it matter?
Imagine: you roll a die and your friend tells you "it's even". Now the probability of getting a 6 isn't anymore, because you know it's definitely 2, 4, or 6. Three options left, and 6 is one of them. So the probability = .
That is exactly what conditional probability measures: the probability of an event when we already know something about the situation.
On EPM, you'll recognize these problems by phrases like:
- "Given that..."
- "If it is known that..."
- "Among those who..."
The Formula and What It Means
Read as: "probability of B given A".
Why does the formula look like this?
Once we learn that happened, the rest of the world doesn't matter anymore. Circle becomes our new "universe". And we ask: what fraction of this new universe is also ?
- Numerator : what we're looking for (both and together)
- Denominator : our new "universe"
Essentially, we're dividing "what we want" by "everything that's left".
Multiplication Rule for Dependent Events
From the conditional probability formula, an important rule follows:
This is the multiplication rule for dependent events. It allows us to find the probability that both events occur when the second depends on the first.
Example: From an urn with 5 white and 3 black balls, we draw 2 balls without replacement. What's the probability both are white?
- (4 white remain out of 7)
Addition Rule for Unions (Additionssatz)
The multiplication rule answers the question about , that is, about both events happening together. The second question is : at least one of the two happens. The task text writes this as „oder“ (or), and that „oder“ explicitly includes the case where both are true.
The subtraction at the end is what the formula is really about. Adding and alone counts every case belonging to both events twice: once in and again in . One of those two counts is one too many, so is taken off again exactly once.
Mutually Exclusive Events
If and cannot happen at the same time, then and therefore . The subtraction drops out and the formula shortens:
The Union in the Table
In a four-field table, covers three of the four inner fields. The only field left outside is the one where neither nor happens:
| Total | |||
|---|---|---|---|
That gives a second route which needs no subtraction and works well as a check:
The table may also have more than two columns, three sectors or three device types for instance. This changes nothing about the addition rule; only the number of fields and the number of terms in the marginal sums grow.
Example: Stadium Sectors
A stadium has 30,000 seats in sectors , and . 23,100 spectators hold Austrian citizenship, the rest are guests from abroad. Filled in, the table looks like this:
| Sector | Sector | Sector | Total | |
|---|---|---|---|---|
| 11,400 | 8,100 | 3,600 | 23,100 | |
| 600 | 900 | 5,400 | 6,900 | |
| Total | 12,000 | 9,000 | 9,000 | 30,000 |
stands for "the person holds Austrian citizenship", for "the person does not hold it", and , and stand for the sector the person is sitting in.
: Nobody sits in two sectors at once, so and the subtraction falls away.
: Here the events do overlap, because 5,400 guests from abroad sit in sector . Those people sit inside and inside alike.
Without the subtraction the answer would read . Checking it through the fields: sector holds people, and outside another guests are added, giving out of , which is again.
The same table gets asked about in two ways. Some of the questions are spelled out in German („eine Person ist Gast aus dem Ausland und sitzt nicht im Sektor C“, a person is a guest from abroad and does not sit in sector C), the others are in pure symbolic notation such as , or . Both mean the same thing: the sentence above is . Here „und“ stands for , „oder“ for , „nicht“ for the overbar and „unter denen, die ...“ for the vertical bar.
Examples
Example 1: Dice
Rolled a die. Given that it's even, what's the probability it's a 6?
Breaking it down:
- = even = 6: our condition, our new "universe"
- = six = 6: what we're looking for
- = 6: the intersection (a six that's also even, which is just six)
Calculating:
Or simpler: out of three even numbers (2, 4, 6), one works (6). Answer: .
Example 2: Cards
Drew a card from a deck (52 cards). Given that it's red, what's the probability it's an ace?
Breaking it down:
- Red cards: 26 (hearts + diamonds)
- Aces: 4 (one in each suit)
- Red aces: 2 (ace of hearts and ace of diamonds)
Calculating: Out of 26 red cards, 2 are aces. So:
Law of Total Probability
Sometimes we need to calculate the overall probability of an event, knowing probabilities in different groups.
Example: Three Machines
A workshop has three machines:
- First produces 50% of all parts, defect rate: 2%
- Second produces 30% of all parts, defect rate: 3%
- Third produces 20% of all parts, defect rate: 4%
What's the probability that a random part is defective?
| Machine | Share of parts | Defect rate |
|---|---|---|
| Machine 1 | 50% | 2% |
| Machine 2 | 30% | 3% |
| Machine 3 | 20% | 4% |
The logic: A defective part could come from any machine. We calculate each one's contribution:
- From machine 1: (half of parts, 2% defective)
- From machine 2: (a third of parts, 3% defective)
- From machine 3: (a fifth of parts, 4% defective)
Add them up:
This is the law of total probability:
where mean "part came from machine 1, 2, 3".
General Formula
where is a complete set of mutually exclusive hypotheses (their probabilities sum to 1).
Bayes' Formula: "Flipping" the Condition
Now an interesting question: a part turned out defective. Which machine did it most likely come from?
We know = 2%: the probability of a defect given the part is from machine 1.
But we need : the probability of machine 1 given the part is defective.
This is the "reverse" problem, solved by Bayes' formula:
Plugging in:
So about 37% of defective parts come from machine 1.
Why does this work? Bayes' formula answers: "What share of all defects comes from machine 1?". The numerator is machine 1's contribution to total defects. The denominator is total defects. Divide the two and the share falls out.
General Bayes' Formula
Remember the order:
- Numerator: P(hypothesis) × P(event | hypothesis)
- Denominator: P(event), calculated via the law of total probability
Example: Medical Test
A rare disease affects 1% of the population. A test exists:
- If a person is sick, the test shows "+" in 95% of cases (sensitivity)
- If a person is healthy, the test falsely shows "+" in 2% of cases (false positives)
The test showed "+". What's the probability you're actually sick?
Intuitive (wrong) answer: "Since the test is positive and its accuracy is 95%, the probability of disease is about 95%."
This is a trap! Let's apply Bayes' theorem.
Given:
- (1% of population)
Step 1. Find P(+) using the Law of Total Probability:
Step 2. Apply Bayes' theorem:
Answer: ~32%, not 95%!
Intuition: The disease is rare (only 1% are sick). Among all positive tests, most are false positives from healthy people (who make up 99%). Bayes' theorem accounts for the "base rate" of the event.
Independence of Events
Events and are independent if knowing about one doesn't change the probability of the other:
This is equivalent to:
Example
, ,
Check:
Matches ! So the events are independent.
Common Confusion
Mutually exclusive ≠ Independent!
- Mutually exclusive: can't happen together (). Example: rolled 3 and rolled even (mutually exclusive).
- Independent: don't affect each other. Example: result of first roll and second roll (independent).
Mutually exclusive events are actually maximally dependent: if one happened, the other definitely didn't!
Common Mistakes
Mistake 1: Confusing the condition and event
is NOT the same as .
First: "among the sick, what fraction is vaccinated". Second: "among the vaccinated, what fraction is sick".
Mistake 2: Wrong denominator
In the denominator is the condition (what comes after the vertical bar).
: divide by number of reds, NOT aces.
Mistake 3: Confusing P(A|B) and P(B|A)
✗ Wrong:
✓ Correct: These are completely different values!
- : test sensitivity
- : actual probability of disease
Bayes' formula specifically relates these quantities.
Mistake 4: Computing „oder“ without the subtraction
Before working out a union, check whether a single case can belong to both events. The example above puts the two possibilities side by side: two sectors exclude each other, „Sektor “ and „Gast aus dem Ausland“ do not.
Practice with Tables
Many conditional probability problems are conveniently solved using contingency tables (Vierfeldertafel). This method allows you to work with concrete numbers instead of abstract probabilities.
For more on working with tables, see the topic "Vierfeldertafel".
Check Your Understanding
Your turn1 of 2
Two events satisfy , and . Which statement about and is true?
Your turn2 of 2
A box holds 4 red and 6 blue pens. Two pens are drawn one after the other without replacement. Which expression gives the probability of drawing one red and one blue pen?
Formulas
Conditional probability:
Multiplication rule:
Addition rule:
Total probability:
Bayes' formula:
Independence:
Was this article helpful?