The diagram gives the graph of the probability density function, $f$, for a random variable $X$ whose possible values lie only in the interval from $0$ to $4$. Over this interval the graph is a straight line. Show that $f(x) = kx$ for $0 \le x \le 4$, where $k$ is a constant to be found.
Hence, or by another valid method, determine $\text{E}(X)$.
The diagram gives the graph of the probability density function, $g$, of a random variable $W$ whose possible values are only between $0$ and $a$, where $a > 0$. On this interval the graph is a straight line. Given that the median of $W$ is $1$, determine the value of $a$.