Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Moment Generating Function (MGF)

Lesson 9 of 11 in the free Probability and Statistics- BCA-DS-23-204 notes on Siksha Sarovar, written by Rohit Jangra.

4. Moment Generating Function (MGF)

Concept

Similar to PGF, but works for both discrete and continuous variables. It uses the exponential function $e^{tX}$.

Definition

$$ M_X(t) = E[e^{tX}] $$

  • Discrete: $M_X(t) = \sum e^{tx} P(x)$
  • Continuous: $M_X(t) = \int e^{tx} f(x) dx$

Why it works (The Taylor Series Connection)

The expansion of $e^{tX}$ is: $$ e^{tX} = 1 + tX + \frac{t^2X^2}{2!} + \frac{t^3X^3}{3!} + \dots $$ Taking expectation on both sides: $$ M_X(t) = 1 + tE[X] + \frac{t^2E[X^2]}{2!} + \frac{t^3E[X^3]}{3!} + \dots $$ Notice the coefficients contain the moments $E[X], E[X^2], \dots$

How to find Moments

  1. Mean ($E[X]$): Differentiate once, set $t=0$.
  2. $$ M'_X(0) = E[X] $$

  3. Second Moment ($E[X^2]$): Differentiate twice, set $t=0$.
  4. $$ M''_X(0) = E[X^2] $$

Detailed Example

Problem: A continuous variable $X$ has PDF $f(x) = 2x$ for $0 \le x \le 1$. Find Mean and Variance using MGF.

Solution:

  1. Find MGF:
  2. $$ M_X(t) = \int_{0}^{1} e^{tx} (2x) dx $$ Using integration by parts ($\int u dv$), let $u=2x, dv=e^{tx}dx$: $$ M_X(t) = \left[ \frac{2x e^{tx}}{t} \right]_0^1 - \int_{0}^{1} \frac{2 e^{tx}}{t} dx $$ $$ M_X(t) = \frac{2e^t}{t} - \left[ \frac{2e^{tx}}{t^2} \right]_0^1 = \frac{2e^t}{t} - \frac{2e^t}{t^2} + \frac{2}{t^2} $$

  1. Find Mean ($E[X]$):
  2. Differentiate $M_X(t)$ with respect to $t$ and find limit as $t \to 0$. Using L'Hopital's rule on the derived MGF terms: $M'_X(0) = 2/3$. Mean = 2/3.

  1. Variance:
  2. Find $E[X^2]$ using $M''_X(0)$. $E[X^2] = 1/2$. $Var(X) = E[X^2] - (E[X])^2 = 1/2 - (2/3)^2 = 1/2 - 4/9 = 1/18$.