Moment Generating Function Calculator

This moment generating function calculator gives M(t) for five common distributions and the mean and variance it implies.

Checks on your data

  • M(0) is always 1. If the MGF exists on an open interval around 0, it determines the distribution uniquely.

Results

M(0.5)
5.919495
Formula
M(t) = (1 − p + p·eᵗ)ⁿ
Mean E[X] = M′(0)
3
Variance Var(X) = M″(0) − M′(0)²
2.1
Standard deviation
1.4491377
Valid for
all real t
The moment generating function M(t)
020,00040,000-2-1012tt
Show step-by-step solution
  1. Distribution parameters: n = 10, p = 0.3.
  2. M(t) = (1 − p + p·eᵗ)ⁿ.
  3. Evaluate at t = 0.5: M = 5.919495.
  4. The first derivative at 0 gives the mean (3; a numeric check of M′(0) gives 3). The second derivative at 0 minus the mean squared gives the variance (2.1).
DefinitionE[eᵗˣ]
M(0)1
MeanM′(0)
VarianceM″(0) − M′(0)²

What Is Moment Generating Function?

The moment generating function of a random variable X is M(t) = E[e^(tX)]. Differentiating it at t = 0 gives the moments: M′(0) is the mean and M″(0) is E[X²].

Pick a distribution, enter its parameters and a value of t. The calculator returns M(t), the closed-form formula, the mean, the variance and a plot of M(t).

The exponential MGF exists only for t below the rate, so the calculator checks the domain before it evaluates.

How to Use the Moment Generating Function Calculator

  1. Pick the distribution.
  2. Enter its parameters.
  3. Enter t.
  4. Read M(t), the mean and the variance.

Moment Generating Function Formula

Definition

M(t)=E[etX]M(t)=E\left[e^{tX}\right]

Binomial

M(t)=(1−p+pet)nM(t)=(1-p+pe^t)^n

Poisson

M(t)=eλ(et−1)M(t)=e^{\lambda(e^t-1)}

Normal

M(t)=eμt+σ2t2/2M(t)=e^{\mu t+\sigma^2t^2/2}

Exponential

M(t)=λλ−t, t<λM(t)=\frac{\lambda}{\lambda-t},\ t<\lambda

Moment Generating Function Variables Explained

SymbolMeaningNotes
M(t)Moment generating function
tReal argument
M′(0)Mean E[X]
M″(0)E[X²]

Moment Generating Function Worked Example

For a binomial with n = 10 and p = 0.3, M(t) = (0.7 + 0.3eᵗ)¹⁰. At t = 0.5, eᵗ = 1.6487, so M = (0.7 + 0.4946)¹⁰ = 1.1946¹⁰ ≈ 5.92. The mean is np = 3 and the variance is np(1 − p) = 2.1.

With the example values loaded in the calculator above, the steps are:

  1. Distribution parameters: n = 10, p = 0.3.
  2. M(t) = (1 − p + p·eᵗ)ⁿ.
  3. Evaluate at t = 0.5: M = 5.919495.
  4. The first derivative at 0 gives the mean (3; a numeric check of M′(0) gives 3). The second derivative at 0 minus the mean squared gives the variance (2.1).

Result: M(0.5) = 5.919495.

How to Read an MGF Result

M(t) = E[e^(tX)] summarises every moment of a distribution in one function. For a binomial with n = 10 and p = 0.3, M(0.5) = (0.7 + 0.3e^0.5)¹⁰ ≈ 5.92. The value itself is rarely the goal. The derivatives at t = 0 are what matter: M′(0) is the mean 3 and M″(0) − M′(0)² is the variance 2.1.

The chart shows M(t) rising through M(0) = 1. If an MGF exists on an interval around 0, it identifies the distribution uniquely, which is why MGFs are used to prove results about sums of independent variables.

Where Moment Generating Function Is Used

Checking textbook formulas

Compare M(t) for binomial, Poisson, normal, exponential and uniform distributions.

Mean and variance

Confirm E[X] and Var(X) from the derivatives at 0.

Sums of variables

Multiply MGFs to get the MGF of a sum of independent variables.

Exam practice

Check evaluations of M(t) at a chosen t.

Common Moment Generating Function Mistakes to Avoid

  • M(0) is always 1. Use it as a quick check.
  • The exponential MGF exists only for t below the rate λ. The calculator rejects other values.
  • Differentiate once for the mean, and twice for E[X²]. The variance then needs the mean squared subtracted.
  • The MGF of a sum of independent variables is the product of their MGFs.

Moment Generating Function Terms and Definitions

Moment
E[Xᵏ], the expected value of the k-th power of X.

Moment Generating Function FAQs

What is a moment generating function?

It is M(t) = E[e^(tX)], viewed as a function of t. Its derivatives at t = 0 give the moments of the distribution.

How do you find the mean from the MGF?

Differentiate M(t) once and set t = 0. The result M′(0) is E[X].

How do you find the variance from the MGF?

Compute M″(0) − (M′(0))². The first term is E[X²].

Does every distribution have an MGF?

No. The Cauchy distribution has none, and some heavy-tailed distributions have an MGF only at t = 0.

Related calculators

Last updated 2026-11-09. See our disclaimer.