Use complements, intersections, and unions to describe events.
Calculate a conditional probability with the correct denominator.
Apply Bayes’ rule and distinguish independence from mutually exclusive events.
Start with an event
A probability describes an event within a specified random process or population model. In a quality-control example, D means “a randomly selected item is defective” and F means “the screening system flags the item.” Dᶜ is the complement: the item is sound. D ∩ F means both events occur; D ∪ F means at least one occurs.
Probabilities lie between zero and one. The complement rule gives P(Dᶜ) = 1 − P(D). The addition rule gives P(D ∪ F) = P(D) + P(F) − P(D ∩ F). The subtraction prevents flagged defective items from being counted twice.
The four combinations—defective and flagged, defective and clear, sound and flagged, sound and clear—are mutually exclusive and exhaustive. Their probabilities sum to one. Building this partition is often more useful than trying to select a formula from memory.
Look inside a flag
Change the defect rate and screening behavior. Watch the four possible outcomes and the share of flags that correspond to real defects.
Illustrative quality-control model. Bars show joint probabilities across all items; “defective among flagged” uses only flagged items as its denominator. Expected counts need not be whole numbers.
Defective among flagged
All items flagged
False flags per 10,000 items
Missed defects per 10,000 items
Of 10,000 modelled items, expect 180.0 true flags and 490.0 false flags. Dividing true flags by all flags gives 26.87%, not the detection rate 90.0%.
Read the chart summary
Among all items: defective and flagged 1.80%, sound and flagged 4.90%, defective and clear 0.20%, sound and clear 93.10%. Among flagged items, the defect probability is 26.87%.
Try this
Conditioning changes the denominator
The conditional probability P(D | F) asks about defects among flagged items. It uses only the flagged group as its denominator: P(D | F) = P(D ∩ F) / P(F), provided P(F) > 0. By contrast, P(F | D) asks how often the screen flags a defective item. The order matters.
Consider an illustrative population of 10,000 items with a 2% defect rate. There are 200 defective and 9,800 sound items. If the screen flags 90% of defective items and 5% of sound items, the expected counts are 180 true flags and 490 false flags. Thus 670 items are flagged, and the probability a flagged item is defective is 180 / 670 ≈ 26.87%.
The screen detects most defects, yet most flagged items in this example are sound. That result is consistent: the sound group starts much larger. The 90% detection rate answers a different conditional question.
Update with Bayes’ rule
Bayes’ rule combines the base rate with the signal: P(D | F) = P(F | D)P(D) / [P(F | D)P(D) + P(F | Dᶜ)P(Dᶜ)]. The numerator is the joint probability of a real defect and a flag. The denominator accounts for every way a flag can occur.
For the example, P(F) = 0.90 × 0.02 + 0.05 × 0.98 = 0.067. Dividing 0.018 by 0.067 gives 0.2687. The same calculation works with probabilities or expected counts because the population size cancels.
Now lower the defect rate to 1% while retaining the same screen. True flags become 90 per 10,000 and false flags become 495. The fraction defective among flags drops to 90 / 585 ≈ 15.38%. A screening system’s usefulness depends on the population in which it operates, not just its detection rate.
Independence is a distinct claim
Events D and F are independent when P(D ∩ F) = P(D)P(F). When the relevant denominators are positive, learning whether F occurred then leaves P(D) unchanged. In this example, equal flag rates for defective and sound items make the flag uninformative about defect status.
Mutually exclusive events cannot occur together. Two events with positive probabilities that are mutually exclusive are not independent: observing one rules out the other. “Different labels” and “unrelated in everyday language” are not mathematical tests of independence.
The explorer shows model-implied probabilities, not measured screen performance. Actual rates must be estimated from suitable data, may differ across products or operating conditions, and carry uncertainty. A decision to inspect or reject a flagged item also depends on costs and consequences; a conditional probability alone does not determine the best action.
Make the connection.
Try each question before revealing the solution.
01
Suppose P(A) = 0.40, P(B) = 0.30, and P(A ∩ B) = 0.12. Find P(A ∪ B) and determine whether A and B are independent.
Show the worked solution
P(A ∪ B) = 0.40 + 0.30 − 0.12 = 0.58. Since P(A)P(B) = 0.40 × 0.30 = 0.12 = P(A ∩ B), the two events are independent. They are not mutually exclusive because their intersection has positive probability.
02
With a 10% defect rate, a 90% flag rate for defects, and a 5% flag rate for sound items, what fraction of flagged items are defective?
Show the worked solution
The true-flag probability is 0.10 × 0.90 = 0.09, and the false-flag probability is 0.90 × 0.05 = 0.045. Therefore P(D | F) = 0.09 / (0.09 + 0.045) = 2/3, or about 66.67%. The denominator is the probability of any flag, not the probability of a defect.
03
A screen flags no items. Is the probability of a defect among flagged items zero?
Show the worked solution
No. If P(F) = 0, there is no flagged group on which to condition. P(D | F) is undefined in this elementary conditional-probability formula because its denominator is zero. The explorer reports “Undefined” rather than substituting a misleading percentage.
Assumptions, methods & references
The three input rates specify a probability model for a randomly selected item from one defined population. Rates are treated as known, not estimated.
Flags and defects need not be independent. The joint probabilities are constructed from the input conditional rates.
Expected counts are probabilities multiplied by 10,000; they are not simulated or observed counts.
When no items can be flagged, the conditional probability of a defect given a flag is undefined.