<s>[INST] Find $[E(Y^2)]$. When $Y = 3 * X - 5$ and $X$ is distributed in range $[0, 5]$ Need help with exercise.
Random variable $X$ is evenly distributed in range $[0, 5]$. Need to find $E[Y^2]$ when $Y = 3X - 5$
Every hint/tip will be appreciated.
Thank you
Alternative solution
$$E[Y^2] = E[(3X-5)^2] = E[9X^2-30X+25] = 9E[X^2]-30E[X]+25 =9(E[X]^2 + D[X]) - 30 *2.5 +25 =9*(2.5^2 + 25/12) - 75+25 = 25$$
 [/INST] I assume that $X$ is uniformly distributed. The CDF of $X\sim\mathcal{U}(0,5)$ is
$$
F_X(x)=\Pr[X\le x]=\frac{x-0}{5-0}=\frac x5.
$$
Therefore
$$
\begin{align}
\Pr[Y\le y]&=\Pr[3X-5\le y]\\
F_Y(y)&=\Pr[3X\le y+5]\\
&=\Pr\left[X\le \frac{y+5}{3}\right]\\
&=F_X\left(\frac{y+5}{3}\right)\\
&=\frac{y+5}{15}.
\end{align}
$$
The region $0\le x<5$ is corresponding to $-5\le y<10$. Hence $Y\sim\mathcal{U}(-5,10)$. The pdf of $Y$ is
$$
f_Y(y)=\frac1{10-(-5)}=\frac1{15},
$$
then
$$
\begin{align}
\text{E}\left[Y^2\right]&=\int_{-5}^{10} y^2f_Y(y)\ dy\\
&=\frac1{15}\int_{-5}^{10} y^2\ dy\\
&=\frac1{15}\left[\frac13y^3\right]_{-5}^{10}\\
&=\frac1{45}(10^3-(-5)^3)\\
&=\Large\color{blue}{25}.
\end{align}
$$
</s>