4 The random variable \(X\) has probability density function given by
$$\mathrm { f } ( x ) = \begin{cases} k \mathrm { e } ^ { - x } & 0 \leqslant x \leqslant 1 0 & \text { otherwise } \end{cases}$$
Show that \(k = \frac { \mathrm { e } } { \mathrm { e } - 1 }\).