4.9.5Probability Theory & Statistics

Moment generating function (MGF) — definition, use

1,795 words8 min readdifficulty · medium

WHAT is it?


WHY does etXe^{tX} generate moments?

The trick is the Taylor series of etXe^{tX}. Derive it from scratch:

etX=n=0(tX)nn!=1+tX+t2X22!+t3X33!+e^{tX} = \sum_{n=0}^{\infty} \frac{(tX)^n}{n!} = 1 + tX + \frac{t^2X^2}{2!} + \frac{t^3X^3}{3!} + \cdots

Take expectation of both sides (linearity of EE):

MX(t)=E[etX]=1+tE[X]+t22!E[X2]+t33!E[X3]+M_X(t) = E[e^{tX}] = 1 + tE[X] + \frac{t^2}{2!}E[X^2] + \frac{t^3}{3!}E[X^3] + \cdots


HOW to extract the nn-th moment

So:

  • MX(0)=1M_X(0) = 1 always (it's E[e0]=E[1]E[e^0]=E[1]). Always check this first.
  • MX(0)=E[X]M_X'(0) = E[X] (the mean).
  • MX(0)=E[X2]M_X''(0) = E[X^2], hence Var(X)=MX(0)(MX(0))2\operatorname{Var}(X) = M_X''(0) - \big(M_X'(0)\big)^2.
Figure — Moment generating function (MGF) — definition, use

Key PROPERTIES (and why they hold)


Worked Examples


Common Mistakes (Steel-manned)


When to USE the MGF (80/20)

The 20% that gives 80% of the value:

  1. Compute mean/variance without grinding integrals — just differentiate.
  2. Identify a distribution by recognizing its MGF (uniqueness).
  3. Find the distribution of a sum of independents (multiply MGFs).
  4. Prove limit theorems (CLT proof: show MGFs converge to et2/2e^{t^2/2}).

Recall Feynman: explain to a 12-year-old

Imagine XX is a mystery shape made of clay. To describe it you'd list facts: where its middle is, how wide, how lopsided — those are the moments. Writing them one by one is slow. The MGF is a magic box: you feed it a dial number tt, and it secretly stores ALL those facts at once, folded together. To pull out fact number nn, you "wiggle the dial nn times" (take nn derivatives) and then set the dial back to zero. Out pops exactly that one fact, clean. Bonus magic: if you glue two independent shapes together, the box of the glued shape is just the two boxes multiplied — that's why mathematicians love it.


Flashcards

Definition of the MGF of XX?
MX(t)=E[etX]M_X(t)=E[e^{tX}], finite in an interval around t=0t=0.
How do you get the nn-th moment from the MGF?
E[Xn]=MX(n)(0)E[X^n]=M_X^{(n)}(0), the nn-th derivative evaluated at t=0t=0.
Why does etXe^{tX} generate moments?
Its Taylor series is tnXnn!\sum \frac{t^n X^n}{n!}; taking EE makes the coefficient of tnt^n equal E[Xn]/n!E[X^n]/n!.
What is MX(0)M_X(0) for every random variable?
11, since E[e0]=E[1]=1E[e^{0}]=E[1]=1 — use it as a sanity check.
MGF of Y=aX+bY=aX+b?
MY(t)=ebtMX(at)M_Y(t)=e^{bt}M_X(at).
MGF of X+YX+Y when XYX\perp Y?
MX+Y(t)=MX(t)MY(t)M_{X+Y}(t)=M_X(t)M_Y(t) (multiplication, requires independence).
Variance in terms of the MGF?
Var(X)=MX(0)(MX(0))2\operatorname{Var}(X)=M_X''(0)-\big(M_X'(0)\big)^2.
MGF of Exponential(λ)(\lambda) and its domain?
MX(t)=λλtM_X(t)=\frac{\lambda}{\lambda-t} for t<λt<\lambda.
MGF of Normal(μ,σ2)(\mu,\sigma^2)?
MX(t)=exp(μt+12σ2t2)M_X(t)=\exp(\mu t+\tfrac12\sigma^2 t^2).
MGF of Binomial(n,p)(n,p) and why?
(1p+pet)n(1-p+pe^t)^n, because it is a sum of nn independent Bernoulli MGFs multiplied together.
Why might an MGF not exist?
If E[etX]=E[e^{tX}]=\infty near 00 (heavy tails, e.g. Cauchy); then use the characteristic function instead.
What does uniqueness of MGF give you?
If two MGFs agree on an interval around 0, the two distributions are identical.

Connections

  • Probability Distributions — every named distribution has a signature MGF.
  • Expectation and Variance — MGF derivatives recover these directly.
  • Characteristic Function — the E[eitX]E[e^{itX}] cousin that always exists.
  • Central Limit Theorem — proved via convergence of MGFs to et2/2e^{t^2/2}.
  • Independence (Probability) — the condition behind the multiplication rule.
  • Taylor Series — the engine that makes moments "fall out."
  • Cumulant Generating FunctionlnMX(t)\ln M_X(t), generating cumulants.

Concept Map

packed into

expand via

take E linearity

match coefficients

n=0 gives

n=1,2 give

property

property, needs independence

property

convolution to multiplication

MGF M_X t = E e^tX

Infinite moments E X^n

Taylor series of e^tX

M_X t = sum t^n E X^n over n!

E X^n = nth deriv at 0

M_X 0 = 1 sanity check

Mean and Variance

Shift and scale e^bt M_X at

Sum of independents product of MGFs

Uniqueness identifies distribution

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, kisi bhi random variable XX ke paas bahut saare "moments" hote hain — E[X]E[X] (mean), E[X2]E[X^2], E[X3]E[X^3] waghera — jo uski poori shape batate hain. Inko alag-alag yaad rakhna mushkil hai. MGF ek jadui dabba hai: MX(t)=E[etX]M_X(t)=E[e^{tX}]. Iska kamaal ye hai ki saare moments isme ek saath pack ho jaate hain. Kyun? Kyunki etXe^{tX} ko Taylor series me kholo to 1+tX+t2X22!+1+tX+\frac{t^2X^2}{2!}+\dots milta hai, aur expectation lene par har tnt^n ke aage E[Xn]/n!E[X^n]/n! baith jaata hai.

Moment nikalna ho to bas t=0t=0 par derivative lo: E[Xn]=MX(n)(0)E[X^n]=M_X^{(n)}(0). Ek baar derivative = mean, do baar = E[X2]E[X^2] (aur usse variance). Sabse pehle hamesha check karo MX(0)=1M_X(0)=1 — agar nahi aaya to calculation me galti hai. Yaad rakho: moment dial ke zero par nikalta hai, t=1t=1 par nahi — ye sabse common galti hai.

Do superpowers hain MGF ke. Pehla: Y=aX+bY=aX+b ho to MY(t)=ebtMX(at)M_Y(t)=e^{bt}M_X(at) — bas shift aur scale. Doosra (sabse useful): agar XX aur YY independent hain to MX+Y(t)=MX(t)MY(t)M_{X+Y}(t)=M_X(t)M_Y(t) — addition ka kaam multiplication ban jaata hai! Isi se Binomial = nn Bernoulli ka MGF multiply karke ek line me nikal jaata hai, aur isi trick se Central Limit Theorem prove hota hai.

Lekin yaad rakho — har variable ka MGF exist nahi karta (jaise Cauchy ka, kyunki integral infinite ho jaata hai). Aise case me characteristic function E[eitX]E[e^{itX}] use karte hain jo hamesha exist karta hai. Exam me MGF ko shortcut samjho: integration ki jagah differentiation se mean/variance, aur distribution pehchanne ka tool.

Go deeper — visual, from zero

Test yourself — Probability Theory & Statistics

Connections