Foundations to Frontier
Tests
A. Mathematical Foundations › A4 Probability Theory › Theory

Moment-Generating and Characteristic Functions

Pack a whole distribution into one function. The MGF M(t) = E e^{tX} holds every moment in its Taylor series, turns sums of independent variables into products, and powers the Chernoff bound. The characteristic function φ(t) = E e^{itX} always exists (even for the Cauchy), determines the distribution uniquely, inverts back to the density by Fourier transform, and is the cleanest route to the central limit theorem. Cumulants, the derivatives of log M, simply add.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

A barcode for a distribution

A supermarket barcode packs everything about a product into one stripe pattern. The moment-generating function does the same for a random variable. It’s a single curve, M(t)M(t), and from it you can read the average, the spread, the lopsidedness, and every other moment. Two different distributions never share the same curve, so the curve identifies the distribution.

Its best trick is with sums. Adding independent random numbers is messy for densities (you have to convolve them). With MGFs, you just multiply.

One function that holds every moment: the MGF and the characteristic function
M(0) = 1 · from derivatives at 0: mean M′(0) = 2.0000 (exact 2.0000), variance M″(0) − M′(0)² = 2.0000 (exact 2.0000)
Orange: M(t) for the sum of n copies, which is M(t)ⁿ. Blue dashed: the tangent at t = 0, whose slope is the mean. Its curvature gives E X², and so on: M(t) = Σ E[Xᵏ] tᵏ/k!. Increasing n multiplies the MGFs, and the mean and variance scale by n.
Why engineers care

How likely is it that 60 bits out of 2000 get corrupted on a telemetry link? How much total delay do 50 network hops add? MGFs answer questions about sums and give the sharpest simple tail bounds (Chernoff bounds), which are used in communication design, reliability analysis and the theory of machine learning.

📝 Quick check (Level 0)
0/3 answered
  1. 1. For independent X and Y, the MGF of X + Y is…
  2. 2. Can two different distributions have the same MGF (near 0)?
  3. 3. The MGF's slope at t = 0 is…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

The moment-generating function

MX(t)=E[etX]=∑k≥0tkk!E[Xk]M_X(t) = \mathbb E[e^{tX}] = \sum_{k\ge0}\frac{t^k}{k!}\mathbb E[X^k]

so MX(k)(0)=E[Xk]M_X^{(k)}(0) = \mathbb E[X^k] whenever MM is finite near 0. It always satisfies M(0)=1M(0) = 1.

Distribution M(t)M(t)
Bernoulli(p) 1−p+pet1 - p + pe^t
Binomial(n, p) (1−p+pet)n(1 - p + pe^t)^n
Poisson(λ) eλ(et−1)e^{\lambda(e^t - 1)}
Exponential(λ) λλ−t, t<λ\frac{\lambda}{\lambda - t},\ t<\lambda
Gamma(k, λ) (λλ−t)k\big(\frac{\lambda}{\lambda - t}\big)^k
Normal(μ, σ²) eμt+σ2t2/2e^{\mu t + \sigma^2t^2/2}

Two key properties

  1. Affine maps: MaX+b(t)=ebtMX(at)M_{aX + b}(t) = e^{bt}M_X(at).
  2. Independent sums: MX+Y(t)=MX(t)MY(t)M_{X+Y}(t) = M_X(t)M_Y(t), because E[etXetY]=E[etX]E[etY]\mathbb E[e^{tX}e^{tY}] = \mathbb E[e^{tX}]\mathbb E[e^{tY}].

So the sum of independent Poissons is Poisson, the sum of kk Exp(λ) variables is Gamma(k, λ), and the sum of independent normals is normal, with means and variances adding.

📝 Quick check (Level 1)
0/3 answered
  1. 1. M(0) equals…
  2. 2. Poisson(2) + Poisson(3) (independent) is…
  3. 3. The MGF of Exp(λ) is finite for…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

When MGFs fail: characteristic functions

Heavy-tailed variables (Cauchy, Student-t, log-normal) have M(t)=∞M(t) = \infty for all t≠0t\ne0. The characteristic function

