Probability, Bayesian reasoning, and uncertainty / personal lessonsLesson 3 of 14
Probability · Lesson 3

Conditioning changes the denominator

Restrict the population before calculating the fraction.

By the end: Read joint and conditional probabilities from a table and avoid reversing a condition.

Read a two-way table

Suppose 200 items include 40 faulty items. A detector flags 30 faulty items and 20 sound items. A joint event asks for an item that is both faulty and flagged: 30 out of all 200. A conditional event asks for the chance of fault among flagged items: 30 out of the 50 flagged.

The vertical bar in P(A | B) means “A given B.” If B has positive probability, divide the probability of both A and B by the probability of B. The calculation restricts the possible outcomes to B and rescales their weights to total one. Conditioning on a probability-zero event needs methods beyond this elementary rule.

Restrict the outcomes before rescaling their weights

Treat the 200 items as a complete invented register, with each item equally likely to be selected. Every item has two labels, its actual state and its detector result. These labels divide the register into four groups that do not overlap. The thirty faulty flagged items belong to one group, not two separate groups. Adding all four counts recovers the register size. This partition lets us change the question without changing any item's labels or inventing a different dataset.

A joint probability keeps all 200 items available. The event 'faulty and flagged' selects thirty of them, giving 30/200 = 15%. Now suppose someone tells us that the selected item was flagged. The 150 unflagged items no longer qualify as possibilities. Fifty items remain, and thirty are faulty. Within this smaller population, fault therefore has probability 30/50 = 60%. The numerator stayed thirty, but the information changed which items belong in the denominator.

The word 'given' describes this restriction. It does not mean that the flag changed the item's physical state. Imagine covering the unflagged column of the register and drawing only from what remains. Before covering it, each item carried weight 1/200. The flagged group had total weight 50/200 = 25%. Dividing every retained weight by 0.25 makes the retained weights sum to one again. Each flagged item now carries conditional weight 1/50, while excluded items carry none.

The retained flag region becomes the whole denominator

All items: 200Faulty: 40Sound: 16030 flags20 flags in lower stripFlagged only: 50Faulty: 30/50 = 60%Sound: 40%Outline-only area:Excluded after the flag.
Upper rectangle: area represents all 200 equally weighted items. Faulty width is 20%; sound width is 80%. Filled heights are the state-specific flag rates, 75% and 12.5%. Filled areas therefore represent 30 faulty flags and 20 sound flags. The lower rectangle rescales only those 50 flags to total area one.

Equal item weights make counting convenient, but conditioning works with unequal weights too. Suppose four possible operating states have probabilities 0.10, 0.20, 0.30, and 0.40. We learn only that the state is either one or two, with no additional information distinguishing them. The retained probability is 0.30, not one half just because two of four labels remain. The first state's conditional probability becomes 0.10/0.30 = one third. The second becomes two thirds. Restriction preserves their original relative weights before rescaling the retained total to one.

This gives a useful check on a proposed calculation. The probability of a joint event cannot exceed the probability of either event separately, because its outcomes form a subset of each. Here 15% is below both the 20% faulty fraction and the 25% flagged fraction. A conditional probability has no such bound relative to the original fault probability. Sixty percent can exceed twenty percent because the two fractions describe different populations, rather than nested shares of the same denominator.

Try describing the restriction without numbers first. If the question says 'among flagged items,' point to the entire flagged column, including sound items. If it says 'among faulty items,' point to the faulty row, including missed items. Only then choose a numerator inside that group. This procedure also reveals an impossible request. If the register contained no flagged items, its flagged denominator would be zero. Dividing zero by zero would not define a conditional fault probability for that empty group.

Retained labels need not have equal weight

StateOriginal probabilityGiven state one or two
One0.100.10/0.30 = 1/3
Two0.200.20/0.30 = 2/3
Three0.30Excluded
Four0.40Excluded
Total retained0.301
The information is exactly that the state is one or two, not a diagnostic warning with unspecified likelihoods. Their original weights total 0.30. Divide each retained weight by 0.30; do not divide one equally between the two remaining labels.

The reverse question has a different denominator

