Contents / Probability / Transformations and Generating Functions
Chapter 6
Transformations and Generating Functions
Functions of random variables by the cdf method and Jacobians, convolution, order statistics, and moment and probability generating functions.
Introduction
Almost nothing you actually want to know about is a random variable you were handed. You were handed a measurement error; you want the squared error. You were handed the daily returns of a stock; you want their sum over a month. You were handed the lifetimes of five components; you want the moment the first one fails. In each case a new random variable , or , has been built out of old ones, and the question is what its distribution is.
This chapter answers that question twice, with two quite different technologies.
The first is direct: push the distribution through the function. For one variable this is the cdf method, and the change-of-variables density formula is its corollary; for two it is a Jacobian, exactly as in a double integral; for a sum it specialises to the convolution integral; and for the smallest, largest or -th smallest of a sample it gives the theory of order statistics. Direct methods are honest and general, and they are also laborious — a sum of thirty independent variables is thirty nested convolutions, which nobody computes.
The second technology is indirect. Attach to each random variable a single function of a dummy variable — its moment generating function — chosen so that the operations you care about become easy. Adding independent variables becomes multiplying their generating functions. Extracting the mean and variance becomes differentiating at zero. A calculation that was thirty convolutions becomes a thirtieth power. The price is a uniqueness theorem: you must know that the generating function determines the distribution, so that recognising the answer's transform counts as identifying the answer. That theorem is true, it is stated here, and its proof genuinely lies outside this course — so it is stated as an import rather than dressed up as a derivation.
Two earlier results are the obvious precedents and are not repeated. The theorem Inverse transform in the chapter on continuous random variables is a transformation result: it is the special case , and it is the reason a computer can simulate anything from uniform noise. The proposition The square of a standard normal in that same chapter is a non-monotone transformation worked by hand, and the chi-squared, and families built there are all defined as functions of independent normals. What was missing was the general machinery, and the moment generating function that chapter used twice — once for sums of normals, once for the De Moivre–Laplace sketch — without ever defining it. Both gaps are filled here.
6.1Functions of one random variable
Everything in this section rests on one observation, which is so simple that it is easy to mistake for a triviality: the event is an event about . It says that landed in the set , and the probability of that is something the distribution of already knows. So the cdf of is computable before anything is known about the density of , and the density is then obtained by differentiating.
Method 6.1 (The cdf method). To find the distribution of from the distribution of :
- Determine the range of — the set of values takes as runs over the support of . Outside it the density is zero and there is nothing to compute.
- For in that range, rewrite the event as an event about , by solving the inequality for .
- Evaluate its probability using , giving .
- Differentiate: at every where is differentiable.
The method is completely general. It needs no monotonicity, no invertibility, no continuity of ; step 2 may produce a union of intervals, or an empty set, or a half-line, and step 3 handles whichever it is. It is the method to fall back on whenever a shortcut formula's hypotheses are in doubt, and it is the method the shortcut formula is proved from.
Example 6.2 (A square root). Let have density on . Find the density of .
Solution. As runs over , runs over , so is supported on .
For , the inequality is equivalent to , because both sides are non-negative and squaring is increasing there. Hence
Differentiating, on , and zero elsewhere.
Check: . ✓□
Notice what step 2 quietly used: that is increasing, so the inequality could be inverted without flipping. When is decreasing the inequality flips and a complement appears, and it is worth seeing that case once explicitly before the general formula absorbs both.
Example 6.3 (A decreasing transformation). Let and let . Find the density of and name the distribution.
Solution. As runs over , runs over .
For , the inequality is equivalent to , that is — the inequality has reversed, because is decreasing. So
using for and . Differentiating gives on : is exponential with rate .□
Remark. That last example is the theorem Inverse transform in disguise, since and have the same distribution, and the second is for the rate- exponential. Reaching the same answer by the cdf method is a useful consistency check: the two routes must agree, because they are computing the same probability.
The change-of-variables formula
When is monotone the cdf method always goes the same way, and the bookkeeping can be done once and for all. The result is the formula most people reach for.
Theorem 6.4 (Change of variables for a density). Let be a continuous random variable with density , supported on an interval . Let be differentiable and strictly monotone on , with throughout, and set . Write for the inverse, defined on . Then is continuous with density
and for .
Proof. Suppose first that is strictly increasing. Then exists on and is strictly increasing, and for the events and are the same event. Therefore
Both and are differentiable — the latter by the inverse function theorem, since — so the chain rule applies:
Because is increasing its derivative is positive, so the factor equals its own absolute value and the stated formula holds.
Now suppose is strictly decreasing. Then is decreasing, and is the event : the inequality reverses. So
using , which is valid because is continuous and so . Differentiating,
and here , so the leading minus sign makes the product positive and again equal to .
The two cases give one formula, and monotonicity is what allowed step one in each: without it, need not be a single interval and the cdf cannot be read off as a single value of .
Finally, integrates to one: substituting in returns , which is the same substitution rule, run backwards.∎
Intuition. A density is probability per unit length, so it responds to a change of variable the way a physical density responds to stretching a wire. Take the little interval ; it holds probability . The map sends it to an interval of length around . The probability inside cannot change — it is the same outcomes — but the length it is spread over has been multiplied by . So the density must be divided by that factor:
which is the theorem again, since . Where stretches, the density thins; where compresses, the density piles up. That single factor is the whole content of the formula, and it is why the absolute value is there: lengths are positive whether the map reverses orientation or not.
Example 6.6 (Scaling an exponential). Let and let for a constant . Find the density of .
Solution. Here is strictly increasing on with and . By the theorem Change of variables for a density,
That is the density: rescaling an exponential divides the rate by , which is the only possible answer given that the mean must scale to . The exponential family is closed under scaling, and this is why one only ever needs to tabulate the rate- case.□
Corollary 6.7 (Linear transformations). If has density and with , then
Proof. is strictly monotone (increasing if , decreasing if ) with and . The theorem Change of variables for a density gives the result, with .∎
Applying this to and recovers the theorem Standardisation from the chapter on continuous random variables in one line, which is a fair advertisement for having the general formula.
When is not monotone
The hypothesis of strict monotonicity is not decoration. Drop it and the formula is simply wrong, because the event stops being a single interval. The repair is to go back to the cdf method, which never needed the hypothesis, or equivalently to split the domain into pieces on which is monotone and add up their contributions.
Theorem 6.8 (Non-monotone change of variables). Let have density , and suppose the support of splits into finitely many intervals with disjoint interiors, on each of which is differentiable and strictly monotone with non-vanishing derivative. Write for the restriction of to and . Then
Proof. Fix and let . Since the cover the support up to a set of zero probability and overlap only at endpoints, which carry zero probability for a continuous ,
On the function is strictly monotone, so is an interval with one endpoint at an endpoint of and the other at whenever ; otherwise is all of or empty, and in either case its probability is constant in and differentiates away. Each non-constant term is or , exactly as in the proof of the theorem Change of variables for a density, and differentiating each gives . Summing the derivatives gives the claim.∎
The prototype is the square, and it is worth doing in full because the factor of two that appears in the symmetric case is a standing source of error.
Example 6.9 (The density of ). Let be continuous with density and let . Find , and then specialise to and to .
Solution. The map is decreasing on and increasing on , with ; take and . For the branch inverses are and , both with . The theorem Non-monotone change of variables gives
and for , since a square is never negative.
Equivalently, and this is the cdf method doing the same work: , and differentiating reproduces the display.
Uniform case. For , on , so for both branches contribute and
Check: . ✓ The density is unbounded at — squaring crushes the neighbourhood of the origin, so probability piles up there.
Normal case. For the density is even, so and
which is the density found in the proposition The square of a standard normal. The general formula reproduces it without any special argument about symmetry.□
Pitfall (The single-branch trap). Writing for — using only the positive root — loses exactly half the probability when is symmetric about zero, and an unpredictable amount otherwise. The integral of the result is then , which is the cheapest available check.
The rule to remember: count the solutions of . One solution, one term; two solutions, two terms. If almost surely then is outside the support, , and the second term vanishes on its own — the formula does the bookkeeping for you provided you write it down.
Pitfall (A transformation can destroy continuity). The theorem assumes is differentiable and strictly monotone. If is constant on a set of positive probability the output is not continuous at all: for and , the value occurs with probability . Such a has neither a density nor a pmf; its distribution is a mixture, described by its cdf and nothing simpler. Check that is non-constant before reaching for any density formula.
6.2Sums, convolution, and the two-variable Jacobian
One variable in, one variable out was the easy case. The interesting transformations take several inputs: a sum, a ratio, a maximum. The organising device is the same — rewrite the event, or equivalently change variables in the integral — but now the stretching factor is a determinant rather than a derivative.
We start with the single most useful case, the sum, and prove it by the cdf method so that nothing new is needed.
Theorem 6.10 (Convolution formula). Let and be independent continuous random variables with densities and . Then has density
This function is called the convolution of and , written .
Proof. Independence means the joint density factorises, . The event is the half-plane , so
Differentiate under the integral sign with respect to . This is legitimate because the inner integrand is non-negative and integrates to a finite value, so dominated convergence applies. Since ,
The second form follows by the substitution , or by symmetry: , so the roles may be exchanged.∎
Pitfall (Convolution needs independence). The factorisation is the only place independence entered, and without it the formula is false. Take with : each of and has a perfectly good density, but is identically and has no density at all. The convolution integral of the two marginals would return the triangular density on , which is not the distribution of by any stretch. Marginals do not determine the distribution of a sum; the joint distribution does.
Example 6.11 (The sum of two independent uniforms). Let be independent . Find the density of .
Solution. Here for and for , that is . The integrand is exactly on the overlap of and , and zero elsewhere, so is the length of that overlap.
- For the overlap is , of length .
- For the overlap is , of length .
- Outside the overlap is empty.
So is the triangular density, rising linearly to a peak of at and falling back. Check: the triangle has base and height , area . ✓
The qualitative lesson outlives the example. Adding two flat distributions produces a peaked one, because there are many ways to make a middling total and only one way to make an extreme one. Add a third uniform and the peak sharpens further; this is the Central Limit Theorem beginning to act, visibly, at .□
Example 6.12 (The sum of two independent exponentials). Let be independent . Find the density of .
Solution. Both densities vanish off , so the integrand is non-zero only when and , i.e. . Getting those limits right is the whole difficulty. For ,
The exponentials in cancelled exactly, leaving a constant integrand — which is why this particular convolution is so clean. The answer is the density. With it is , whose mean is and which, unlike an exponential, is zero at the origin: two waits cannot both be short at once as easily as one can.□
Remark (Sums of terms). Iterating gives the density for a sum of independent waits, which is the Erlang law of the -th arrival in a Poisson process. Doing it by iterated convolution is an induction with an integral at every step. The section Moment generating functions below obtains it in two lines, and that contrast is the argument for generating functions in a single picture.
The general two-variable change of variables
The convolution formula is a special case of a general principle that is simply the multivariable substitution rule of calculus, read probabilistically.
Theorem 6.13 (Two-variable Jacobian formula). Let have joint density supported on an open set , and let
where is a one-to-one, continuously differentiable map from onto an open set , whose inverse , is also continuously differentiable. Define the Jacobian
and suppose on . Then has joint density
and zero outside .
Proof. Let be any region and let , which is exactly the set of inputs producing an output in . Because is a bijection from to , the events and are the same event, so
Now apply the change-of-variables theorem for double integrals with the substitution , whose hypotheses — a continuously differentiable bijection with non-vanishing Jacobian — are exactly what was assumed. It converts the integral over into an integral over :
So for every region the probability equals the integral over of the stated function. A non-negative function with that property is by definition the joint density of .∎
Intuition. This is the one-variable picture with areas in place of lengths. A small rectangle of area in the output plane is the image of a small parallelogram in the input plane, and is the factor by which the map scales area — that is what a determinant measures. The probability sitting in the patch is unchanged, the area it occupies has been multiplied by , so the density is divided by the reciprocal — which, written with as the Jacobian of the inverse map, is multiplication by .
Note (Getting a single output). The theorem needs two outputs because it needs a bijection of the plane. To find the distribution of a single quantity , invent a convenient second coordinate — very often — apply the theorem, and then integrate out of the joint density to recover the marginal of . The auxiliary variable is scaffolding and is discarded at the end.
Example 6.14 (Convolution recovered from the Jacobian). Derive the convolution formula from the theorem Two-variable Jacobian formula.
Solution. Take and the auxiliary . The map is linear and invertible: , . Its Jacobian is
so and the joint density of is . Integrating out the auxiliary variable,
which under independence factorises into — the theorem Convolution formula. Note that the first display is valid without independence; it is the general formula for the density of a sum, and independence is only what turns it into a convolution.□
Example 6.15 (Splitting an exponential pair into total and fraction). Let be independent . Put and . Find the joint density of and describe what it says.
Solution. The map sends onto bijectively, with inverse , . The Jacobian of the inverse is
so . The joint density of the inputs is , and therefore
The right-hand side factorises into a function of alone times a function of alone over a rectangular region, which is exactly the criterion for independence. So and are independent, — matching the example The sum of two independent exponentials — and .
That is a genuinely surprising fact and a useful one: knowing the total waiting time tells you nothing about how it was split between the two waits, and the split is uniform. It is also a warning about intuition, since and are both built from the same two variables and might have been expected to be entangled.□
6.3Order statistics
Sort a sample. That single operation produces a family of new random variables — the smallest observation, the largest, the median, the range — which is where a great deal of applied probability lives: the largest flood in a century, the first component to fail, the sample median as a robust centre.
Definition 6.16 (Order statistics). Let be random variables. Their order statistics are the same values sorted into increasing order, written
so that , , and is the -th smallest. The sample range is , and for odd the sample median is .
Pitfall (Order statistics are never independent). Even when are independent, the order statistics are not: always holds, so learning that the maximum is small forces the minimum to be small. Sorting destroys independence by construction. Every formula below is derived from the independence of the unsorted sample, and none may be applied to the sorted one.
Throughout this section are independent and identically distributed with common cdf and density . Both hypotheses are used: independence to multiply probabilities, identical distribution to use the same for each factor.
Theorem 6.17 (Distribution of the maximum and the minimum). For an iid sample with common cdf and density ,
Proof. For the maximum, the event says that every observation is at most — if even one exceeded the maximum would too. Hence
the middle step by independence and the last by identical distribution. Differentiating with the chain rule gives .
For the minimum, take complements: says every observation exceeds , so
and . Differentiating, and remembering the chain rule brings out a factor which cancels the leading minus sign, gives .∎
Intuition. Both formulas are the same sentence twice. "The largest is below " means "all of them are below ", and independent events multiply. "The smallest is above " means "all of them are above ". Everything else is differentiation. This is also why maxima are best handled through the cdf and minima through the survival function : each is the one that turns into a clean product.
Example 6.18 (The first of five components to fail). Five components have independent lifetimes. When does the first failure occur?
Solution. Here , so
which is the survival function of . The minimum of independent exponentials with rate is exponential with rate , and its mean is — five times shorter than a single component's life.
The maximum is not so tidy: is not an exponential cdf for any rate. Its mean turns out to be , a harmonic sum which grows like : the last component to fail lasts only logarithmically longer as the system grows, while the first fails proportionally faster.□
Theorem 6.19 (Density of the -th order statistic). For an iid sample of size from a continuous distribution with cdf and density , the -th order statistic has density
Proof. Start from the cdf, and count. The event says the -th smallest observation is at most , which happens exactly when at least of the observations are at most . Each observation independently lands in with probability , so the number that do is and
Write and differentiate the sum with respect to , then multiply by . Term by term, for ,
The sum telescopes. Using and , the derivative becomes
in which the second part of the -th bracket cancels the first part of the -th. Only the first part of the bracket survives, the final negative term vanishing because . Hence
and multiplying by and writing gives the claim.∎
Intuition. The formula can be read off directly, which is how it is usually remembered. For to sit in : one observation must land in that tiny interval, contributing ; exactly of the others must fall below it, each with probability ; and the remaining must fall above, each with probability . The multinomial coefficient counts the ways of assigning which observation plays which role.
That argument is correct and is the right thing to carry in your head. The proof above is the version that does not require interpreting as a quantity, which is why it goes through the binomial cdf instead.
Setting and in the theorem Density of the -th order statistic returns the two densities in the theorem Distribution of the maximum and the minimum, as it must: the coefficients collapse to in both cases.
The uniform case
The uniform sample is where all of this becomes explicit, because makes the cdf disappear from the formulas.
Proposition 6.20 (Order statistics of a uniform sample). Let be iid . Then
which is the density. Its mean is
Proof. The density is immediate from the theorem Density of the -th order statistic with and on .
For the mean, write and use the Beta integral for positive integers — itself provable by repeated integration by parts. Then
The same integral with gives , whence
Intuition. The mean says that points dropped uniformly at random cut into gaps whose expected lengths are all equal, namely . The -th point sits after of those gaps. Three uniform points have expected positions , , — not , and not . The endpoints count as boundaries of gaps too, and that is exactly what the in the denominator records.
The range
The range needs the joint density of the two extremes, because it is a function of both.
Proposition 6.22 (Joint density of the extremes and the range). For an iid sample of size from a continuous distribution with cdf and density , the joint density of is
Consequently the range has density
Proof. For let , the probability that every observation lies in . By independence and identical distribution this is . Writing the joint cdf in terms of and differentiating, or directly: , so the joint cdf is
Take . The first term has no in it and dies. For the second, of is , and then of that is , which is the first claim.
For the range, apply the theorem Two-variable Jacobian formula with and the auxiliary . The inverse map is , , whose Jacobian determinant is , so the joint density of is . Integrating out gives the marginal density of .∎
Example 6.23 (The range of a uniform sample). Find the density and mean of the range of iid observations, and evaluate for .
Solution. With and on , the integrand is , a constant in . The constraint is and , so ranges over an interval of length . Hence
This is the density, so
For : and . Consistency check: . ✓ — and note that this check works even though and are dependent, because expectation is linear whether or not the variables are independent.
As grows, : a large uniform sample eventually fills its interval, and the range is a consistent estimator of the width of the support.□
6.4Moment generating functions
Every method so far has been direct: to find the distribution of a sum, integrate over the region where the sum is small. That is honest and it does not scale. The alternative is to encode the whole distribution in a single function, chosen so that the operations you perform on random variables turn into easier operations on functions.
Definition 6.24 (Moment generating function). The moment generating function (mgf) of a random variable is
defined for those real at which the expectation is finite. Explicitly,
We say the mgf exists if is finite for all in some open interval containing .
The variable is a formal handle with no probabilistic meaning; it is a place to hang information. What matters is that turns multiplication of exponents into addition of random variables, and that its Taylor expansion in has the moments of sitting in the coefficients. Those two facts are the whole subject.
Proposition 6.25 (Elementary properties). Whenever the quantities involved are finite:
- for every random variable ;
- for constants ;
- if is a constant , then .
Proof. (1) , and this is finite for every without exception — which is why is never the interesting point and why "the mgf exists" has to mean existence on an interval around rather than at .
(2) , pulling the constant out of the expectation by linearity.
(3) Immediate from the definition, since is not random.∎
Proposition 6.26 (Value of as a check). Any candidate mgf must satisfy and for all at which it is finite.
Proof. The first is part (1) above. For the second, always, and the expectation of a strictly positive random variable is strictly positive. So a formula that returns or a negative number, or that fails to return at the origin, is not an mgf; substituting is the fastest way to catch an algebra slip.∎
Why it generates moments
Theorem 6.27 (Moments from derivatives at zero). Suppose is finite on an open interval with . Then is finite for every , is infinitely differentiable on , and
Equivalently, has the convergent expansion
Proof. Expand the exponential inside the expectation. For each fixed ,
a series converging for every value of . Take expectations and interchange the sum with the expectation:
The interchange is the only delicate step, and finiteness on is exactly what licenses it. Fix . Since termwise and , we get ; so every is finite and the partial sums are dominated by the integrable random variable for . Dominated convergence permits the interchange, and the resulting power series converges on .
A power series may be differentiated term by term inside its interval of convergence, and its -th derivative evaluated at the centre picks out times the -th coefficient. Here the -th coefficient is , so .∎
Intuition. Differentiating with respect to brings down a factor of : . Do it times and you have ; set and the exponential becomes , leaving . The expectation of that is . The whole theorem is "differentiating pulls down powers of ", and the technical work is only in justifying the swap of with .
Method 6.28 (Mean and variance from an mgf). Given :
- Check .
- Differentiate once and set : this is .
- Differentiate again and set : this is .
- Then .
When is a product or a power, differentiating is usually faster: and , since the second derivative of the logarithm is , which at is because . The function is called the cumulant generating function for this reason.
Sums become products
This is the property that makes the whole apparatus worth building.
Theorem 6.29 (The mgf of a sum of independent variables). If are independent and each is finite on a common interval , then has
If in addition the are identically distributed with common mgf , then .
Proof. By definition and the law of exponents,
The random variables are functions of independent random variables and are therefore themselves independent. The expectation of a product of independent random variables is the product of their expectations, so
The iid case is the same statement with equal factors.∎
Pitfall (Independence is doing all the work). The step is false without independence, and nothing else in the proof is doing anything. With and , , while . Correlated variables have no product rule. Note also that the converse fails: can hold for dependent and , so matching mgfs is evidence of nothing about independence.
Example 6.30 (The Gamma law of a sum of exponentials, again). Let be iid and . Identify the distribution of from its mgf.
Solution. The exponential mgf, derived below in the proposition Moment generating functions of the standard families, is for . By the theorem The mgf of a sum of independent variables,
which is the mgf of . By the theorem Uniqueness of the moment generating function, .
Set that beside the remark Sums of terms, where the same conclusion required nested convolutions. Here it is one line and an -th power, and the mgf never had to know how many terms there were.□
The uniqueness theorem
Recognising as a Gamma mgf only settles the distribution if no other distribution has that mgf. That is the theorem which makes the method legal, and it is deeper than anything else in this chapter.
Theorem 6.31 (Uniqueness of the moment generating function). Let and be random variables whose moment generating functions are both finite on a common open interval with . If
then and have the same distribution: for every .
Moreover, if for every in such an interval, and is the mgf of a distribution, then in distribution, meaning at every continuity point of .
This theorem is stated without proof, and the omission is genuine. A correct argument identifies on a strip of the complex plane with a two-sided Laplace transform of the distribution and then inverts that transform, which requires complex analysis and an inversion theorem — Lévy's, or the Laplace inversion formula — that is beyond this course. The second statement is the continuity theorem, and it needs the same machinery. Any "proof" you meet that consists only of matching Taylor coefficients is not one, for a reason the pitfall below makes concrete.
Pitfall (Matching moments is not matching distributions). The moments do not in general determine the distribution, so " and have the same moments, hence the same law" is invalid. The standard counterexample is the log-normal: if is log-normal and
then every is a genuine density and all of them have exactly the same moments as , for every . An uncountable family of distinct distributions, one moment sequence.
What rescues the uniqueness theorem is the hypothesis that the mgf is finite on an interval — a condition the log-normal fails, as shown in the section Where generating functions fail. Finiteness on an interval is strictly stronger than having all moments finite, and that gap is exactly where the counterexample lives.
6.5The generating functions of the named families
Each standard family has an mgf that can be written in closed form, and once the table exists, means and variances that originally cost a sum or an integral cost two derivatives instead.
Proposition 6.32 (Moment generating functions of the standard families).
| distribution | valid for | |
|---|---|---|
| all | ||
| all | ||
| all | ||
| on | ||
| all | ||
| for , and at | all |
Proof. Bernoulli. takes the value with probability and with probability , so . The sum is finite, so it converges for every .
Binomial. A variable is a sum of independent Bernoulli variables, so the theorem The mgf of a sum of independent variables gives immediately. (Directly: is the binomial theorem.)
Poisson. With ,
recognising the exponential series with argument , which converges for every real .
Geometric. With and for ,
a geometric series which converges precisely when , that is . Since that bound is strictly positive, so the mgf exists on an interval around — but only just.
Exponential. For ,
the integral converging exactly when . For the integrand does not decay and the integral diverges: the exponential's mgf exists only on a half-line, which is the first sign that heavy tails and mgfs are in tension.
Gamma. For , using the density ,
where the middle step is the Gamma integral for .
Normal. Take first and complete the square in the exponent:
Since ,
because the remaining integral is the total mass of an density, namely . For a general , part (2) of the proposition Elementary properties gives
Uniform. for ; the singularity at is removable, and L'Hôpital's rule gives the value there, as the proposition Value of as a check requires.∎
Every entry satisfies : substitute and read off , , and so on. That takes ten seconds and catches most transcription errors.
Cheaper moments
Proposition 6.33 (Poisson mean and variance from the mgf). If then and .
Proof. Use the cumulant route of the recipe Mean and variance from an mgf. With ,
At : and .
Compare the direct route, which required re-indexing to recognise a shifted Poisson series, and then the same trick again on after splitting . Here the answer is two derivatives of a linear function.∎
Proposition 6.34 (Exponential mean and variance from the mgf). If then and .
Proof. on , so
Evaluating at gives and , so
More generally , so — every moment of the exponential, from one pattern of differentiation, where the direct route needs integrations by parts.∎
Proposition 6.35 (Normal mean and variance from the mgf). If then and — so the parameters are what their names claim.
Proof. is a quadratic. Then and , so and .
The direct proof of needs a substitution and an odd-symmetry argument; the direct proof of needs integration by parts on . Notice also what the vanishing of for says: every cumulant of the normal beyond the second is zero, which is one precise sense in which the normal is the distribution with no structure past its mean and variance.∎
Example 6.36 (Sums of independent Poissons). Let and be independent. Identify the distribution of .
Solution. By the theorem The mgf of a sum of independent variables,
the mgf of . By the theorem Uniqueness of the moment generating function, .
The same argument in the binomial case: , so independent binomials with a common add. With different success probabilities the exponents cannot be combined, and indeed the sum is not binomial — the algebra records the hypothesis for you.□
Example 6.37 (Linear combinations of independent normals). Let and be independent and let . Find the distribution of .
Solution. By part (2) of the proposition Elementary properties, , and similarly for . Multiplying,
which is the mgf of . Uniqueness finishes it.
This is the theorem Linear combinations of independent normals from the chapter on continuous random variables, whose proof there had to wave at mgfs it had not defined. Note the squares on and : the variance of is , because . Variances of independent things add no matter which sign the combination carries.□
6.6Probability generating functions
For a random variable taking values in there is a better-behaved relative of the mgf, obtained by writing .
Definition 6.38 (Probability generating function). Let take values in the non-negative integers with . Its probability generating function (pgf) is
The series has radius of convergence at least and is finite for every , since .
Note (The relationship to the mgf). for , and . They carry the same information where both are defined, but the pgf is always finite on whatever the distribution, whereas the mgf may exist nowhere but the origin. The pgf is also literally a list of the probabilities: the coefficient of is , so recovering a pmf from a pgf is reading off a power series, which is often easier than any inversion.
Proposition 6.39 (Properties of the pgf). For a non-negative integer valued with pgf :
- and ;
- , so determines the distribution;
- and more generally , the -th factorial moment, whenever it is finite;
- ;
- if are independent then .
Proof. (1) Setting kills every term but , leaving ; setting gives .
(2) is a power series with coefficients , and the -th derivative of a power series at the centre is times the -th coefficient. Since a convergent power series has unique coefficients, two variables with the same pgf have the same pmf — unlike the mgf, the uniqueness here needs no transform theory at all.
(3) Differentiating term by term inside the radius of convergence,
Setting gives . (At this is a one-sided limit if the radius of convergence is exactly ; Abel's theorem guarantees the limit equals the sum whenever that sum is finite, and equals otherwise.)
(4) From (3) with , , so . Subtract .
(5) , the middle step by independence exactly as in the theorem The mgf of a sum of independent variables.∎
Example 6.40 (Reading a pgf). Compute the pgfs of the Bernoulli, binomial, Poisson and geometric laws, and recover the Poisson mean and variance.
Solution. Substituting in the proposition Moment generating functions of the standard families:
For the Poisson, and , so and . Then and, by part (4),
Sums of a random number of terms
The pgf earns its keep on a problem the direct methods handle badly: a sum whose number of terms is itself random. Insurance claims in a year, offspring in a generation, customers served in a shift — all have this shape.
Theorem 6.41 (Compounding: the pgf of a random sum). Let be a non-negative integer valued random variable with pgf , and let be iid non-negative integer valued with common pgf , independent of . Put
Then . Consequently, if the means and variances are finite,
Proof. Condition on and use the tower property . Given , the sum is of iid terms independent of the conditioning event, so by part (5) of the proposition Properties of the pgf,
Therefore
the last step being the definition of evaluated at the number , which lies in for so the series converges.
For the moments, differentiate with the chain rule and use :
Differentiating again,
so . Substituting into part (4) of the proposition Properties of the pgf and writing throughout, the terms rearrange into .∎
Example 6.42 (Thinning a Poisson stream). A shop receives customers in a day, and each independently buys something with probability . How many buyers are there?
Solution. Let be the indicator that customer buys, so , and let be the number of buyers. By the theorem Compounding: the pgf of a random sum,
which is the pgf of . So thinning a Poisson stream by independent coin flips leaves a Poisson stream, with the rate multiplied by the retention probability.
Sanity check against the moment formulas: ✓, and ✓, matching a Poisson's equal mean and variance.□
Branching processes
Definition 6.43 (Galton–Watson branching process). Start with individual. Each individual in generation independently produces a random number of offspring with pmf and pgf , and
where the are iid with pgf and independent of . The extinction probability is .
Proposition 6.44 (Generation sizes and their means). Let be the pgf of and the mean offspring number. Then is the -fold composition of with itself,
and .
Proof. is a random sum of iid terms each with pgf , so the theorem Compounding: the pgf of a random sum gives ; iterating from gives the composition, and composition of a function with itself may be read in either order here, so as well.
For the mean, the chain rule at with gives , that is , and . Induction gives .∎
Theorem 6.45 (Extinction criterion). Assume . The extinction probability is the smallest root in of the fixed-point equation
Moreover if , and if .
Proof. Sketch — the analytic details of the last step are indicated but not fully verified. Let . The sequence is non-decreasing, since extinction by generation implies extinction by generation , and bounded by , so it converges to . Applying the recursion, , and letting with continuous on gives : the extinction probability is a fixed point.
That it is the smallest non-negative fixed point follows by induction: if satisfies , then , and implies because is non-decreasing on . So for all and hence .
For the dichotomy, note is convex on — its second derivative is non-negative — and . A convex function meeting the line at crosses it at most once more in , and it does so exactly when its slope at , namely , exceeds . If the only fixed point in is and so ; if the curve dips below the diagonal just left of and, since , must cross it at some .∎
Intuition. Each individual has children on average, so a population of size becomes on average: the mean grows geometrically. When the mean decays to zero and extinction is unsurprising. The delicate case is , where the mean population is exactly forever — and yet extinction is still certain. The reason is that a population that happens to hit can never recover, so the process eventually finds the absorbing state; the constant mean is propped up by increasingly unlikely, increasingly enormous surviving lines.
Example 6.46 (A branching process with ). An individual has , or offspring with probabilities . Find the mean offspring number and the extinction probability.
Solution. The offspring pgf is
Then and , so the theorem Extinction criterion promises .
Solve : multiply by to get , that is
The smallest root in is . So despite a growth rate above , this population dies out half the time. Expected size in generation is , and yet the typical outcome is extinction — the mean is carried by the surviving half.□
6.7Where generating functions fail
Every construction above began "suppose the mgf is finite on an interval". That hypothesis is not free, and two standard distributions break it.
Theorem 6.47 (The Cauchy distribution has no mgf). Let have the standard Cauchy density on . Then for every , so is finite only at .
Proof. Take ; the case is the same argument on the left tail, by the symmetry . All terms are positive, so it suffices to bound the integral over from below:
For we have , so the integrand is at least . Since grows faster than any power, ; in particular for all beyond some , and the integral over of a function bounded below by is infinite.∎
Remark (And no mean either). The same tail is why does not exist for the Cauchy: diverges logarithmically. The Cauchy is exactly the -distribution with one degree of freedom mentioned in the chapter on continuous random variables, and it is the standard counterexample to the law of large numbers — the average of iid Cauchy variables is again standard Cauchy, for every , so averaging achieves nothing at all.
Theorem 6.48 (The log-normal has no mgf on any interval to the right). Let with , the standard log-normal. Then is finite for every , but for every .
Proof. The moments are the normal mgf in disguise: , finite for every . So every moment exists.
For the mgf, fix and bound below by the part of the integral with :
The exponent is . As , beats , so the exponent tends to and the integrand tends to ; an integral over an infinite interval of a function tending to infinity diverges.∎
Pitfall (All moments finite does not give an mgf). The log-normal has every moment and no mgf, so the two conditions are genuinely different. This is not a curiosity: it is the loophole through which the counterexample of the pitfall Matching moments is not matching distributions passes, and it is why the uniqueness theorem is stated with "finite on an interval" rather than "all moments finite". The moments grow like , far too fast for to converge for any — and it is that convergence, not the finiteness of the individual terms, that the mgf needs.
Definition 6.49 (Characteristic function). The characteristic function of is
where .
Because for every real and every value of , the expectation is an average of quantities of modulus one and is therefore always finite: every random variable has a characteristic function, on the whole real line, with no hypotheses whatever. The Cauchy's is ; the log-normal's exists too, though it has no elementary closed form.
The characteristic function has all the structural properties proved above for the mgf — , , the product rule for sums of independent variables, and derivatives at giving moments when those moments exist — and, crucially, a uniqueness and continuity theorem that requires no integrability hypothesis at all.
This is why the real proof of the Central Limit Theorem uses characteristic functions and not mgfs. The mgf argument sketched in the chapter on continuous random variables for the normal approximation to the binomial is fine there, because a bounded random variable has an mgf everywhere. But the Central Limit Theorem is true for any iid sequence with finite variance, including ones with no mgf — and an argument that begins "expand " has assumed away the general case in its first line. Swapping for removes the assumption at the cost of doing analysis in the complex plane, which is the trade the professional proof makes.
Summary (What to carry away).
- The cdf method is the general technique: rewrite as an event about , evaluate with , differentiate. It never needs monotonicity.
- Change of variables: for strictly monotone differentiable , . The absolute-value factor is the local stretch; density thins where the map stretches. For non-monotone , sum one such term per solution of — two terms for , which is where the density comes from.
- Sums: by convolution, valid only under independence. The general two-variable tool is the Jacobian formula , with an auxiliary second coordinate invented and then integrated out.
- Order statistics: , specialising to for the maximum and for the minimum. For a sample, with mean and the range has mean .
- Mgf: , with , , , and under independence. Uniqueness — equal mgfs on an interval force equal distributions — is what licenses identifying a distribution by its transform, and its proof is imported.
- The table: has , has for , has , has , has . Differentiating twice at gives mean and variance directly.
- Pgf: for count variables, with , , and . A random sum has ; a branching process has and extinction probability the smallest root of , which is exactly when .
- Failure: the Cauchy has no mgf away from and the log-normal none for despite having every moment. Characteristic functions always exist, which is why the general Central Limit Theorem is proved with them.
- Using the change-of-variables formula on a non-monotone map. requires strict monotonicity. For with symmetric it loses exactly half the probability. Count the solutions of and write one term for each; if the integral of your answer is not , a branch is missing.
- Forgetting the absolute value. A decreasing transformation gives a negative , and a negative "density" is the signal. The Jacobian version has the same trap: , never .
- **Differentiating instead of composing.** The formula is — substitute *then* differentiate. Writing where belongs drops the transformation entirely.
- Getting the convolution limits wrong. For non-negative variables runs over , not : both arguments must lie in their supports. This is where most convolution errors live.
- Convolving without independence. fails for dependent variables; with the true sum is the constant while the convolution returns a triangular density.
- Treating order statistics as independent. They never are, even for an independent sample. is , not a product of the two marginals.
- **Mixing up and in the order statistic density.** : the number of observations *below* carries the exponent . Check against the minimum ( must give ) and the maximum ( must give ).
- **Believing the median of uniforms has mean only by symmetry.** It does, but for even there is no single middle order statistic, and for in general the mean is , not .
- Multiplying mgfs of dependent variables. needs independence, and it is the entire content of the theorem. Equally, the converse is invalid: matching mgfs does not establish independence.
- **Reading as information.** It holds for every random variable, so it is a consistency check and never an identification. "The mgf exists" means finite on an *interval* around .
- **Using when the mgf is only finite on a half-line.** The exponential's mgf exists for , an interval containing , so derivatives at are legitimate. The Cauchy's exists only at , where no derivative can be formed at all.
- Assuming all moments determine the distribution. They do not — the log-normal family of the pitfall *Matching moments is not matching distributions* is the counterexample. Uniqueness needs the mgf finite on an interval.
- **Forgetting the in the pgf variance.** is , not , so .
- Composing a random sum's pgf the wrong way round. It is — the *outer* function counts the terms. is a different function and answers a different question.
- **Concluding a branching process survives because . ** makes survival possible, not certain; with the growth rate is and extinction still has probability .