# converting a density function to a distribution function

I get stuck converting density functions to distribution functions,

(i) the density function $f(y)$ is given by: y (for 0<=y<=1), 1 (for $1<y<=1.5$), and 0 elsewhere. What is $f(y)$? I get: (a) $y^2/2$ (for $0<=y<=1$), and (b) $y$ (for $1<y<=1.5$) But the answer for (b) is given as $y-1/2$. Could anyone explain how we get $y- 1/2$?

(ii) $f(y) = 1/4$, i.e. $0.25$ (for $-1<y<=0$), $0.25(y-1)$ (for $1 < y <=3$) and elsewhere. What is $f(y)$? I get $0.25(y^2/2 - y)$ (for $1 < y <=3$) but when I integrate this using 3 and 1 as the limits and add $0.25$ to this, I don't get $1$. So I think I am doing something wrong

• plse ignore this; not sure why part of the question does not show up. Jan 21, 2018 at 5:40

It is customary to denote the cumulative distribution function of $Y$ as $F_Y(\cdot).$ Sometimes, it is helpful to use a neutral symbol (here $t$) for the variable of integration.

(i) For $0 \le y < 1,$ we have $F_Y(y) = \int_0^y t\,dt = \frac 1 2 y^2.$

For $1 \le y < 1.5,$ we have $F_Y(y) = \int_0^y f_X(t)\,dt = \int_0^1 t\, dt + \int_1^y 1\,dt = \frac 1 2 + y - 1 = y - \frac 1 2.$

What are the values of $F_Y(y),$ for $y \le 0$ and $y > 1.5?$

Now you should be able to do part (ii) on your own.

On $(-1,0),$ we have $F_Y(y) = \int_{-1}^y \frac 1 4 \,dt = \frac 1 4 [t]_{-1}^y = \frac 1 4 (y-(-1)) = \frac 1 4 (y+1),$ as you say. So $F_Y(-1) = 0,$ as it must be.
On $(0,1),$ we have $F_Y(y) = \int_{-1}^y f_Y(t)\, dt = \int_{-1}^0 f_y(t)\, dt + \int_0^y 0\, dt = \frac 1 4 + 0 = 1/4.$
On $(1, 3),$ we have $F_Y(t) = \int_{-1}^y f_Y(t)\, dt = \frac 1 4 + \int_1^y \frac 1 4 (t-1)\, dt = ??.$ You are correct that $F_Y(3) = 1.$
• thanks, this is becoming clearer. But do we need to integrate ½$t2 (in the second line)? Jan 21, 2018 at 8:46 • But do we need to integrate ½t^2 (in the second line)? Jan 21, 2018 at 8:47 • Fy(Y) = 0 and 1 for y<0 and >1.5 respectively for (ii), I get the following: Fy(Y) = ¼(y +1) for -1 < y <=0 Fy(Y) = ¼(y^/2 –y + 1/2) for 1<y<=3 But from my understanding of cumulative distribution function, Fy(3) should be equal to 1. But when I substitute 3 into the second equation, an add ¼ from the first, I get ¾ Not sure what I am doing wrong Jan 21, 2018 at 9:11 • Notice that$\int_0^1 t\, dt$= 1/2.$ Fixed a typo, sorry. Maybe that typo confused you in (ii). Jan 21, 2018 at 9:22