# Find Density Function, Cumulative Distribution, and Expected Value given only Interval

Do not have answers to this problem
Please let me know if there are mistakes

Let Y be a random variable that is uniformly distributed on the interval $[2,4]$.

a) What is $f_Y(Y)$?

b) Give an explicit formula for the cumulative distribution function $F_Y(Y)$

c) Find $E(Y)$

Attempt:

a)

Using definition:

$f(x; A, B) = \begin{cases} {1\over B-A}, & A \le x \le B \\ 0, &\text{elsewhere} \end{cases}$

$$f_Y(Y) = \begin{cases} {1\over 2}, & 2 \le Y \le 4 \\ 0, &\text{elsewhere} \end{cases}$$ b)

Using definition:

$F(X) = \int_{-\infty}^x f(t) dt$

\begin{align} F(Y) &= \int_{2}^Y f(t) dt \\\\ &= \int_{2}^Y {1 \over 2} dt \\\\ &= {Y-2 \over 2} \end{align}

$F(Y) =$ \begin{cases} {0}, &\text{Y < 2} \\ {Y-2 \over 2}, &\text{$2$ ≤ $Y$ ≤ $4$} \\ {1}, &\text{Y > 4} \\ \end{cases}

c)

Using definition:

$E(X) = \int_{-\infty}^\infty xf(x) dx$

\begin{align} E(Y) &= \int_{2}^4 Yf(Y) dY \\\\ &= \int_{2}^4 Y{1 \over 2} dY \\\\ &= 12 \end{align}

Thank you

$$\int_2^4 \frac{y}{2} \, dy = \frac{y^2}{4}\bigg|_{y=2}^{y=4} = \frac{12}{4}=3$$
Notice that in general, for uniform distribution on interval $[a,b]$, the expected value would be $\frac{a+b}{2}$.
Minor comment about notation: We to write $F_Y(\color{blue}{y})=Pr(Y \leq y)$ rather than $F_Y(Y)$.