4 The random variable \(X\) has probability density function given by
$$f ( x ) = \begin{cases} \frac { k } { \sqrt { } x } & 0 < x \leqslant a
0 & \text { otherwise } \end{cases}$$
where \(k\) and \(a\) are constants. It is given that \(\mathrm { E } ( X ) = 3\).
- Find the value of \(a\) and show that \(k = \frac { 1 } { 6 }\).
- Find the median of \(X\).