# How to find the median of a PDF with a continuous random variable given the mode of it?

So the question is to find the median of $X$ if the mode of the distribution is at $x = \sqrt{2}/4$. And the random variable $X$ has the density function

$$f(x) = \left\{ \begin{array}{ll} kx & \mbox{for 0 \le x \le \sqrt{\frac{2}{k}}} ;\\ 0 & \mbox{otherwise}.\end{array} \right.$$

I know that the median of a PDF is such that the integral is equated to half. If I proceed that way with this problem, I am getting an answer of $1$. But the answer is given is $\frac{1}{4}$. Also, I am not sure why the mode is given. If I equate $f'(x)$ to $\sqrt{2}/4$ (which is the given mode), I end up getting random solutions.

Can someone help me out here, please?

• Siong Thye Goh has already provided a nice explanation for your question. The mode is given just to find the value of $k$. The p.d.f of $X$ is an increasing function (in fact a straight line with slope $k>0$) in the interval $\left[0, \sqrt{\frac{2}{k}}\right]$. Since mode exists it should be at the end point of this interval. This gives you $x=\frac{\sqrt{2}}{4}=\sqrt{\frac{2}{k}}$ – user440191 Aug 9 '18 at 7:48

You are told the mode so that we know the value of $k$.

$$\sqrt{\frac2{k}}=\frac{\sqrt{2}}4$$

Hence $k = 16.$

$$\int_0^m 16x \, dx = \frac12$$

Try to solve for $m$ from the above equation.

• +1 Nice and concise! (a subtle way to give myself a compliment :-) – drhab Aug 9 '18 at 7:30

The mode is in this case $\sqrt{2/k}$ so the fact that it also equalizes $\sqrt2/4$ tells us that $k=16$.

Now we can find the median $m$ on base of $$\int^m_016xdx=\frac12$$leading to $$m=\frac14$$