# Random Variables

Let $X$ be a random variable uniformly distributed on the interval $[−2, 2]$, and $Y = (X − 1)^2$.

$(a)$ Find the density function and the distribution function of $X$.

$(b)$ Find the distribution function and the density function of $Y$.

-
Sow us what you have tried: (a) is easy while (b) may require some thought. – Henry Apr 18 '12 at 1:47
Related meta thread: meta.math.stackexchange.com/questions/4001/… – cardinal Apr 19 '12 at 23:57

I'll leave part a) for you, but I will point out that the density function, $f_X$, for $X$ is zero outside the interval $[-2,2]$; after all, $X$ takes all its values in this interval.

Before tackling part b), it would be beneficial to first determine the values that $Y$ takes: Since $X$ takes values in $[-2,2]$ and since $Y=(X-1)^2$, it follows that $Y$ takes values in the interval $[1,9]$.

From this it follows that $f_Y(x)=0$ for $x\notin[1,9]$. From this it follows that $F_Y(a)=0$ for $a\le1$ and that $F_Y(a)=1$ for $a\ge 9$.

That was the easy part. Let's now find the value of $F_Y(a)$ for $a\in[1,9]$. The idea is write the distribution function of $Y$ in terms of the distribution function of $X$:

We have, for $1\le a\le9$ \eqalign{ F_Y(a) &= P[\,Y\le a\,]\cr &=P[\,(X-1)^2\le a\,] \cr &= P [\,1-\sqrt a \le X\le 1+\sqrt a \, ]\cr &= P[\,X\le 1+\sqrt a\,]-P[\,X\le 1-\sqrt a\,]\cr &=F_X(1+\sqrt a) -F_X(1-\sqrt a). }

Now you can write the distribution function of $Y$ explicitly: $$F_Y(a)=\cases{0,\vphantom{1\over2} &a\le1\cr F_X(1+\sqrt a) -F_X(1-\sqrt a),\vphantom{1\over2} &1\le a\le 9,\cr 1,\vphantom{1\over2} &a\ge9 }$$

Of course, in the above, you'd replace $F_X(1-\sqrt a) -F_X(1+\sqrt a)$ with what you obtain from the rule for $F_X$ (note here that $1-\sqrt a$ and $1+\sqrt a$ are in the interval $[-2,2]$).

So, that's $F_Y$. How do you find $f_Y$? As it turns out, this is easy to do now (and is why you were asked to find the distribution function of $Y$ first) by the following result: in general, if $F$ is a distribution function of a continuous random variable, then its derivative gives the corresponding density function of that variable. In our case we have $$f_Y(x)={d\over dx}F_Y(x).$$ But before we apply this, let's recall we already determined that $f_Y(x)$ is zero for $x$ outside the interval $[1,9]$. For $x\in [1,9]$, we have, using the chain rule and the fact that ${d\over dx} F_X(x)=f_X(x)$, \eqalign{ f_Y(x)={d\over dx}F_Y(x) &= {d\over dx}\bigl(F_X(1+\sqrt x) -F_X(1-\sqrt x)\bigr)\cr &={1\over2\sqrt x} f_X(1+\sqrt x) +{1\over2\sqrt x} f_X(1-\sqrt x).\cr } So $$f_Y(x)=\cases{ {1\over2\sqrt x} f_X(1+\sqrt x) +{1\over2\sqrt x} f_X(1-\sqrt x), &1\le x\le9,\cr 0,\vphantom{1\over2}&otherwise . }$$ (And of course you'll want to simplify this using the density of $X$.)

-