The detector flags 30 of 40 faulty items, so P(flag | fault) is 75%. But 30 of 50 flagged items are faulty, so P(fault | flag) is 60%. These statements share a numerator, not a denominator. “Accurate” is too vague to distinguish them.

Multiplying P(fault) by P(flag | fault) gives the joint probability of fault and flag. This multiplication rule does not require independence. It follows directly by reversing the division in the conditional-probability definition.

Separate detector performance from evidence about an item

Start with a randomly selected item whose state has not yet been revealed. In this register, forty of 200 are faulty, so its fault probability is 20%. If the item produces a flag, the relevant fraction becomes thirty of fifty, or 60%. The flag supplies evidence about the state because flags are more common among faulty items than sound items. It does not supply certainty. Twenty sound items also produce flags, and excluding them would remove a genuine route to the observed result.

The detector's sensitivity asks a forward question. Hold the state fixed as faulty and ask how often a flag appears. Thirty of forty gives 75%. Holding the state fixed as sound instead gives twenty of 160, or 12.5%, for the false-positive rate. These are probabilities of results under specified states. For an observed flag, they are likelihoods under the two state hypotheses. Neither number alone is the posterior probability that the flagged item is faulty, which also depends on how common each state was beforehand.

Recover the table by multiplying along each route. The faulty route starts with probability 40/200 = 0.20. Of that group, 0.75 is flagged, giving 0.20 times 0.75 = 0.15 of the full population. The sound route starts with 0.80, of which 0.125 is flagged, giving 0.10. The routes are disjoint because an item cannot be both faulty and sound under these definitions. Add 0.15 and 0.10 to get the total flag probability, 0.25. Then 0.15/0.25 gives 0.60.

This multiplication is valid without assuming independence. The second factor explicitly says which first-stage group supplies its denominator. Replacing the 0.75 factor with the overall flag probability 0.25 would instead assert that fault and flag are independent. That would predict a joint probability of 0.20 times 0.25 = 0.05, contradicting the register's 0.15. The general multiplication rule uses a conditional probability. Independence is an extra model condition that sometimes allows replacing that conditional with an unconditional probability.

Both state branches can produce a flag

All items0.200.80FaultySoundFlag: 0.75Flag: 0.125Joint: 0.15Joint: 0.10Total flag probability:0.15 + 0.10 = 0.25Fault given flag:0.15/0.25 = 0.60
Branch paths are schematic, not scaled lengths. Multiply the initial state probability by its conditional flag probability, then add the two disjoint routes. The conditional factors differ from the overall flag probability.

Consider a second population with 800 items, only forty faulty. Keep sensitivity at 75% and the sound-item flag rate at 12.5%. The expected flagged counts are thirty faulty items and ninety-five sound items, since 760 times 0.125 = 95. Thus thirty of 125 flags come from faults, or 24%. These are expected frequencies under the stipulated rates, not promised counts in an actual batch. The detector's forward probabilities stayed fixed while the reverse probability fell because the population contains many more sound items.

Compare the two populations by asking which ingredient changed. The likelihood of a flag under fault did not change, nor did its likelihood under soundness. The prior fault fraction changed from 20% to 5%. Consequently, the same kind of observation leads to a different posterior. This comparison explains why a report of '75% sensitivity' cannot answer the question 'How likely is this flagged item to be faulty?' It identifies one branch of the calculation while leaving the other branch and the population mixture unspecified.

The same likelihoods yield different reverse probabilities

Quantity20% faulty population5% faulty population
All items200800
Faulty / sound40 / 16040 / 760
Faulty flags40 × 0.75 = 3040 × 0.75 = 30
Sound flags160 × 0.125 = 20760 × 0.125 = 95
Fault given flag30/50 = 60%30/125 = 24%
Both constructed populations use 75% sensitivity and a 12.5% sound-item flag rate. Counts in this comparison are model expectations. The prior mixture changes, not the conditional detector rates.

Work through the mechanism

Restrict to the flagged items
P(fault | flag)=3050=0.6

The numerator is both faulty and flagged. The denominator contains every flagged item, not every faulty item.

Actual stateFlaggedNot flaggedTotal
Faulty301040
Sound20140160
Total50150200
Invented counts. Read denominators from the relevant row, column, or full population.

