Skip to content

Actuarial Statistics · Generating functions

Sums of Random Variables and Compound Distributions Using MGFs

Updated 11 October 2026 · Fact-checked

For independent variables, the MGF of a sum is the product of the individual MGFs. For a compound sum S = X₁ + … + X_N, with N independent of the Xs, M_S(t) = M_N(ln M_X(t)). Differentiate at t = 0 to get moments, or match the MGF to a known distribution.

Understand Sums of Random Variables and Compound Distributions

A generating function turns a hard operation into an easy one. Adding independent random variables needs a convolution, which is slow. Multiplying their MGFs is quick.

The MGF of X is M_X(t) = E[e^(tX)]. If X and Y are independent, then E[e^(t(X+Y))] = E[e^(tX)] × E[e^(tY)]. So M_(X+Y)(t) = M_X(t) × M_Y(t). This extends to any number of independent variables. The MGF identifies the distribution uniquely when it exists in an interval around 0. So if you recognise the product, you know the distribution of the sum.

A compound distribution is a random sum S = X₁ + X₂ + … + X_N. Here N is the number of claims and each X is a claim size. You assume the Xs are independent and identically distributed, and independent of N. If N = 0, then S = 0.

To find M_S(t), condition on N. Given N = n, the MGF of S is [M_X(t)]ⁿ. So M_S(t) = E[(M_X(t))^N]. That is the PGF of N evaluated at M_X(t): M_S(t) = G_N(M_X(t)). If you know the MGF of N instead, G_N(s) = M_N(ln s), which gives M_S(t) = M_N(ln M_X(t)).

This is the key link for the exam. The claim count enters through its PGF. The claim size enters through its MGF.

Key rules to remember

