Tail-sum formula Created 2026-09-24 Updated 2026-10-18
The tail-sum formula expresses an expected value as the area under a survival function. For every nonnegative random variable ,
This Lebesgue integral and the expected value may both be ; a probability density function is unnecessary. For a random variable taking values in the nonnegative integers, the corresponding sum is
The events and coincide because takes integer values. Thus the strict sum starts at zero, while the inclusive sum starts at one.[ref]
For an original example, let the probability mass function of be
Its expected value computed directly is . The strict tail probabilities at thresholds are : their sum is again . There is no probability mass at two, yet the event still has probability . The survival function has heights on the successive intervals ; each interval has length one, so its integral is the same sum.
Figure 1.
The same expected value from probability masses and survival columns
. The exact constructed probability mass function assigns to . The contribution appears in one survival column, while the contribution appears in three. Filled endpoints give the strict survival function at its jumps; open endpoints show the preceding height. The shaded area is . Details.
The indexing matters numerically. Starting the inclusive sum at zero adds , giving for this example. Starting the strict sum at one omits , giving . For a general nonnegative random variable, replacing with inside the integral is harmless: the difference is , nonzero at only a countable set of thresholds. For each positive integer , at most thresholds can have probability mass at least ; their countable union contains all thresholds with positive probability mass and has Lebesgue measure zero. This reasoning concerns an integral, not equality of the two survival function conventions at every point.
For a continuous original example, take the uniform distribution on the interval . Its survival function is for and zero for . The area is a triangle of base four and height one:
Directly integrating against the probability density function gives the same expected value, . The integral of the probability density function alone is one; it is the survival function whose area is the expected value.
Figure 2.
A uniform density has total probability one and survival area two
. Exact curves for the uniform distribution on . The probability density function has integral one, while the survival function has integral two. Splitting the survival area at gives before the cap and beyond it, the expected values of and the positive part , respectively. Details.
The proof counts layers of each outcome. For a realized value , the indicator function equals one over an interval of length , so
Tonelli theorem permits the interchange because the indicator function is nonnegative; no finite expected value is assumed. Similarly, an outcome contributes one indicator random variable for each of the events that occur:
Again Tonelli theorem applies to the nonnegative sum, or equivalently the monotone convergence theorem applies to its partial sums. This exchanges counting layers within each outcome with averaging across outcomes. The existing integer-valued hypothesis in the tail-sum formula explains what changes when the values are not integers; the tail integral formula for moments weights the layers to obtain higher moments.
For an integrable random variable that can have either sign, apply the nonnegative formula separately to its positive part and negative part :
Integrability makes both integrals finite. More generally the difference defines an extended expected value when at least one is finite; if both are infinite, subtraction does not define an expected value.[ref]
Tail probabilities are often easier to measure or bound than a whole probability density function. For a device's survival time, the survival function records the probability of still operating at each threshold; its integral gives the mean operating time. A finite observation window naturally gives the expected value of a capped nonnegative random variable. For a mathematical bound, for all implies . The tail-sum formula turns control of a whole family of events into control of an average.
Total variation distance Created 2026-09-24 Updated 2026-10-13
Total variation distance asks how much two probability distributions can disagree about the same event. For probability measures on one measurable space , its definition is
The supremum ranges over all measurable sets, so guarantees that every yes-or-no prediction has probability error at most . This metric takes values between zero and one; it is zero exactly when the two probability measures agree. This makes it useful for comparing a sampling algorithm's output with its target probability distribution, and for defining the mixing time of a Markov chain.
On a finite set, add the excess probability mass wherever exceeds . That excess is also half the sum of all absolute differences:
The last expression reveals the common probability mass that the two probability distributions can share.[ref] The coupling characterization of total variation distance turns this overlap into an actual joint construction; minimum sum of errors in a simple hypothesis test gives it a statistical interpretation. One quantity connects probability bookkeeping, comparison of sampling methods, and the limits of a statistical test.
Suppose one observation comes from either or , each with prior probability . A decision rule that chooses on an event and otherwise has success probability
On a finite set, choosing therefore gives . This is the equal-prior version of minimum sum of errors in a simple hypothesis test; allowing a statistical test to use an auxiliary random variable cannot improve it, because for each outcome the better of the two decisions already maximizes its contribution.
For the four-outcome example, choose after and after or , with either decision allowed after . Choosing after yields . The best success probability is 65%, with a 35% error probability. A smaller total variation distance means the two sources are harder to distinguish from one observation. Unequal prior probabilities, unequal costs, or multiple observations change this particular decision problem; the figure is not a universal bound for every experiment.
Consider the probability mass functions and on the finite set . Their difference is . Thus
The event attains this difference: and . Combining and gives the same absolute discrepancy with the opposite sign. Adding to either event changes nothing, because its probability mass agrees under both probability distributions.
Figure 1.
Total variation distance as the largest event discrepancy
. An illustrative four-outcome example. The positive and negative excesses each total ; summing both without the factor counts the same redistribution twice. Details.
The factor is necessary because : every unit of excess probability mass must match a unit of deficit. For any event, including a negative term cannot increase its signed discrepancy, while omitting a positive term cannot increase it either. Therefore attains the positive maximum. This is a short way to compute an apparent optimization over subsets using one pass through .
For probability density functions relative to the same measure , the corresponding identity is . Such densities can always be taken as Radon-Nikodym derivatives relative to . Beware the notation: the total variation norm of a measure applied to the signed measure equals . A formula using that norm without its factor is using a different normalization.
Applying the same measurable function to observations from two probability distributions cannot increase their total variation distance. Every output event is tested through its preimage , which was already one of the input events. Therefore
For the four-outcome example, recording only whether the result is makes the output probability distributions identical: each is a Bernoulli distribution with parameter . The original total variation distance was , but this coarse measurement leaves zero discrepancy. Discarding information can make two sources less distinguishable.
The same contraction holds for a common Markov kernel : . On a finite set, expand , apply the triangle inequality to each output component, and use that each row of sums to one. A common randomized postprocessing step cannot increase distinguishability either.
Two-toss sample space 2026-10-14
Model two fair independent coin tosses, recording their order. Here denotes heads and tails, and
The power set includes every question expressible as a subset of these four outcomes. The mass comes from the fairness and independence assumptions. These are exact model probabilities, rather than measured toss frequencies.
Let be the event that the first toss is heads and the event that the second toss is heads. Then
The union means “at least one head,” while the intersection means “both heads.” Their probabilities are and . Counting the union through the inclusion-exclusion principle gives ; alternatively its complement of an event is , of probability .
Figure 1.
Four ordered outcomes and the event of at least one head
. Rows record the first toss and columns the second. Each cell has probability under fair independent tosses. The highlighted union includes , , and ; the overlap contains only . Details.
On the same sample space, assigning masses to would still make each toss fair: . But , so the tosses would be dependent. The event of at least one head would have probability . Changing the probability measure changes the answer even when the sample space and the single-toss probabilities stay the same.
For one integrable random variable , the family , over arbitrary sigma-algebras , has uniform integrability. On , the defining property of conditional expectation gives , while by the Markov inequality. The integrable random variable has uniformly small absolute integrals over events of sufficiently small probability.
Wald's equation Created 2026-10-03 Updated 2026-10-14
Wald's equation turns a random sum into a product of two expected values: the average contribution per step and the average number of steps. Its surprising feature is that the number of steps may depend on what has already happened. A procedure can stop on its first successful Bernoulli trial, for example, while the identity still accounts for its total cost. The crucial restriction is that the decision to take the next step cannot use that step's unobserved outcome.
Let be real independent and identically distributed random variables with , let , and put and . Suppose is a nonnegative integer-valued stopping time for the natural filtration , with . Then is an integrable random variable and
These hypotheses allow statistical dependence between and the increments; they do not allow access to future increments. The finite-expected value requirement is stronger than stopping almost surely.[ref]
For the proof idea, count step only on . This event is determined by the first observations, so its indicator function is independent of . The Proof of Wald's equation by stopping indicators combines this observation with the tail-sum formula for expectation. The same calculation with gives , which justifies interchanging the expected value and the infinite series. This is why the result survives a data-dependent end point without assuming an independent count.
The identity is useful in randomized algorithms and repeated sampling: one can translate an average amount of work into an average number of attempts, or conversely, without first finding the full probability distribution of the total. The examples below separate a permissible stopping rule from a rule that peeks ahead and from a valid rule whose average waiting time is infinite.