# Probability density transformation question

Let X be a random variable that is uniformly distributed in (0,1). Find the probability density function of Y = −ln X.

I got the solution $e^{-2y}$ for $y>0$, however the real solution is $e^{-y}$.

I followed the standard rule of $$f_Y(y) =f_X[g^{-1}(y)] \big |{d\over dy} g^{-1}(y) \big |$$

and did $$f_X[g^{-1}(y)] = f_X[e^{-y}] = e^{-y}$$ because the random variable is just x,

and then $$\big |{d\over dy} g^{-1}(y) \big |=e^{-y}$$

so $$e^{-y}e^{-y} = e^{-2y}$$

Where did I go wrong?

• It is $f_X(g^{-1}(y))$, not $f_Y()$. – StubbornAtom Aug 15 '18 at 16:43
• So, doesn't that answer your question? – StubbornAtom Aug 15 '18 at 16:45
• What is $f_X(x)$ ? Then what is $f_X(e^{-y})$? – StubbornAtom Aug 15 '18 at 16:48
• $f_X$ is a constant function by definition. If $f_X(x)=c$ from $0<x<1$, what is $c$? – StubbornAtom Aug 15 '18 at 16:53
• Just a remark: another route is finding (for $y>0$): $F_Y(y)=P(-\ln X\leq y)=P(X\geq e^{-y})=1-e^{-y}$ and then differentiate. – drhab Aug 15 '18 at 16:58

With a basic uniform distribution, $f_X(x)=1$ for $x \in (0,1)$ and $0$ otherwise
So $f_X(g^{-1}(y))=1$ for $g^{-1}(y) \in (0,1)$, i.e. for $y \in (0,\infty)$, and $0$ otherwise
So $f_Y(y) =f_X[g^{-1}(y)] \left|{d\over dy} g^{-1}(y) \right| = \left|{d\over dy} g^{-1}(y) \right| = e^{-y}$ for $y \in (0,\infty)$, and $0$ otherwise