Question 3.4.1
Consider the following joint distribution between random variables \(X\) and \(Y\).
| 0 |
0.10 |
0.15 |
0.05 |
| 1 |
0.20 |
0.30 |
0.10 |
| 2 |
0.05 |
0.03 |
0.02 |
(and of course, \(\mathbb{P}(X,Y) = 0\) otherwise.)
- Let \(Z = X + Y\). Find the MGF of \(Z\). Simplify your answer as much as possible.
\[
\begin{aligned}
m_Z(t) &= \mathbb{E}[e^{tZ}]\\
&= \mathbb{E}[e^{t(X+Y)}]\\
&=\sum_{x}\sum_{y}e^{t(x+y)}p_{XY}(x,y) \\
&= e^{t(0+1)}(0.10) + e^{t(0 +2)}(0.15) + e^{t(0 +3)}(0.05) + e^{t(1 +1)}(0.20) + \\
&e^{t(1 +2)}(0.30) + e^{t(1+3)}(0.10)+ e^{t(2 +1)}(0.05) + e^{t(2 +2)}(0.03) + e^{t(2+3)}(0.02)\\
&= 0.10e^t + 0.15e^{2t} + 0.05e^{3t} + 0.20e^{2t} + 0.30e^{3t} + 0.10e^{4t} + 0.05e^{3t} + \\
&0.03e^{4t} + 0.02e^{5t}\\
&= 0.10e^t + 0.35e^{2t} + 0.40e^{3t} + 0.13e^{4t} + 0.02e^{5t}
\end{aligned}
\]
- Use your MGF from part (a) to find the variance of \(Z\). Hint: start by finding \(\mathbb{E}(Z)\) and \(\mathbb{E}(Z^2)\).
\[
\begin{aligned}
\mathbb{E}(Z) &= m_Z'(0)\\
&= \frac{d}{dt}0.10e^t + 0.35e^{2t} + 0.40e^{3t} + 0.13e^{4t} + 0.02e^{5t}|_{t=0}\\
&= 0.10e^t + 0.35(2)e^{2t} + 0.40(3)e^{3t} + 0.13(4)e^{4t} + 0.02(5)e^{5t}|_{t=0}\\
&= 0.10e^(0) + 0.35(2)e^{2(0)} + 0.40(3)e^{3(0)} + 0.13(4)e^{4(0)} + 0.02(5)e^{5(0)}\\
&= 0.10 + 2(0.35)+ 0.40(3) + 0.13(4) + 0.02(5)\\
&= 2.62
\end{aligned}
\] \[
\begin{aligned}
\mathbb{E}(Z^2) &= m_Z''(0)\\
&= \frac{d^2}{dt^2}0.10e^t + 0.35e^{2t} + 0.40e^{3t} + 0.13e^{4t} + 0.02e^{5t}|_{t=0}\\
&= \frac{d}{dt}0.10e^t + 0.35(2)e^{2t} + 0.40(3)e^{3t} + 0.13(4)e^{4t} + 0.02(5)e^{5t}|_{t=0}\\
&= 0.10e^t + 0.35(2)(2)e^{2t} + 0.40(3)(3)e^{3t} + 0.13(4)(4)e^{4t} + 0.02(5)(5)e^{5t}|_{t=0}\\
&= 0.10e^0 + 0.35(2)(2)e^{2(0)} + 0.40(3)(3)e^{3(0)} + 0.13(4)(4)e^{4(0)} + 0.02(5)(5)e^{5(0)}\\
&= 0.10+ 0.35(2)(2) + 0.40(3)(3) + 0.13(4)(4) + 0.02(5)(5)\\
&= 7.68
\end{aligned}
\] \[
\begin{aligned}
\operatorname{Var}[Z] &= \mathbb{E}[Z^2] - \mathbb{E}[Z]\\
&= 7.68 - 2.62^2\\
&= 0.8156
\end{aligned}
\]
Question 3.4.2
Use the MGF to find the \(\mathbb{E}(X^2)\) where \(f_X(x) = 3e^{-3x}I_{(0, \infty)}(x)\) for \(t < 3\).
First we find the MGF:
\[
\begin{aligned}
m_X(t) &= \mathbb{E}[e^{tx}]\\
&= \int_0^{\infty} e^{tx}3 e^{-3 x}\, dx\\
&= \int_0^{\infty}3 e^{x(t -3)}\, dx\\
&= \frac{3}{t - 3}e^{x(t-3)} \Bigg|_{x = 0}^{x =\infty}\\
&= \frac{3}{t - 3}[0 - 1]\\
&= \frac{3}{3 - t}
\end{aligned}
\]
Now we find the derivative at \(t = 0\). \[
\begin{aligned}
\frac{d}{dt}m_X(t)|_{t = 0} &= \frac{d}{dt}\left(\frac{3}{3 -t}\right)\Bigg|_{t = 0}\\
&= \frac{d}{dt}\left((3)(3 -t)^{-1}\right)\Bigg|_{t = 0}\\
&= \left((-1)(3)(3 -t)^{-2}(-1)\right)\Bigg|_{t = 0}\\
&= (-1)(3)(0-3)^{-2}(-1)\\
&= \frac{1}{3}
\end{aligned}
\]
Question 3.4.3
The moment generating function \(Y \sim {\mathrm{Binom}}(n, \theta)\) is \(m_Y(t) = \left(1 - \theta + \theta e^t\right)^n\).
Use the MGF to show that the variance of \(Y\) is \(n\theta(1 - \theta)\).
\[
\begin{aligned}
\mathbb{E}(Y) &= \frac{d}{dt}m_Y(t)\Big|_{t = 0}\\
&= \frac{d}{dt}(1 - \theta + \theta e^t)^n \Big|_{t = 0}\\
&= n(1 - \theta + \theta e^t)^{n - 1}\theta e^t\Big|_{t = 0}\\
&= n(1)(\theta)(1)\\
&= n \theta\\
\end{aligned}
\]
\[
\begin{aligned}
\mathbb{E}(Y^2) &= \frac{d^2}{dt^2}m_Y(t)\Big|_{t = 0}\\
&= \frac{d}{dt}\left(n(1 - \theta + \theta e^t)^{n - 1}\theta e^t\right) \Big|_{t = 0}\\
&= \left[\frac{d}{dt}\left(n(1 - \theta + \theta e^t)^{n - 1}\theta\right)e^t + \left(n(1 - \theta + \theta e^t)^{n - 1}\theta\right)\frac{d}{dt} e^t \right]_{t = 0}\\
&= \left[n(n-1)(1 - \theta + \theta e^t)^{n-2}(\theta)(e^t) + (n(1 - \theta + \theta e^t)^{n-1}\theta)e^t\right]_{t = 0}\\
&= n(n-1)(1)(\theta)(1) + n(1)(\theta)(1)\\
&= n(n-1)\theta + n\theta
\end{aligned}
\]
Then,
\[
\begin{aligned}
\operatorname{Var}(Y) &= \mathbb{E}(Y^2) - \left(\mathbb{E}(Y)\right)^2\\
&= n(n-1)\theta + n\theta - n^2 \theta^2\\
&= n^2\theta^2 - n\theta^2 +n \theta - n^2\theta^2\\
&= n\theta(1 - \theta)
\end{aligned}
\]