MATH 5010 · Section 4

Expectation, Moments, and Moment-Generating Functions

An interactive lecture page for understanding expected value as long-run average, moments as distribution summaries, and MGFs as a compact tool for extracting moments.

1. Learning goals

By the end, students should be able to compute and interpret expectations, moments, variance, and MGFs.

Expectation

Use sums or integrals to compute the theoretical average.

$$E[X]=\sum_x x p(x),\qquad E[X]=\int_{-\infty}^{\infty}x f(x)\,dx$$

Moments

Summarize location, spread, and shape of a distribution.

$$E[X^r],\qquad Var(X)=E[X^2]-(E[X])^2$$

MGF

Differentiate at zero to obtain moments when the MGF exists near zero.

$$M_X(t)=E[e^{tX}],\qquad E[X^r]=M_X^{(r)}(0)$$

2. Interactive expectation calculator

Enter a finite probability mass function. The probabilities are automatically normalized if they do not sum to one.

Discrete random variable

Bar chart of the PMF

The blue vertical line marks $E[X]$. The spread around this line is measured by variance.

3. Moments and variance

Moments are expectations of powers of the random variable.

Moment table

Teaching note

The first raw moment is the mean. The second raw moment gives variance after subtracting the square of the mean. Higher moments describe asymmetry and tail behavior.

Standard normal vs a discrete distribution with matching moments

Homework-style fact: a finite collection of moments may not determine the distribution.

$$X\sim N(0,1),\qquad P(Y=\sqrt3)=P(Y=-\sqrt3)=\frac16,\quad P(Y=0)=\frac23$$

4. Moment-generating function explorer

Select a distribution, change parameters, and compare the MGF with the moments.

Choose a distribution

Graph of $M_X(t)$ near 0

5. Mean vs median through loss functions

The mean minimizes squared error; the median minimizes absolute error.

Distribution: $f(x)=3x^2$, $0

This example has mean $E[X]=3/4$ and median $m=2^{-1/3}\approx 0.7937$.

In-class prompt: Move $a$. Which loss is smallest near the mean? Which is smallest near the median?

Loss curves

6. Course examples

Short interactive computations inspired by Section 4 homework problems.

Uniform and triangular MGFs

Poisson threshold

Find the smallest mean λ such that $P(X\ge 2)>0.99$ for $X\sim Poisson(\lambda)$.

Pareto mean and variance

$$f(x)=\frac{\beta\alpha^\beta}{x^{\beta+1}},\quad x>\alpha,\qquad E[X]=\frac{\beta\alpha}{\beta-1}\; (\beta>1),\qquad Var(X)=\frac{\alpha^2\beta}{(\beta-2)(\beta-1)^2}\; (\beta>2).$$

7. Quick check

Use these as short in-class questions or self-study prompts.

Question 1

If $M_X(t)=e^{3t+2t^2}$, what are $E[X]$ and $Var(X)$?

Question 2

For $X\sim Poisson(\lambda)$, what is $M_X(t)$?

Question 3

Which value minimizes $E[(X-a)^2]$?