5 The random variable \(X\) has probability density function \(\mathrm { f } ( \mathrm { x } )\), where
$$\mathrm { f } ( x ) = \begin{cases} k \mathrm { e } ^ { - k x } & x \geqslant 0 \\ 0 & x < 0 \end{cases}$$
and \(k\) is a positive constant.
- Show that the moment generating function of \(X\) is \(\mathrm { M } _ { X } ( t ) = k ( k - t ) ^ { - 1 } , t < k\).
- Use the moment generating function to find \(\mathrm { E } ( X )\) and \(\operatorname { Var } ( X )\).
- Show that the moment generating function of \(- X\) is \(k ( k + t ) ^ { - 1 }\).
- \(X _ { 1 }\) and \(X _ { 2 }\) are two independent observations of \(X\). Use the moment generating function of \(X _ { 1 } - X _ { 2 }\) to find the value of \(\mathrm { E } \left[ \left( X _ { 1 } - X _ { 2 } \right) ^ { 2 } \right]\).