7 A random variable \(X\) has probability density function given by
$$f ( x ) = \begin{cases} k ( 1 - x ) & - 1 \leqslant x \leqslant 1
0 & \text { otherwise } \end{cases}$$
where \(k\) is a constant.
- Show that \(k = \frac { 1 } { 2 }\).
- Find \(\mathrm { P } \left( X > \frac { 1 } { 2 } \right)\).
- Find the mean of \(X\).
- Find \(a\) such that \(\mathrm { P } ( X < a ) = \frac { 1 } { 4 }\).