Find the moment generating function (m.g.f.) of a random variable X with probability density function (p.d.f.)
f(x) = x, 0 ≤ x < 1
= 2 − x, 1 ≤ x < 2
= 0, otherwise
Using this m.g.f., find E(X) and V(X).
10 marks · directive: Find
The core of a good answer
M_X(t) = (e^t − 1)²/t² for t ≠ 0 (and M_X(0) = 1); expanding, M_X(t) = 1 + t + (7/12)t² + …, so E(X) = 1, E(X²) = 7/6 and V(X) = 1/6.
An outline written by upsc.help, not an official UPSC answer; every fact checked by a separate review. How we work
What the question asks
The m.g.f. is found by integrating e^{tx} f(x) over the two pieces (integration by parts). The moments must then be extracted from the m.g.f. itself, either by series expansion or by differentiation at t = 0; because the closed form has t² in the denominator, the series route is cleaner.
Answer outline
Introduction
M_X(t) = E(e^{tX}) = ∫₀¹ x e^{tx} dx + ∫₁² (2 − x) e^{tx} dx. This is the triangular distribution on (0, 2) with mode 1; it is the distribution of the sum of two independent U(0, 1) variables.
Step 1: First integral
- ∫₀¹ x e^{tx} dx = e^t/t − (e^t − 1)/t².
Step 2: Second integral
- ∫₁² (2 − x) e^{tx} dx = −e^t/t + (e^{2t} − e^t)/t².
Step 3: Add
- M_X(t) = (e^{2t} − 2e^t + 1)/t² = [(e^t − 1)/t]², t ≠ 0; M_X(0) = 1.
- Check: (e^t − 1)/t is the m.g.f. of U(0, 1), so X is the sum of two independent uniforms.
Step 4: Series
- (e^t − 1)/t = 1 + t/2 + t²/6 + …
- Square: M_X(t) = 1 + t + (1/4 + 1/3)t² + … = 1 + t + (7/12)t² + …
Step 5: Moments
- E(X) = coefficient of t = 1.
- E(X²) = 2! × 7/12 = 7/6.
- V(X) = 7/6 − 1 = 1/6.
Conclusion
E(X) = 1 and V(X) = 1/6. Check: the sum of two independent U(0, 1) variables has mean 1/2 + 1/2 = 1 and variance 1/12 + 1/12 = 1/6. The m.g.f. and moments were verified symbolically in Python.
Examples and data to cite
- The same triangular density appears as the distribution of the sum of two random numbers drawn from (0, 1).
Facts to remember
- M_X(t) = E(e^{tX}); E(Xʳ) = r! × coefficient of tʳ in the expansion, or M⁽ʳ⁾(0).
- m.g.f. of U(0, 1): (e^t − 1)/t.
- m.g.f. of a sum of independent variables is the product of their m.g.f.s.
- Triangular distribution on (a, b) with mode c: mean (a + b + c)/3, variance (a² + b² + c² − ab − ac − bc)/18; here 1 and 1/6.