Let $X$ be a real-valued random variable admitting a density whose distribution function $F_X$ is given by
$F_X(t)=\begin{cases} 0&\text{if}\, t< 2\\ c (t-2)^2&\text{if}\, 2 \leq t \leq 4\\ 1 &\text{if}\, t \geq 4 \end{cases} $ $
$(a)$ Explain why $c = \frac{1}{4}$.
We must have $F_X(4) = P(X \leq 4) = 1$, so $c(4-2)^2 = 1$. This gives $c= \frac{1}{4}$.
$(b)$ Find a density function of $X$.
Differentiating the cumulative distribution function $F_X$ gives the density function $f_X(x) = \begin{cases} \frac{1}{2}(x-2) &\text{if}\, 2 \leq x \leq 4\\ 0 &\text{otherwise} \end{cases}$
$(c)$ Find a median of $X$.
Let $m$ denote the median, where clearly $2 \leq m \leq 4$. We must have $P(X \geq m) \geq \frac{1}{2}$ and $P(X \leq m) \geq \frac{1}{2}$.
This gives two inequalities: $(m-2)^2 \geq 2$ and $(m-2)^2 \leq 2$, so we must have $(m-2)^2 = 2$. So $m = 2+\sqrt{2}$ or $m = 2 - \sqrt{2}$. So by the initial conditions, $m= 2+\sqrt{2}$.
$(d)$ Find $E[X]$.
I won't post my working but I used the formula for expectation of a continuous random variable, integrating between limits $2$ and $4$. I ended up with $\frac{10}{3}$.
Is my working correct for these ? I am unsure on $(c)$ and $(d)$ mainly.