# Find $f_W$ for $W=-\frac{1}{2}\log(X)$. Given answer doesn't match my answer

Let $X$ a random variable with the p.d.f.

$$f_X(x) = \begin{cases} 3x^2, & \text{if } 0<x<1 \\ 0, & \text{otherwise} \end{cases}$$

and $W=-\frac{1}{2}\log(X)$. Find the p.d.f. $f_W$ for $W$.

I've been given this task and the answer to the question as well. So, my idea was to use the formula:

$$f_Y(y)=\frac{f_X(x_1)}{g'(x_1)}$$

where $\ g(x_1)=y$.

However, the answer that I am ending up with simply does not align with the answer given by the instructor. I am told that the answer should be $W \sim \operatorname{Exp}(6)$.

This is how I'm breaking the task down:

$$f_X(x) = \begin{cases} 3x^2, & \text{if } 0<x<1 \\ 0, & \text{otherwise} \end{cases} \qquad \text{and} \qquad g(x) = -\frac{1}{2}\log(x)$$

are given by the task. So what I need to do is differentiate $g(x)$ and find the inverse function of $W$ and put it all together:

• Derivative: $g'(x) = -\frac{1}{2x}$.
• Inverse: $x_1 = g^{-1}(x) = e^{-2x}$.

Putting it together:

$$f_W(x) = \frac{3 \cdot (e^{-2x})^2}{-1/(2 \cdot e^{-2x})} =-6(e^{-2x})^3$$

As you can see this doesn't match the given answer. I've used hours trying other methods but cannot find the mistake. Any thoughts?

Best regards

• Try using mathjax more properly to make your work more presentable. You can also use it in the title. – Mohammad Zuhair Khan Dec 27 '17 at 9:40
• Ah, didn't know that mathjax worked in the title as well. I'll edit it. – Fauré Dec 27 '17 at 9:42
• You can put the function $f_X$ in the body and make the title something like find $f_W$ if $W=...$ – Shashi Dec 27 '17 at 9:43
• The title seems a bit messy. – Mohammad Zuhair Khan Dec 27 '17 at 9:44
• Thank's for the input guys. I've edited the title using mathjax and reduced the information given in the title. – Fauré Dec 27 '17 at 9:52

The cdf of $W$ can be calsulated as follows

$$F_W(w)=P(W<w)=P\left(-\frac12\log(X)<w\right)=$$ $$=P\left(\log(X)>-2w\right)=P\left(X>e^{-2w}\right)=$$ $$=3\int_{e^{-2w}}^1x^2\ dx=\begin{cases}0&\text{ if } &w<0\\1-e^{-6w}&\text{ if } &0\leq w.\end{cases}$$

The density is then

$$f_W(w)=\frac{d F_W}{dw}=6e^{-6w}$$

if $w\geq 0$.

• Thank you very much! Very understandable explanation! – Fauré Dec 27 '17 at 10:30

The pdf of $W$ can be written as $$f_W(w)=\int_0^1 dx\ 3x^2\delta\left(w+\frac{1}{2}\ln x\right)\ ,$$ using a Dirac delta. Since $w+(1/2)\ln x=0\Rightarrow x=e^{-2w}$, we have $$f_W(w)=\int_0^1 dx\ 3x^2\frac{\delta\left(x-e^{-2w}\right)}{\frac{1}{2e^{-2w}}}=6e^{-2w}\times e^{-4w}\mathbb{1}(e^{-2w}<1)=6e^{-6 w}\theta(w)\ ,$$ which is correctly normalized over $w\in (0,\infty)$. The fact that the support is $(0,\infty)$ is evident from the definition, as the $\log$ of a number $X$ between $0$ and $1$ is negative. I think all you are missing is the absolute value of $g'(x)$.

PS I highly doubt that your instructor gave you $w\sim e(6)$ as a solution. That notation doesn't make any sense, to start with...

• Thank you very much! The Dirac delta notation is unknown to me but you are totally correct in the numerical value mistake, and your reply was very helpful. I promise that it was the answer the instructor gave. He must have written an answer to a different exercise on the paper then. He owes me 2 hours of my life :-). – Fauré Dec 27 '17 at 10:33
• You are welcome! I can suggest some further reading (e.g. ece.iisc.ernet.in/~yrv/past-papers/A5_1.pdf and citeseerx.ist.psu.edu/viewdoc/…) for the delta function method for computing pdfs of functions of random variable. It takes some initial effort to understand the method, but then it is really powerful and general! – Pierpaolo Vivo Dec 27 '17 at 10:37
• Thank you for the additional information. That's very kind of you. I'll definitely read up on that method! – Fauré Dec 27 '17 at 10:53

Let $w\in (0,\infty)$. Let $F_W$ be the CDF of of $W$ and $F_X$ the CDF of $X$

\begin{align} F_W(w)&=P(W<w)=P\left(\frac{-\ln(X)}{2}<w\right)\\ &=P(\ln(X)>-2w)=P(X>e^{-2w})\\& =1-P(X\leq e^{-2w})=1-F_X(e^{-2w}) \end{align} Differentiating and using the Fundamental Theorem of Calculus gives us the pdf of $W$. So: \begin{align} f_W(w)=2e^{-2w}f_X(e^{-2w})=2e^{-2w}3e^{-4w}=6e^{-6w} \end{align} since $w\in(0,\infty)$. It can be easily seen that $f_W(w)=0$ for $w\leq 0$.

• Thank you very much! Im really impressed with the forum. 3 answers that are all very helpful! – Fauré Dec 27 '17 at 10:30