Exam PRandom variablesFree to read

Moment generating functions

M(t) = E[e^{tX}] encodes every moment in its derivatives at zero, and turns sums of independent variables into products.

The formulas

Definition
MX(t)=E ⁣[etX]M_X(t) = E\!\left[e^{tX}\right]
Moments
MX(k)(0)=E[Xk]M^{(k)}_X(0) = E[X^{k}]
Sum of independents
MX+Y(t)=MX(t)MY(t)M_{X+Y}(t) = M_X(t)M_Y(t)
Linear transform
MaX+b(t)=ebtMX(at)M_{aX+b}(t) = e^{bt}M_X(at)
Uniqueness
MX=MY⇒X=dYM_X = M_Y \Rightarrow X \stackrel{d}{=} Y

Where it comes from

  1. Expand etX=∑ktkXkk!e^{tX} = \sum_k \frac{t^k X^k}{k!} and take expectations term by term: the coefficient of tk/k!t^k/k! is E[Xk]E[X^k].
  2. Differentiating kk times and setting t=0t=0 therefore isolates the kkth moment.
  3. For independent XX and YY, E[et(X+Y)]=E[etX]E[etY]E[e^{t(X+Y)}] = E[e^{tX}]E[e^{tY}] - the factorisation that makes MGFs worth using at all.

Worked example

A random variable has MGF M(t)=(0.3+0.7et)8M(t) = \left(0.3 + 0.7e^{t}\right)^{8}. Find its variance.

  1. This is the MGF of a binomial with n=8n = 8 and p=0.7p = 0.7, by inspection of (1−p+pet)n\left(1-p+pe^{t}\right)^{n}.
  2. Uniqueness of the MGF makes that identification exact - no differentiation needed.
  3. Var⁡(X)=np(1−p)=8(0.7)(0.3)\operatorname{Var}(X) = np(1-p) = 8(0.7)(0.3).
  4. Var⁡(X)=1.68\operatorname{Var}(X) = 1.68.

Answer: 1.68

This answer is recomputed from the site’s own interest-theory and probability functions every time the test suite runs, so the page and the mathematics cannot drift apart.

Memory hooks

  • Recognise the shape before you differentiate. Most MGF questions are really 'name this distribution'.
  • M(0) = 1 always. If your MGF fails that, you have made an algebra slip.

Traps

  • Forgetting that M'(0) is E[X], not the variance.
  • Multiplying MGFs of variables that are not independent.

2 solved sample questions

From the free samples in the question bank, solved in full. They never rotate and they are never gated.

  1. Exam PMoment generating functionsCore
    A random variable has M(t)=e3t+8t2M(t) = e^{3t + 8t^{2}}. Find its variance.
    1. A3.00003.0000
    2. B8.00008.0000
    3. C9.00009.0000
    4. D16.000016.0000
    5. E64.000064.0000

    Solution

    1. The normal MGF is exp⁡(μt+σ2t22)\exp\left(\mu t + \dfrac{\sigma^{2}t^{2}}{2}\right), so match coefficients.
    2. The tt coefficient gives μ=3\mu = 3.
    3. The t2t^{2} coefficient gives σ22=8\dfrac{\sigma^{2}}{2} = 8, so σ2=16\sigma^{2} = 16.
    4. The variance is 16. Recognising the shape is far faster than differentiating twice.

    Trap. Reading the t² coefficient as the variance and answering 8.

  2. Exam PMoment generating functionsExam level
    A variable has M(t)=0.2+0.3et+0.5e3tM(t) = 0.2 + 0.3e^{t} + 0.5e^{3t}. Find E[X]E[X].
    1. A0.80000.8000
    2. B1.50001.5000
    3. C1.80001.8000
    4. D2.00002.0000
    5. E3.00003.0000

    Solution

    1. This MGF is a weighted sum of etxe^{tx} terms, so it describes a discrete variable taking values 0, 1 and 3 with probabilities 0.2, 0.3 and 0.5.
    2. Read the distribution straight off the exponents and coefficients.
    3. E[X]=0(0.2)+1(0.3)+3(0.5)E[X] = 0(0.2) + 1(0.3) + 3(0.5).
    4. =1.8= 1.8. Differentiating and setting t=0t = 0 gives the same, but reading it off is faster and less error-prone.

    Trap. Differentiating carelessly and dropping the factor of 3 from the e^{3t} term.

Drill this topic: Moment generating functions has 12 questions, 2 of them solved free on that page, and the full question bank has 400. The drills are part of Premium. Every free sample and today’s mixed round stay free.

Related