Use margins to check what a conditional claim leaves unknown

The margins of a two-way table are its row and column totals. They summarize one label while ignoring the other. The faulty margin is forty, but it does not say how the detector divides those forty items. The flagged margin is fifty, but it does not say which states produced the flags. The interior cells connect the labels. Two tables can have the same margins and very different associations, so separate percentages cannot generally replace the missing joint information.

Keep the original margins and change only the overlap. A different detector could flag ten faulty and forty sound items, leaving thirty faulty and 120 sound items unflagged. It still flags fifty of 200 items, and the population still has forty faults. Now the faulty fraction among flags is 10/50 = 20%, equal to the population fraction. Its sensitivity is 10/40 = 25%, equal to its false-positive rate of 40/160 = 25%. In this constructed table, the flag supplies no evidence about state.

The original and altered tables therefore answer a question that the margins alone cannot answer. Does learning the result change the fault probability? Originally it changes from 20% to 60% after a flag. In the altered table it stays 20%. Both tables obey the same arithmetic rules, and both have the same totals. Choosing which table describes a real detector requires observations or a justified mechanism. Probability identities check internal consistency; they do not identify the correct interior counts from row and column totals alone.

Identical margins leave the overlap undetermined

Cell or summaryOriginal registerIndependent-label register
Faulty, flagged3010
Faulty, unflagged1030
Sound, flagged2040
Sound, unflagged140120
Faulty total / flagged total40 / 5040 / 50
Fault given flag60%20%
Flag given fault75%25%
Flag given sound12.5%25%
Each table describes 200 items with 40 faults and 50 flags. Only the original has a higher flag rate among faulty items. Changing the overlap while preserving the margins changes the information supplied by a flag.

There are also numerical limits on the possible overlap. It cannot exceed forty, since only forty faulty items exist, even though fifty flags exist. Zero overlap is possible here because the 160 sound items could supply all fifty flags. At zero overlap, none of the flags indicate fault. At overlap forty, every fault is flagged, but ten flags still come from sound items. The largest possible faulty fraction among flags with these margins is therefore 40/50 = 80%, not 100%.

For a guided comparison, keep a paper copy of the four-cell table and move five flags from sound items to faulty items. To preserve both margins, also move five unflagged labels from faulty items to sound items. Starting from the original table, the cells become thirty-five, five, fifteen, and 145. The fault fraction among flags becomes 35/50 = 70%, while sensitivity becomes 35/40 = 87.5%. The overall fault and flag fractions remain 20% and 25%. This is a comparison of tables, not a control available on the page.

Notice what is needed to interpret these changes. Actual state must come from a reference method that does not merely repeat the detector's label. If 'faulty' means 'the detector flagged it,' the table has defined away every false positive and missed fault. A useful evaluation instead measures a specified property, such as failure under a stated operating test. Imperfect reference measurements can themselves make the interior counts uncertain. More decimal places in a conditional fraction cannot resolve uncertainty about what the labels actually measure.

Fixed margins bound the possible reverse probability

QuantityNo overlapOriginal overlapLargest overlap
Faulty flags03040
Sound flags502010
Fault given flag0/50 = 0%30/50 = 60%40/50 = 80%
Faults outside flags40100
For 200 items, 40 faults, and 50 flags, the faulty flagged overlap can range from zero through forty. Each column is a different possible register, not an observation sequence. The total number of flags remains fifty.

Conditioning does not establish causation

A conditional association can arise from a shared cause or selective observation. People carrying umbrellas may be more likely to encounter rain; that does not mean carrying an umbrella causes rain. Rain forecasts affect both what people carry and which conditions they enter.

Ask how cases entered the table. A detector evaluated only on obvious failures and pristine controls may perform differently on ambiguous real inputs. Random sampling helps describe a target population. Random assignment of an intervention addresses a different question about causal effects.

Check how selection changes the population being described

A conditional fraction describes the population represented by its denominator. Suppose a detector evaluation deliberately recruits forty faulty items and 160 sound items. Its 20% fault fraction is then a design choice, not an estimate of fault prevalence on a production line. Sensitivity can still be calculated within the faulty group. But the 60% fault fraction among its flagged items describes that recruited mixture. Transferring it directly to a line with a different fault fraction would confuse an evaluation population with a deployment population.

