Let a discrete random variable have probability mass function . Given , return with probability ; otherwise draw from a conditional distribution with probability mass function . The law of total probability gives the displayed identity. Its total mass is . If the fallback is a discrete uniform distribution on , then , so the fallback sum includes .
Bayes' theorem Created 2026-09-24 Updated 2026-10-14
For a finite measurable partition with positive probabilities, and an event of positive probability,
Its beauty is that a model predicting observations from a hidden state can also describe uncertainty about the state after an observation. Each numerator is a joint probability; the denominator, supplied by the law of total probability, makes the answers sum to one. This is a direct consequence of conditional probability, rather than an extra axiom.
Select the coin from law of total probability once, then toss that same coin repeatedly, with conditionally independent tosses given its identity. Let denote the -head coin, initially of prior probability . After one head , its posterior probability is
The likelihood of a head is larger under , but remains less likely than the other coin because its prior probability was smaller. A large likelihood for an observation does not itself imply a large posterior probability for the hypothesis.
After an ordered sequence containing heads and tails, its likelihood ratio between the two coins is . Bayes' theorem therefore gives posterior odds
Each head multiplies the odds by and each tail by . Three heads give posterior probability , still below one half; four give , above one half. The finite-model update and the distinction between prior probability, likelihood and posterior probability are set out in MIT 18.05, Reading 11: Bayesian Updating with Discrete Priors.
Figure 1.
Updating uncertainty about one selected coin after repeated observations
. Details.
The hidden selection also creates dependence. Each toss has marginal head probability , but two heads have joint probability , greater than . Their indicator covariance is . Seeing a head makes the head-favoring coin more likely, so it also raises the chance of a future head. This is covariance induced by a shared latent variable, despite conditional independence of the tosses given the coin.
Historically, Thomas Bayes's essay on an unknown success probability appeared in 1763 after his death, communicated by Richard Price. Its opening problem asks how observed successes and failures constrain that unknown probability; Price's introductory letter explains the connection to reasoning from experience. That is a more substantial inference problem than simply rearranging today's elementary identity. [ref]
Conditional independence Created 2026-09-24 Updated 2026-10-14
Random variables and are conditionally independent given when, for every pair of Borel sets , the following identity holds almost surely:
Here conditional probabilities are conditional expectations of the corresponding indicator random variables given the sigma-algebra generated by . This defines the condition even when . In terms of regular conditional distributions, the conditional joint law is the product of the conditional marginal distributions for almost every conditioning value.
For discrete random variables, at every with , the condition becomes
Where , this is equivalent to . Once is known, observing provides no further information about .[ref]
For a worked example, suppose a latent variable chooses between two environments with . Given , take to be independent and identically distributed with a Bernoulli distribution of parameter , where and . Think of two separate trials run under the same quiet or active environment. Their conditional joint probability mass functions, with rows and columns , are
Each is exactly the product of its own conditional marginal distributions: for , and for . Thus are conditionally independent given .
If the environment is unobserved, the law of total probability averages the two tables:
Both unconditional marginal distributions are fair, but . The law of total expectation gives
Figure 1.
An unobserved shared environment creates statistical dependence between conditionally independent trials
. The first two tables show independent Bernoulli trials at conditional success probabilities and . Averaging them with equal weights gives the third table. The fourth table is the product of the resulting unconditional marginal distributions, which differs from the actual joint table. These are stipulated model probabilities, not observed frequencies. Details.
Observing makes the active environment more plausible, so it raises to . Knowing the actual environment removes this source of statistical dependence. The covariance induced by a shared latent variable lemma explains the calculation without listing all the outcomes.
This is why conditional independence is useful in statistical modelling: a model can multiply simple conditional laws and then average over a shared latent variable. The resulting observations can remain statistically dependent. Conditional independence graphs organize such information relations; their interpretation as causes requires additional assumptions from causal inference. Conditioning describes the information available to an observer. It does not, by itself, describe what would happen if an experimenter changed a variable.
A time-homogeneous Discrete-time Markov chain is a sequence of random variables indexed by nonnegative integers, with the displayed conditional probabilities. Here is its natural filtration and is a row-stochastic transition matrix. The Markov property removes dependence on earlier observations once is specified; the time-homogeneous Markov property makes independent of .
Consider states (sunny) and (rainy), with the constructed transition matrix
Rows give today's state and columns tomorrow's, in order . These numbers define an illustrative model, with one step interpreted as one day; they are not estimates of real weather. Let . The law of total probability gives the recurrence relation
Subtracting makes the deviation multiply by at each step. Thus
Starting sunny gives , , and ; starting rainy gives and . The two predictions approach the same stationary distribution while retaining a shrinking trace of the initial probability distribution.
Figure 1.
Constructed sunny/rainy transitions and the exact sunny probabilities from three initial distributions.
Details.
An expected hitting time answers a different question. Starting sunny, let . Every day before the first rain remains sunny, so
This geometric distribution has finite expected value. A first-step calculation gives , with , hence days. The same result follows from the geometric series . This is a mean waiting time, not a prediction that rain first occurs exactly five days later.
A probability row vector is a stationary distribution when . The Markov chain is reversible in that law when detailed balance holds: . Multiplying those equations along a finite path gives equal forward and reversed stationary path probabilities.
The 2013 selection rejected early boundary light. Tagged muons checked leakage; air shower companion muons also vetoed downward atmospheric neutrinos.[ref]
Figure 1.
Entering tracks, contained interactions and an accompanying-muon veto
. Original schematic, not to scale or measured data. Dots: optical modules. Dashed arrows: unseen neutrinos; solid arrows: muons. Details.
A simple original conditional probability model explains why a veto changes the selected mixture. Let mean that an atmospheric neutrino interaction would pass all other cuts, that an accompanying muon reaches the veto, and that the veto fires. Set and , and neglect unrelated veto hits. The law of total probability gives
For chosen and , the passing fraction is . Neither this value nor either input is an IceCube measurement. With equal incident candidate populations, this mechanism alone reduces the atmospheric contribution relative to a hypothetical population having . It does not make every surviving event astronomical: or gives no suppression, while removes the entire chosen atmospheric population. If unrelated light vetoes a surviving event independently with probability , its passing fraction becomes ; independence is an additional assumption.
Let for the input bit of a binary symmetric channel with crossover probability . The law of total probability gives
Consequently its mutual information is
Here specifies the noise and specifies the input bias; they are different choices. At and , the output has , giving and bits. With the same noise and the fair input , the output becomes fair and bits, attaining binary symmetric channel capacity.
Figure 1.
A fair input maximizes retained information through a binary symmetric channel
. The left panel holds the crossover probability fixed and varies . The right panel shows the output probability distributions for with input biases and . More output Shannon entropy helps here because the conditional noise information entropy stays fixed. Details.
For , binary entropy reaches one only at output mass , and the equation forces . Thus the maximizing input is unique in those cases. For , every input produces the same fair output and zero mutual information, so every input bias is optimal and none transmits information. A fixed input or also carries zero mutual information for every : noise can make its output unpredictable without creating an unknown message to recover.
Law of total probability Created 2026-09-24 Updated 2026-10-18
Let be a countable measurable partition of the sample space, with positive probabilities. For any event , the law of total probability gives
The pieces are disjoint events, so add their masses and use the definition of conditional probability. Zero-mass partition pieces can be omitted without changing the answer.
For the coin selection in probability, let mean the -head coin was selected and let mean the first toss was heads. Then . Each conditional answer describes one possible hidden situation; its weight describes how often that situation occurs under the model. This decomposition is useful whenever a simple conditional model sits behind a more complicated marginal probability distribution.
The law of total probability combines local conditional probabilities into one overall probability. The measurable partition must cover the sample space with pairwise disjoint events: every elementary outcome belongs to exactly one part. Its probabilities are the weights of a weighted mean, and they sum to one.[ref]
For an original constructed example, make a finite set of 1,000 items: 600 belong to and 400 to . Mark exactly 60 items in and 100 in , and let the event mean that the selected item is marked. Select an item using the uniform distribution on a finite set. These are prescribed counts, so the resulting probabilities are exact properties of this construction:
The conditional probability uses only the 600 items in as its denominator. The probability of the intersection uses all 1,000 items instead: . Similarly, . Adding the two disjoint events gives
Figure 1.
A partition turns within-group rates into whole-population areas
. An original constructed finite set with 1,000 items, represented by area rather than measured data. The two widths encode probabilities and ; the shaded heights encode conditional probabilities and . The shaded intersection areas encode 60 and 100 marked items, totaling 160. Details.
An unweighted arithmetic mean of the two conditional probabilities would give . That is the answer to a different selection rule: choose either group with probability , then select uniformly within that group. Here the first group contains more items, so selecting uniformly among all items gives it weight . In fact, if its weight were , the overall probability would be . Moving the weight from to lowers the result by , explaining exactly why is too large for the original model.
The same construction is a mixture distribution: first select a group with its mixture weight, then select an item within that group. Multiplying the weight by its conditional probability gives the probability of reaching through that group; adding the contributions gives the law of total probability. For example, an item in has selection probability , and an item in has selection probability , recovering the original uniform distribution on a finite set.
Figure 2.
Multiply along each route and add the routes ending in the event
. The original constructed model expressed through group selection and a marked-or-unmarked result. First-stage weights are probabilities; second-stage weights are conditional probabilities. The four final probabilities sum to one. The two routes to the event contribute . Details.
No assumption of independent events is needed. In this construction differs from , so and are not independent events. Also and are disjoint events with positive probabilities, so they cannot be independent events: their intersection has probability zero, whereas . The measurable partition supplies exclusive alternatives, not an independence assumption.
For a short proof, the intersection pieces have union and are pairwise disjoint events. Apply countable additivity, then substitute the definition of conditional probability on every positive-mass part:
A zero-probability event has . Omit it: writing would divide by zero. Countability ensures that the union of the omitted zero-probability events also has probability zero. Overlapping parts would double-count their intersections, and incomplete coverage would omit the probability of in the uncovered region.[ref]
Reversing the question gives one compact application of Bayes' theorem. Among the 160 marked items, 100 belong to , so its conditional probability after observing is
The law of total probability supplied the denominator by collecting every way that can occur. Its usefulness lies in choosing a measurable partition where the conditional probabilities are simple, then combining them without losing the relative sizes of the alternatives.
Generate a finite mixture model by drawing a categorical variable with , then drawing from the mixture component . The indicator random variables satisfy : exactly one mixture component generates each draw. The joint probability distribution obeys , and the law of total probability gives the mixture distribution after summing out .[ref]
For independent draws from this statistical model, draw a fresh for each . Drawing one shared latent variable for an entire collection is a different joint probability distribution: its individual marginal distributions can match the same mixture distribution while its observations are dependent.
Neutrino event classification model Created 2026-10-18 Updated 2026-10-20
How can the relative abundance of tracks and showers distinguish hypotheses? Consider an original teaching model, with chosen inputs throughout. Condition on a sample of selected events, each assigned exactly one of two labels: track or shower. Multitrack events and unclassified events lie outside this model. A shower label need not identify an electron; background can imitate it. Conversely, a true electron interaction need not receive a shower label.
Let be the background fraction among selected events. Among the selected signal events, let be the fraction whose associated charged lepton is an electron, with the remainder associated with a muon. These are fractions after event selection, rather than fractions of the incident neutrino particle flux. Define the conditional probabilities
Here and describe classification within the selected sample. They are not measured historical detection efficiencies. The law of total probability gives the overall shower probability
This formula is the bridge between an interaction hypothesis and a visible label. It keeps beam contamination, background and mistaken classification conceptually distinct: genuine electron neutrino interactions belong in , while non-signal events belong in .
Assume independent random variables for the event labels, all with this same . If counts shower labels, every specified pattern with showers has probability . Counting those patterns with a binomial coefficient yields the binomial distribution
The track count is , so its expected value is . At fixed , the two counts cannot fluctuate independently. The variance above measures sampling fluctuations under the stipulated model, not uncertainty in , , or .
Choose , , , and . Compare a signal with only muon-associated interactions () against one with equal selected electron- and muon-associated interactions (). These give and , respectively. Their expected shower counts are and ; their expected track counts are and . A background-only model with the specified gives showers and tracks on average. These are expectations, so they need not be integers.
Figure 1.
Chosen binomial distribution model: expected track and shower counts, with the shower-count distributions
. Original calculations for forty selected events and the stipulated classification and background probabilities. No historical counts, fitted efficiencies or reconstructed significance are plotted. Details.
For a hypothetical observation , the likelihood ratio of the two signal models is
The binomial coefficient cancels because the same hypothetical sample is used in both likelihoods. This ratio is not the probability that either hypothesis is true. A separate original check gives , and for the muon-associated, equal-mixture and specified background-only models, respectively.
Why are the controls essential? If the background-only model may choose any , taking can fit the observed shower fraction. Counts alone then fail to distinguish it from a signal model. Independent background measurements and calibrated particle identification constrain that freedom. Changing the decay path additionally tests where the candidate-producing particles originate. The power of the experiment comes from combining apparatus interventions with event classification; the small binomial distribution model isolates only the latter part of that reasoning.
A family of disjoint events whose union is the sample space. For the countable law of total probability and law of total expectation, use a finite or countably infinite family. Conditioning formulas sum only positive-probability parts, or interpret zero-probability contributions as zero without assigning a conditional expectation there.
Let and . The first basic measurement has outcome probabilities and , obtained by conjugating the amplitudes in the bras. Conditional on its first outcome, the next computational-basis measurement returns 0 with probability ; conditional on its second outcome, that probability is . The law of total probability therefore gives
Consequently the minimum is , attained exactly when . The relative complex phases do not affect this result. The alternatives after the first measurement form a classical mixture; their amplitudes must not be added coherently as if no measurement occurred.
The White stratum retains the overall distrust–lower-efficacy pattern, the Asian stratum shows a stronger but irregular version of it, and the Black stratum has an opposite descriptive ordinal direction. This supports replication in the dominant stratum together with possible specification by ethnicity in the elaboration model. Sparse minority tables and different significance labels do not by themselves establish a population statistical interaction.
Each table fixes ethnicity and compares the efficacy conditional distributions across technology responses. The body percentages use the technology-response row total within that stratum. The same labels, coding direction and efficacy order apply as before. The strata contain 77, 57 and 2332 observations; they sum to 2466 and their cells reproduce the overall table exactly. Consequently the comparison is genuinely a stratification of the supplied overall counts, rather than a comparison of unrelated samples.
For Asian respondents, High efficacy is 78.95% among those who strongly disagree with the distrust statement, falling to 23.81% among those who disagree, 18.75% among neutral respondents and 19.05% among those who agree. The strong-disagreement versus agreement contrast is about 59.90 percentage points, based on 15 of 19 versus 4 of 21 respondents. This is a large descriptive contrast, but the rest of the table is not a simple monotone progression: Low efficacy peaks at 47.62% in Disagree, versus 10.53% in Strongly disagree, 18.75% in Neutral and 23.81% in Agree; Medium efficacy exceeds 57% in the last two rows. The striking first row is part of a more irregular categorical pattern.
The Asian Pearson chi-squared test of independence gives , 6 statistical degrees of freedom, . The likelihood-ratio test gives , ; its displayed 0.000 is a rounding convention. Cramér's V is about 0.430, compared with 0.148 overall. The generalized phi coefficient is 0.608 and the contingency coefficient 0.519. Two of twelve expected frequencies are below five, with minimum 4.156. This is a modest sparse-cell warning rather than a reason to delete the observed cells, but asymptotic calibration should still be qualified and could be checked by an exact or fixed-margin Monte Carlo test.
The Asian Goodman and Kruskal's gamma is about 0.323, from 1025 concordances and 524 discordances, so its displayed-order direction agrees with the overall association. Somers' D for efficacy given technology is about 0.226, Kendall's tau-b 0.241 and Stuart's tau-c 0.253. These stronger ordinal summaries do not imply that every individual row transition is monotone. Goodman and Kruskal's lambda is about 0.362 for predicting efficacy from technology and 0.286 in the reverse direction: the technology row changes the modal efficacy prediction sufficiently to reduce its errors by about 36.2%. This is a reduction in modal-classification errors, not a fraction of efficacy variance explained.
For Black respondents, High efficacy is 0 of 6, or 0%, in Strongly disagree; 8 of 24, or 33.33%, in Disagree; 2 of 15, or 13.33%, in Neutral; and 7 of 12, or 58.33%, in Agree. Low efficacy is 16.67%, 25.00%, 20.00% and 8.33%, respectively. The strongest-disagreement versus agreement High-efficacy contrast is therefore percentage points, opposite to the Asian and White contrasts. The zero observed High count in the first row does not prove zero population probability, especially with only six respondents in that row. These percentages are compatible with a reversed tendency, but considerable sampling uncertainty is unavoidable.
The Black Pearson chi-squared test of independence gives , 6 statistical degrees of freedom and . The likelihood-ratio test gives , , also above 5%. Thus neither nominal test rejects at 5%; this does not establish exact independence. Eight of twelve expected frequencies are below five, with minimum about 1.158, making the usual large-sample calibration particularly questionable. An exact conditional analysis or Monte Carlo test would be more defensible for a calibrated inferential claim; no uncomputed simulated p-value is asserted.[ref]
The Black Cramér's V is about 0.308, the generalized phi coefficient 0.435 and the contingency coefficient 0.399. An unsigned magnitude of this size can coexist with a nonsignificant test in a small sample. There are 254 concordances and 457 discordances, giving Goodman and Kruskal's gamma about , Somers' D about , Kendall's tau-b about and Stuart's tau-c about . Their negative signs agree with the reversed displayed-order direction. Goodman and Kruskal's lambda is about 0.107 for efficacy given technology and zero for technology given efficacy. In the latter direction, Disagree remains a modal technology category within every efficacy column, so modal prediction gains nothing despite the changed conditional percentages.
For White respondents, High efficacy decreases from 48.55% in Strongly disagree through 43.10% and 32.03% to 27.45% in Agree. The extreme-row contrast is about 21.11 percentage points, from 151 of 311 versus 188 of 685. Low efficacy is 21.22%, 17.10%, 21.57% and 35.04%, respectively. This closely resembles the overall distribution, including the fact that the Low category is not monotone at every step. The White Pearson chi-squared test of independence gives , 6 statistical degrees of freedom and ; the likelihood-ratio test gives , . All expected frequencies exceed 74, so sparse cells are not the problem for these nominal tests.
The White Cramér's V is about 0.152, the generalized phi coefficient 0.215 and the contingency coefficient 0.210. Goodman and Kruskal's gamma is about 0.236, Somers' D 0.155, Kendall's tau-b 0.162 and Stuart's tau-c 0.167: close to the overall ordinal summaries and in the same direction. The two values of Goodman and Kruskal's lambda are about 0.061 for efficacy given technology and 0.062 for technology given efficacy. They again indicate only a small improvement in modal prediction. The large sample size helps explain why the White test has a much smaller p-value than the smaller strata, without implying that its association magnitude is the largest.
The original figure below plots selected empirical conditional probabilities from all the cells. It gives the opposite small-stratum pattern and the dominant White pattern a common scale; it is not a reproduction of a source figure, an estimated continuous trend or a display of uncertainty intervals.
Figure 1.
Efficacy distributions across technology-distrust responses: contrasting ethnic strata and the pooled sample. Lines only connect the four ordered categories; group sizes and sparse cells limit inference.
Details.
The elaboration model asks how the original association changes when a third variable is held fixed. If the association disappeared throughout the strata, an explanation by the control variable might be plausible, subject to a credible causal ordering. Here it persists in the White group, which supplies 94.57% of the sample, and is stronger on several descriptive measures in the Asian group. Therefore ethnicity does not simply explain away the relationship. The White result is a replication of the broad pattern; the reversed Black direction and the Asian shape suggest descriptive specification or possible effect modification. The output supplies no temporal or causal design that would distinguish an actual causal mechanism from other confounding, measurement differences or sampling variation. It also does not demonstrate a Simpson's paradox in which the association reverses in every stratum: that is not what the displayed tables show.
The predominance of White respondents explains why the pooled pattern resembles theirs. By the law of total probability, each technology row's efficacy distribution is a mixture over ethnicity, using the ethnic proportions within that technology row. Those weights need not equal the overall ethnic proportions. As an optional descriptive comparison, standardization with common weights using the overall ethnic shares gives High-efficacy proportions of about 48.38% in Strongly disagree and 27.90% in Agree, a 20.48-percentage point contrast, compared with the crude 21.69-point contrast. This explicitly defined adjustment leaves the broad contrast intact; it is not a causal estimate and does not turn the three different stratum patterns into one common effect.
Finally, a significant test in one group and a nonsignificant test in another is not itself a test that the groups' associations differ. A formal statistical interaction requires a directly specified heterogeneity test or model on a chosen effect scale. The omnibus tests also address whole categorical distributions, whereas gamma and the High-efficacy contrast describe particular ordered features. Multiple stratum tests create a multiple testing issue if used to select a discovery. The defensible result is an association that survives stratification in the dominant group, with important descriptive heterogeneity that merits a direct, sparse-cell-aware investigation rather than an assertion that ethnicity causes the difference.
Use the equally likely release prior, and write for the probability that the guard names B when A is released. If B is released the guard cannot name B; if C is released the guard must name B. The law of total probability therefore gives
A remains jailed and B is named precisely when C is released. Its probability is , so the conditional probability is
In (a) unbiased naming has , giving : the guard's claim is false and A's chances have not improved. In (b) preferentially naming B has , giving : that naming rule makes the claim correct. In (c) preferentially naming C has , giving : naming B then reveals that C is the released person, so A certainly remains.
This is the three prisoners problem. The observed name includes information about how the guard selects a name; it is not merely the event that B remains. With general release priors , the same calculation gives , making explicit where the equal-prior convention enters.
For , the conditional probability is . Since the events partition the sample space, their intersections with are disjoint and exhaust . The law of total probability therefore gives . Substituting this and into the definition proves Bayes' theorem:
The denominator is positive by the given hypothesis on .
Every urn contains balls. Let be its number of blue balls; choosing an urn uniformly makes uniform on . Conditional on that urn, the probability of a blue first draw is , so the law of total probability gives
Drawing twice without replacement requires . Given , the probability that both draws are blue is , and hence
Taking the ratio defining conditional probability gives the second requested probability
Although a blue first draw removes a blue ball from its urn, it also makes an urn rich in blue balls more likely. Averaging with this changed conditional distribution is essential.
Condition on the claim count. The empty random sum of independent claims is zero, and independence gives . Therefore the random-sum transform identity is
wherever the composition is finite. This follows directly from the law of total expectation, rather than replacing the random count by its mean.
Put . For the specified negative binomial distribution, the negative binomial series gives . A rate- exponential distribution has moment-generating function . Hence
The last expression is exactly the moment-generating function of a compound binomial distribution with independent count and severities
The moment-generating function exists in a neighborhood of zero, so its uniqueness identifies the distributions. In particular, the new claim sizes have mean , not , and both aggregate distributions have an atom at zero. This is the negative-binomial sum of exponential claims representation with the severity rate explicitly retained.
Conditional on , the aggregate has Erlang distribution with density on . Repeated integration by parts of its tail gives
Indeed, after substituting , the integral reduces recursively to the corresponding integral with exponent , terminating at . Applying the law of total probability yields the original infinite mixture distribution tail
Applying the same argument to the compound binomial distribution gives instead the finite Erlang-mixture tail for a negative-binomial exponential aggregate:
The two tails are equal. The binomial representation replaces an infinite sum by a finite exact calculation, eliminating the need to choose a claim-count truncation and control its omitted tail. The inner sums can be evaluated recursively, using for their exponential-weighted terms.
Use the intended model of independent random variables with exponential distributions of rates . For , independence gives the survival function
Thus
The variance is , obtained from the standard first two exponential moments, and .
For these competing exponential clocks, ties have probability zero. Integrating over Alice's firing time gives
Let denote the event that the next shot hits, and use the stated success probability as . Bill's corresponding conditional success probability is one. The law of total probability gives
The Bayes' theorem therefore yields
The printed assumptions specify the two marginal exponential distributions but do not explicitly specify their independence. The answers above require that extra assumption; marginals alone do not determine the race. For a concrete counterexample, take one and set , . These have the required marginals, but ; if , Alice always fires first and . Thus the independence qualification changes actual answers, rather than merely their derivation.
Treat as the entire phase-known genotype of individual at the genetic loci being studied, and let denote the nonfounders. Assume unrelated pedigree founders have independent genotype priors, each nonfounder's genotype depends only on its parents' genotypes, and the observed phenotypes are conditionally independent given the genotypes. These are the standard assumptions behind the pedigree likelihood; shared environmental effects or related pedigree founders would require additional factors.
The directed ancestry graph is acyclic, even when there is inbreeding. Order individuals with parents preceding offspring and apply the chain rule for probabilities. The parental conditional independence assumption gives
Conditional phenotype independence gives . Multiplying these two expressions and summing over every possible latent genotype configuration proves
This is the law of total probability, not a claim that relatives have independent unconditional genotypes.
There are two disjoint ways to make an error: an individual from class one falls outside , or an individual from class two falls inside . The law of total probability gives
Since integrates to one, this also equals
This form isolates the only term changed by choosing the decision region.
The law of total probability and the definition of conditional probability give Bayes' theorem:
The denominator is positive because .
For the observed cargo, set , , . The binomial likelihood under origin is
Equal prior probabilities and Bayes' theorem make the posterior proportional to these likelihoods. The binomial coefficient cancels in the likelihood ratios:
Thus and , giving
Even the permitted approximation gives log ratios about and , which already show overwhelming posterior preference for B. The exact logarithms are preferable because multiplication by magnifies the approximation error. An observed contamination fraction halfway between two hypothesized rates does not give equal likelihoods: the binomial distribution assigns asymmetric probabilities to those deviations, especially at this large sample size.