How to find the CDF and denisty? Choose a number $U$ from the interval $[0, 1]$ with uniform distribution. Find the cumulative distribution and density for the random variables: (a) $Y = \left(U − \dfrac{1}{2}\right)^2$.
My attempt: I tried to think of a CDF that would be around $(0, 1)$. So, I thought a reasonable CDF would be $F(x) = 4x$, then, I tried to think of an interval for the CDF, which would be $\left(0, \frac{1}{4}\right)$ because I can get $[0, 1]$ again from the output of the CDF. However, the answer for the CDF was $F(x)= 2\sqrt{x}$. How do I find the correct CDF?
 A: The cumulative distribution function for $Y$, by definition, is the probability that $Y \leq y$. It is written given as a function in $y$.
Since we're given the probability distribution for $U$, rather than for $Y$, we should write the condition $Y \leq y$ in terms of the $U$ variable:
$$ {\rm cdf}(y) = P(Y \leq y) = P( \tfrac 1 2 - \sqrt y \leq U \leq \tfrac 1 2 + \sqrt y).$$
But since $U$ has a uniform distribution on $[0,1]$, we see that
$$ {\rm cdf}(y) =P( \tfrac 1 2 - \sqrt y \leq U \leq \tfrac 1 2 + \sqrt y) =  \begin{cases} 2 \sqrt y & y \in [0,\frac 1 4]  \\ 1 & y \in [\tfrac 1 4, \infty) \end{cases}$$
From here, we can also obtain the probability density function ${\rm pdf}(y)$ by differentiating ${\rm cdf}(y)$ with respect to $y$.
A: Use definition of CDF. Let $y \geq 0$.
\begin{align}
F_Y(y) &= P(Y \leq y) \\
&= P\left((U-\frac12)^2 \leq y\right) \\
&= P\left(-\sqrt{y} \leq U-\frac12 \leq \sqrt{y}\right) \\
&= P\left(\frac12-\sqrt{y} \leq U \leq \frac12+\sqrt{y}\right) \\
&= F_U\left(\frac12+\sqrt{y}\right)-F_U\left(\frac12-\sqrt{y}\right)  \\
\end{align}
Can you complete the rest?
what happens when $y<0$? what happens when $y$ is huge?