φX(t)=E[eitX]=E[cos⁡tX]+i E[sin⁡tX]\varphi_X(t) = \mathbb E[e^{itX}] = \mathbb E[\cos tX] + i\,\mathbb E[\sin tX]

always exists, since ∣eitX∣=1\lvert e^{itX}\rvert = 1. It has φ(0)=1\varphi(0) = 1, ∣φ(t)∣≤1\lvert\varphi(t)\rvert\le1, and it is uniformly continuous. It’s the Fourier transform of the density. For example, the normal has eiμt−σ2t2/2e^{i\mu t - \sigma^2t^2/2} and the Cauchy has e−∣t∣e^{-\lvert t\rvert}. If E∣X∣k<∞\mathbb E\lvert X\rvert^k<\infty, then φ(k)(0)=ikE[Xk]\varphi^{(k)}(0) = i^k\mathbb E[X^k].

Uniqueness and inversion. φ\varphi determines the distribution. If ∫∣φ∣<∞\int\lvert\varphi\rvert<\infty, the density is

f(x)=12π∫−∞∞e−itxφ(t) dtf(x) = \frac1{2\pi}\int_{-\infty}^\infty e^{-itx}\varphi(t)\,dt

Cumulants

The cumulant generating function K(t)=log⁡M(t)=∑jκjtj/j!K(t) = \log M(t) = \sum_j\kappa_jt^j/j! has κ1=μ\kappa_1 = \mu, κ2=σ2\kappa_2 = \sigma^2, and κ3=E(X−μ)3\kappa_3 = \mathbb E(X - \mu)^3. Because log turns products into sums, cumulants of independent sums add: κj(Sn)=nκj(X)\kappa_j(S_n) = n\kappa_j(X). Every Poisson cumulant equals λ\lambda. A normal has κj=0\kappa_j = 0 for j≥3j\ge3. The skewness of an average falls like κ3/(σ3n)\kappa_3/(\sigma^3\sqrt n), a first glimpse of the CLT.

🐍 Exercise 1: moments, cumulants and sums from the MGF
Recover raw moments by finite differences of M at 0 and cumulants from log M. Show that every Poisson cumulant equals λ, that MGFs multiply for sums, and that the empirical MGF of samples matches.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Which always exists?
  2. 2. The Cauchy's characteristic function is…
  3. 3. For a sum of n iid variables, κ₃ is…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Proof that MGFs give moments

Suppose M(t)<∞M(t)<\infty for ∣t∣<δ\lvert t\rvert<\delta. Then e∣tx∣≤etx+e−txe^{\lvert tx\rvert}\le e^{tx} + e^{-tx} is integrable, so ∑k∣tX∣k/k!=e∣tX∣\sum_k\lvert tX\rvert^k/k! = e^{\lvert tX\rvert} has finite expectation.

  1. Swap sum and expectation. By dominated convergence (A4.3-1), M(t)=∑ktkk!E[Xk]M(t) = \sum_k\frac{t^k}{k!}\mathbb E[X^k]. All moments are finite.
  2. Read off the moments. A power series can be differentiated term by term inside its radius, so M(k)(0)=E[Xk]M^{(k)}(0) = \mathbb E[X^k]. ∎

Lévy’s continuity theorem

Xn→XX_n\to X in distribution if and only if φXn(t)→φX(t)\varphi_{X_n}(t)\to\varphi_X(t) for every tt (A4.3-8). This turns limit theorems into calculus. For example, for the CLT you show φnXˉ(t)=φ(t/n)n→e−t2/2\varphi_{\sqrt n\bar X}(t) = \varphi(t/\sqrt n)^n\to e^{-t^2/2} (A4.3-5).

Moments don’t always determine a distribution

The log-normal has all moments finite, yet other distributions share every one of them (Heyde, 1963). Its MGF is infinite for t>0t > 0, so the uniqueness theorem doesn’t apply. The rule: if MM is finite in a neighbourhood of 0, the distribution is determined. Characteristic functions always determine it.

Exercise 3.1: Show the mean of n iid Cauchy variables is standard Cauchy

