Let $X ∼ U[−1,1]$. Find PDF of $Y = |X|$
So far I have
$F_Y(y) = P(Y<y) = P(|X|<y) = P(-y<X<y) = F_X(y) - F_X(-y)$
but I don't know where to go from there.
Let $X ∼ U[−1,1]$. Find PDF of $Y = |X|$
So far I have
$F_Y(y) = P(Y<y) = P(|X|<y) = P(-y<X<y) = F_X(y) - F_X(-y)$
but I don't know where to go from there.
On
Comment on intuitive approach. The PDF of $X$ is $f_x(x) = 1/2,$ for $-1 < x < 1.$ Then it seems the the absolute value 'reflects' the 'negative half' to double the probability for $Y$ in $(0,1).$
Of course, your goal has to be to do a formal development as in the very nice Answer of @poyea (+1). But because you're also interested in computing, you may sometimes get beyond your original 'sticking point' toward a final proof by simulating the result. Often it helps to have a good idea of the 'right answer'.
Here is a very quick simulation in R statistical software where runif takes
a random sample from a uniform (with appropriate parameters).
x = runif(10^6, -1, 1); y = abs(x)
mean(y); var(y); sd(y); 1/12
[1] 0.499845 # aprx E(Y) = 1/2
[1] 0.08341331 # aprx Var(Y) = 1/12
[1] 0.2888136 # aprx SD(Y)
[1] 0.08333333 # 1/12
hist(y, prob=T, xlim = c(-.1, 1.1), col="skyblue2")
curve(dunif(x, 0, 1), add=T, lwd=2, col="red", n=10001)
# 'x' is req'd arg in 'curve' fcn
You have PDF of $X$ $$f_X(x)=\begin{cases} \frac{1}{2} & x\in[-1,1] \\ 0 & \text{otherwise} \end{cases}$$ and CDF of it $$F_X(x)=\begin{cases} 0 & x < -1 \\ \frac{x+1}{2} & -1\leq x< 1 \\ 1 & x\geq1 \end{cases}$$
You're one step from the answer. Differentiating both sides w.r.t. $y$: $$f_Y(y) = f_X(y) + f_X(-y)=1,\quad y\in(0,1]$$
You can also do: $$F_Y(y) = F_X(y) - F_X(-y)=\frac{y+1}{2}-\frac{-y+1}{2}=y$$ Then perform differentiation.