# Let X be a random variable with PDF fx. Find the PDF of the random variable |X| in the following

Here's my question: X is uniformly distributed in the interval $[-1,2]$. Find pdf of $|X|$...

So I did P($|X| \le x$) = P($-x \le X \le x$)...

From here I'm not too sure how to proceed. I know the pdf for X is 1/3 because X $\in$ $[-1,2]$ and 1/2-(-1) = 1/3.

So is $|X|$ $\in$ $[0,2]$ and |X|'s pdf = 1/2?

Sorry if this seems rudimentary, thank you for helping.

The distribution for $0 \leq x \leq 2$ is

$$P(|X| \leq x ) = \begin{cases} \int_{-x}^x\frac1{3}dt \,\, 0 \leq x \leq 1 \\ \int_{-1}^x\frac1{3}dt \,\, 1 < x \leq 2 \end{cases}= \begin{cases} \frac{2x}{3} \,\, 0 \leq x \leq 1 \\ \frac{x+1}{3}\,\, 1 < x \leq 2 \end{cases}.$$

Also $P(|X| \leq 0 ) = 0$ and $P(|X| \leq x ) = 1$ for $x > 2$.

Taking the derivative, the PDF is

$$f_{|X|}(x)= \begin{cases} \frac{2}{3} \,\, 0 \leq x \leq 1 \\ \frac{1}{3}\,\, 1 < x \leq 2\\ 0 \,\,\text{otherwise} \end{cases}$$

• How did you know that it is -x to x for the values 0 $\leq x \leq 1$ and -1 to x for the other case? – user3325193 Aug 13 '14 at 4:51
• Because $|X|$ cannot be less than 0. If $x$ is between $0$ and $1$ then $|X| \leq x$ iff $-x \leq X \leq x$ – RRL Aug 13 '14 at 4:55
• If $x$ is between $1$ and $2$ then $|X| \leq x$ iff $-1 \leq X \leq x$. $X$ cannot be less than $-1$. – RRL Aug 13 '14 at 4:57
• Thank you! That really helped. – user3325193 Aug 13 '14 at 4:58
• @user3325193: You're welcome. – RRL Aug 13 '14 at 4:59