# Finding Probability Density Function and Probability

Brushing up on some probability problems and came across this one. I'm a little confused on how exactly get the probability density function and frin probability from that.

Given the distribution of random variable Y: $$F_Y(y)=\begin{cases} 0, y\leq0 \\ \frac{y}{8}, 0\lt y \leq 2 \\ \frac{y^2}{16}, 2\leq y \lt 4\\ 1, y \geq 4 \end{cases}$$

Find density function.

I found this out to be just the integral of each equation:

$$f_Y(y)=\begin{cases} 0, y\leq0 \\ \frac{y^2}{16}, 0\lt y \leq 2 \\ \frac{y^3}{48}, 2\leq y \lt 4\\ y, y \geq 4 \end{cases}$$

since the is the case if it were just one solid equation.

Find $P (1\leq Y \leq 3)$ and $P(Y \geq 1.5)$.

Would this just be P(3) - P(1) and to do this would just be plugging in 3 and 1 into $f_Y(y)$. Or would I have to take another integral since $$P(a \leq X \leq b) = \int_a^b f_Y(y) dy$$ How would this work with the second probability? Since P(infinity) = infinity. I'm just confused as to how many integrals I have to take to find probability given the random variable Y.

$F_Y$ is not the density function, but the cumulative distribution function

So you need to calculate $f_Y(x)=F_Y'(x)$, not $f_Y(x)=\int_{-\infty}^{x}F_Y(t)dt$

What you have done applies when you are given $f_Y(x)$ and you need to calculate $F_Y(x)$. Then indeed $F_Y(x)=\int_{-\infty}^{x}f_Y(t)dt$. But this does not apply to your problem.

For the second part it is easiest to use the fact that $Y$ is continuous, so the probability to take any fixed value is zero:

$P(1\le Y\le 3)=P(Y\le 3)-P(Y\le 1)=F_Y(3)-F_Y(1)$

$P(Y\ge 1.5)=1-P(Y\le 1.5)=1-F_Y(1.5)$

The formula with $P(3)-P(1)$ does not make sense.

The second formula with the integral is correct, but there is no need to integrate when you are given $F_Y$

What you have done is wrong in two different ways. First, as Momo has pointed out already, the density function is the derivative of the distribution function, and not its integral. Second, even if the question had been in the "opposite direction" (given the density function, find the distribution function), what you did would be still wrong because you found the antiderivative (sometimes called the indefinite integral) of the given function. The value of the distribution function at the point $x$ is the definite integral (that is, "area under the curve") of the density function over the interval $(-\infty, x]$.