The learning goal
Read the condition to the right of the vertical bar first. Keep only that group, then count the target within it. P(flagged|spam) divides by all spam messages; P(spam|flagged) divides by all flagged messages. A shared numerator does not make the denominators interchangeable.
Translate “given” into a selection
The OpenStax contingency-table section explains calculating conditional probabilities from the group selected by the condition. We use an original fictional email exercise, rather than the textbook’s examples or measured filter performance. Select the relevant population before counting the target. If that conditional group is empty, this count ratio cannot be calculated.
Underline “given” or “among” and ask, “Which messages am I looking at now?” Answer in ordinary language before choosing a percentage. Two fractions can share the same intersection count while referring to different selected groups.
Complete case: four cells for 100 fictional emails
Assume every practice message has a known actual category and flag state and belongs in one cell only. There are twenty spam messages: eighteen flagged and two unflagged. There are eighty normal messages: eight flagged and seventy-two unflagged. These are deliberately constructed teaching counts, not test results.
Check the table first. The rows total 20 and 80; the columns total 26 and 74. Both directions sum to 100. If the margins disagree, repair the input before calculating probabilities.
| Actual category | Flagged | Unflagged | Row total |
|---|---|---|---|
| Spam | 18 | 2 | 20 |
| Normal | 8 | 72 | 80 |
| Column total | 26 | 74 | 100 |
One numerator, two different questions
Question one asks for the flagged proportion given spam. Select the spam row: its denominator is twenty and eighteen are flagged, giving 18/20=90%. That describes the spam group; it does not describe the contents of the flagged folder.
Question two asks for the spam proportion given flagged. Select that column: its denominator is twenty-six, with eighteen actual spam messages. Thus 18/26≈69.2%, rounded to one decimal place. The remaining 8/26≈30.8% are normal messages; the two rounded shares total approximately one hundred percent.
Write the selection before the fraction
Use the 90% figure to say that 90% of flagged messages are spam.
Look only at the 26 flagged messages; 18 are spam, so P(spam|flagged)=18/26≈69.2%.
| Question | Selected group | Target count | Calculation |
|---|---|---|---|
| P(flagged|spam) | 20 spam messages | 18 flagged | 18/20=90% |
| P(spam|flagged) | 26 flagged messages | 18 actual spam | 18/26≈69.2% |
Explain the denominator without terminology
Hide the table and read question two. Say, “I opened the flagged folder, so I am considering twenty-six messages,” then explain where eighteen comes from. Recalling 69.2% without explaining twenty-six is answer memory rather than a selection rule. The worked-example self-explanation workflow helps attach a reason to each step.
Now ask what proportion of all messages are both spam and flagged. No conditional row or column is selected: the denominator is one hundred, giving eighteen percent. This distinguishes an intersection in the whole collection from a conditional proportion.
Three questions select three populations
Among spam
Select twenty actual spam messages, then count the eighteen flagged.
Among flagged
Select twenty-six flagged messages, then count the eighteen actual spam.
Among all messages
Keep all one hundred and count eighteen satisfying both properties.
Reverse the unflagged questions too
Among unflagged messages, the normal proportion is 72/74≈97.3%. Reverse it to ask for the unflagged proportion among normal messages: the denominator becomes eighty and 72/80=90%. The shared numerator seventy-two still does not justify a shared denominator.
Complete the condition, selected group, target count and fraction before checking the answer. Record a specific error such as “used the normal row total eighty instead of the unflagged column total seventy-four.” On revision, change question order and explain the selection again instead of repeating remembered numbers.
Input: spam and flagged 18; spam and unflagged 2; normal and flagged 8; normal and unflagged 72.
For each question, state the conditional group and denominator before calculating:
1. Flagged given spam.
2. Actual spam given flagged.
3. Normal given unflagged.
4. Unflagged given normal.
Explain why questions 1 and 2 cannot exchange their conditions.Accept understanding and limit the claim
The four denominators should be 20, 26, 74 and 80, yielding 90%, about 69.2%, about 97.3% and 90%. Explain which group each question selects. A correct decimal with an incorrect interpretation still needs practice. The weighted-average contribution exercise develops a related habit: establish the population before performing arithmetic.
This practice table cannot establish a product’s accuracy or predict future email behavior. Real evaluation needs a defined source, sampling method and scope. The learning goal is choosing a denominator under a stated condition, rather than using invented percentages as performance evidence.
Acceptance without the answer key
- Reconcile all four cells and margins to one hundred.
- State the selected group before numerator and denominator.
- Explain why 90% and about 69.2% are compatible.
- Complete both reverse questions about unflagged messages.
- Identify the numbers as fictional teaching data.
Common questions
Must P(A|B) and P(B|A) differ?
No. They can happen to be equal, but that does not authorize exchanging conditions. Identify each conditional population and intersection separately.
Why not divide the second question by one hundred?
It is limited to the twenty-six flagged messages, eighteen of which are spam. Dividing by one hundred answers an intersection question about the entire collection.
Can an empty conditional group be reported as zero percent?
Not from this count formula. Its denominator would be zero, so mark the conditional proportion as undefined for that group instead of inventing a probability.