Even forward rates can change when the recruited cases differ. A study might use severe faults that are easy to detect and sound items with unusually clean measurements. A production line may contain mild faults and noisy sound items. Conditioning on actual state does not guarantee that severity, age, or operating temperature has the same distribution in both settings. To transfer a rate, identify the conditions under which it was measured and whether the new population preserves the features that affect detection.

Selection can even create an association where none existed before selection. Imagine 100 applicants divided equally among four combinations of two skills, coding and drawing. Twenty-five have both, twenty-five only coding, twenty-five only drawing, and twenty-five neither. Each skill occurs in half the population, and half of coders can draw. Now admit everyone who has at least one skill. The selected group has seventy-five people because the twenty-five with neither skill are excluded. Nothing about anyone's skills has changed.

Among admitted applicants, fifty of seventy-five can draw, or two thirds. Among admitted coders, twenty-five of fifty can draw, or one half. Within the admitted group, learning that someone codes therefore lowers the probability that they draw. Noncoders can enter only by drawing, whereas coders need not draw to enter. The selection rule has produced dependence between the skills. This does not establish that learning coding reduces drawing ability. It describes which combinations survive the admission condition and acquire weight in the selected population.

Admission removes one combination, not one skill

CodesDoes not codeDrawsDoes notdraw25252525ExcludedAdmitted: 75Draws: 50/75Among coders:25/50 drawArea scale: each cell isone quarter of all applicants.
Each equal-area cell represents 25 of the original 100 applicants. Filled cells survive admission for at least one skill. Within the admitted L-shaped region, all 25 noncoders draw, but only 25 of 50 coders draw. Selection creates the conditional association without changing skills.

Random sampling and random assignment address different problems here. A random sample of admitted applicants can accurately describe admitted applicants, while still failing to describe everyone who applied. Random assignment would instead allocate an intervention, such as a coding course, by chance. It can support a comparison of outcomes under different assigned conditions when the design and follow-up are suitable. Sampling asks who represents a population. Assignment asks how the comparison groups received an intervention. Neither phrase is a substitute for specifying the population and causal question.

To audit a conditional claim, trace its denominator back through collection. Ask whether every flagged item was checked for actual fault, or only the most suspicious flags. Ask whether the register includes unflagged items at all. Checking only flags can estimate their fault fraction in the checked group, but cannot count missed faults elsewhere. Finally, keep the conclusion within its role. A fault posterior describes uncertainty about state. Evidence that a repair prevents damage and a comparison of repair losses require additional causal and decision information, not another rearrangement of the same table.

Exercises

Condition on the negative result

In the table, what fraction of unflagged items are faulty? What fraction of faulty items were missed?

Hint

Use the unflagged column for the first question and the faulty row for the second.

Worked answer
Probability, fixed 0–100% scaleFault given no flag6.67%No flag given fault25%
QuestionNumeratorDenominatorResult
Fault given no flag101506.67%
No flag given fault104025%
The same ten items participate in different conditional comparisons.

The unflagged group contains 150 items, ten faulty, so the first probability is 10/150 = 1/15, about 6.67%. Among the forty faulty items, ten were missed, so the second is 10/40 = 25%. Neither is the complement of the other.

Recover the joint probability

A factory has a 10% fault rate and flags 80% of faulty items. What fraction of all items are both faulty and flagged? Can you infer the fraction of flagged items that are faulty?

Hint

Multiply along the faulty branch, but do not invent the sound branch.

Worked answer
BranchFraction of all items
Faulty and flagged0.10 × 0.80 = 0.08
Sound and flagged0.90 × unknown
All flaggedSum of both branches
A missing denominator cannot be recovered from sensitivity alone.

The joint fraction is 0.10 × 0.80 = 0.08. The reverse conditional is not determined. We also need the false-positive rate among sound items to know the total flagged fraction.

Sources and further reading

The explanations and exercises are complete without these optional links. The references distinguish probability identities from inference procedures and reporting guidance. The examples are constructed teaching models, not empirical estimates or professional decision advice.