MGF definition
M_X(t) = E[e^(tX)]
Valid for t in an interval around 0 where the expectation is finite.
Sum of independent variables
M_(X₁+…+Xₙ)(t) = M_X₁(t) × … × M_Xₙ(t)
Needs independence. If also identically distributed, the result is [M_X(t)]ⁿ.
Linear transformation
M_(aX+b)(t) = e^(bt) × M_X(at)
Use it for means and scaled variables.
Moments from the MGF
E[Xᵏ] = M_X⁽ᵏ⁾(0)
The kth derivative at t = 0. Variance = M''(0) − [M'(0)]².
PGF of a count
G_N(s) = E[s^N]
G_N(s) = M_N(ln s).
MGF of a compound sum
M_S(t) = G_N(M_X(t)) = M_N(ln M_X(t))
S = X₁ + … + X_N, Xs iid and independent of N.
Compound Poisson MGF
M_S(t) = exp{λ[M_X(t) − 1]}
N ~ Poisson(λ), since G_N(s) = exp{λ(s − 1)}.
Compound mean and variance
E[S] = E[N]E[X]; Var(S) = E[N]Var(X) + Var(N)(E[X])²
For compound Poisson, Var(S) = λE[X²].

How to solve Sums of Random Variables and Compound Distributions questions

Use this method for any question on sums or compound distributions.

  1. 1Decide whether the sum has a fixed number of terms or a random number. Fixed means multiply MGFs. Random means a compound distribution.
  2. 2Check the assumptions: independence between the Xs, and for a compound sum, independence of N from the Xs. State them in your answer.
  3. 3Write down the MGF of X (the claim size or the single term) from the standard results.
  4. 4For a fixed sum, multiply the MGFs. For a compound sum, write the PGF of N and substitute M_X(t) for s.
  5. 5Simplify. Compare with a standard MGF to name the distribution and its parameters.
  6. 6If asked for moments, differentiate at t = 0, or use the mean and variance formulas as a check.
  7. 7State the domain of t where the MGF is valid if the question asks for it, and give a clear final answer.

Quickest way: Product rule and PGF substitution

When to use it: Use when the question asks for the distribution, mean or variance of a sum and the standard MGFs are known.

  1. Fixed number of independent terms: multiply the MGFs and look for a recognisable form.
  2. Random number of terms: write M_S(t) = G_N(M_X(t)).
  3. For the mean and variance, skip differentiation and use E[N]E[X] and E[N]Var(X) + Var(N)(E[X])².
  4. For compound Poisson, remember Var(S) = λE[X²] and E[S] = λE[X].
  5. Recall common reproductive results: sums of independent Poissons, normals and gammas with the same rate stay in the same family.

Common mistakes in Sums of Random Variables and Compound Distributions

  • Multiplying MGFs when the variables are not independent.

    The product rule is memorised without its condition.

    Fix: Write 'by independence' before every product. If the variables are dependent, the product rule does not hold in general.

  • Writing the compound MGF as M_N(M_X(t)).

    Mixing up the PGF and the MGF of N.

    Fix: The correct form is G_N(M_X(t)) = M_N(ln M_X(t)). Check by setting t = 0: M_X(0) = 1, so M_S(0) = G_N(1) = 1.

  • Treating the sum of n iid variables as n times one variable.

    Confusing nX with X₁ + … + Xₙ.

    Fix: The MGF of nX is M_X(nt). The MGF of the sum of n iid copies is [M_X(t)]ⁿ. They have different variances.

  • Using Var(S) = E[N]Var(X) and forgetting the second term.

    The variance of N is overlooked when N is random.

    Fix: Use Var(S) = E[N]Var(X) + Var(N)(E[X])². Both sources of randomness count.

  • Adding means of distributions with different rates and claiming a gamma result.

    Over-generalising the reproductive property of gammas.

    Fix: Independent gammas add their shape parameters only if the rate is the same. Check the MGF form (λ/(λ − t))^α.

  • Ignoring the case N = 0 when working from first principles.

    The sum is assumed to have at least one term.

    Fix: Include P(N = 0). In the MGF approach it is handled automatically because the PGF includes the s⁰ term.

Worked examples

Example 1

X ~ Poisson(2), Y ~ Poisson(3) and X, Y are independent. Use MGFs to find the distribution of X + Y.

Show the solution
  1. The MGF of Poisson(μ) is exp{μ(eᵗ − 1)}.
  2. M_X(t) = exp{2(eᵗ − 1)} and M_Y(t) = exp{3(eᵗ − 1)}.
  3. By independence, M_(X+Y)(t) = exp{2(eᵗ − 1)} × exp{3(eᵗ − 1)}.
  4. Add the exponents: M_(X+Y)(t) = exp{5(eᵗ − 1)}.
  5. This is the MGF of Poisson(5). The MGF identifies the distribution uniquely.

Answer: X + Y ~ Poisson(5).

Example 2

Annual claim numbers N ~ Poisson(4). Each claim size X is exponential with mean ₹50,000, independent of N and of other claims. Let S be the total annual claims. Find M_S(t), E[S] and Var(S).

Show the solution
  1. Let the rate of X be θ = 1/50,000. Then M_X(t) = θ/(θ − t), for t < θ.
  2. N is Poisson(4), so G_N(s) = exp{4(s − 1)}.
  3. M_S(t) = G_N(M_X(t)) = exp{4[θ/(θ − t) − 1]} = exp{4t/(θ − t)}, for t < θ.
  4. E[S] = λE[X] = 4 × 50,000 = ₹2,00,000.
  5. For compound Poisson, Var(S) = λE[X²]. For the exponential, E[X²] = 2/θ² = 2 × 50,000² = 5,000,000,000.
  6. Var(S) = 4 × 5,000,000,000 = 20,000,000,000.
  7. Check with the general formula: E[N]Var(X) + Var(N)(E[X])² = 4 × 2,500,000,000 + 4 × 2,500,000,000 = 20,000,000,000. This matches.
  8. The standard deviation is √20,000,000,000 ≈ ₹1,41,421.

Answer: M_S(t) = exp{4t/(θ − t)} with θ = 1/50,000 and t < θ. E[S] = ₹2,00,000. Var(S) = 2 × 10¹⁰ (rupees squared), so the standard deviation is about ₹1,41,421.

Exam tips

  • Write the independence assumptions in words first. Examiners give marks for stating them.
  • For compound questions, show M_S(t) = G_N(M_X(t)) before substituting. The line earns method marks even if the algebra slips.
  • Cross-check any derived mean and variance with E[N]E[X] and the variance formula. It takes 30 seconds and catches errors.
  • Know the standard MGFs for Poisson, binomial, geometric, normal, exponential and gamma. You need them without looking them up.
  • In MCQs, test candidate answers at t = 0. A valid MGF must equal 1 there.

Practice questions from Generating functions

Sums of Random Variables and Compound Distributions in other exams

The same ground in other exams, if you are preparing for more than one or want another angle on it.

Sums of Random Variables and Compound Distributions: frequently asked questions

How do I find the MGF of a sum of independent random variables?

Multiply the individual MGFs. This works because E[e^(t(X+Y))] factorises when X and Y are independent. If the product matches a known MGF, you have identified the distribution of the sum.

How do I derive the MGF of a compound Poisson distribution?

Condition on N. Given N = n, the MGF of the sum is [M_X(t)]ⁿ. Averaging over N ~ Poisson(λ) gives E[(M_X(t))^N] = exp{λ(M_X(t) − 1)}.

Why is the compound MGF written with the PGF of N?

Because the conditional MGF is [M_X(t)]ⁿ, and E[sᴺ] with s = M_X(t) is the PGF of N. Equivalently you can write M_N(ln M_X(t)).

Do the claim sizes need to be identically distributed?

For the standard compound formula, yes: the Xs must be iid and independent of N. If they are not identical, you cannot write [M_X(t)]ⁿ and the formula does not apply directly.