φXˉ(t)=φ(t/n)n=(e−∣t∣/n)n=e−∣t∣\varphi_{\bar X}(t) = \varphi(t/n)^n = (e^{-\lvert t\rvert/n})^n = e^{-\lvert t\rvert}. By uniqueness, Xˉ\bar X has the same distribution as one sample. Averaging doesn’t help: there’s no law of large numbers without a mean.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Lévy's continuity theorem links convergence in distribution with…
  2. 2. Do equal moments of all orders guarantee the same distribution?
  3. 3. The average of 100 standard Cauchys is…

Level 4: Expert

★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.

Chernoff bounds and large deviations

For any t>0t > 0, Markov’s inequality applied to etSe^{tS} gives P(S≥a)≤e−taMS(t)P(S\ge a)\le e^{-ta}M_S(t). Optimizing over tt gives the Chernoff bound. For S∼Binomial(n,p)S\sim\text{Binomial}(n, p) the optimum is

P(S≥na)≤e−nKL⁡(a ∥ p),a>pP(S\ge na)\le e^{-n\operatorname{KL}(a\,\|\,p)}, \qquad a > p

The exponent is exact: 1nlog⁡P(S≥na)→−KL⁡(a ∥ p)\frac1n\log P(S\ge na)\to-\operatorname{KL}(a\,\|\,p) (Cramér’s theorem). Chebyshev’s bound only decays polynomially. Bit-error and packet-loss budgets for deep-space links, false-alarm rates of detectors, and generalization bounds in learning theory all come from this one calculation.

🐍 Exercise 2 (research): Chernoff vs exact vs Chebyshev for bit errors
For a 2000-bit frame with bit-error rate 1%, compute the exact tail P(S ≥ k) (in log space), the optimized Chernoff bound from the Bernoulli MGF, and Chebyshev's bound. Verify that Chernoff is valid, beats Chebyshev by orders of magnitude in the far tail, and that its exponent equals n·KL(k/n ‖ p).

MGFs and characteristic functions in AI, robotics and aerospace

  • Learning theory. Hoeffding, Bernstein and the PAC-Bayes bounds are all Chernoff arguments that bound an MGF (A4.3-6, A4.3-7).
  • Communications. Error exponents for channel coding (Gallager, 1965) and link budgets for deep-space networks rest on MGF bounds of noise and decoding errors.
  • Risk-sensitive control. Minimizing 1θlog⁡E[eθ cost]\frac1\theta\log\mathbb E[e^{\theta\,\text{cost}}] (an MGF of the cost) trades mean against variance and higher cumulants (Jacobson, 1973; Whittle, 1981). This is used for conservative spacecraft and robot planning.
  • Random features. Random Fourier features approximate a shift-invariant kernel as the characteristic function of a spectral distribution, k(x−y)=Eω[eiω⊤(x−y)]k(x - y) = \mathbb E_\omega[e^{i\omega^\top(x - y)}] (Rahimi and Recht, 2007).
  • Phase noise and estimation. Averages of eiθe^{i\theta} are characteristic functions. Circular statistics for headings and phase uses them directly.

References

  1. W. Feller (1971). An Introduction to Probability Theory and Its Applications, Vol. II, Ch. XV. Wiley.
  2. P. Billingsley (1995). Probability and Measure, 3rd ed., Sec. 21 and 26. Wiley.
  3. H. Chernoff (1952). “A measure of asymptotic efficiency for tests of a hypothesis based on the sum of observations.” Annals of Mathematical Statistics, 23(4).
  4. H. Cramér (1938). “Sur un nouveau théorème-limite de la théorie des probabilités.” Actualités Scientifiques et Industrielles, 736.
  5. A. Dembo, O. Zeitouni (1998). Large Deviations Techniques and Applications, 2nd ed. Springer.
  6. C. C. Heyde (1963). “On a property of the lognormal distribution.” JRSS B, 25(2).
  7. R. Gallager (1965). “A simple derivation of the coding theorem and some applications.” IEEE Transactions on Information Theory, 11(1).
  8. D. Jacobson (1973). “Optimal stochastic linear systems with exponential performance criteria.” IEEE Transactions on Automatic Control, 18(2).
  9. A. Rahimi, B. Recht (2007). “Random features for large-scale kernel machines.” NeurIPS.
  10. P. Lévy (1925). Calcul des probabilités. Gauthier-Villars.