# From pdf to distribution function

I have the following probability density function (pdf):

$$f(x)=\{0$$ if $$x<= 11$$

$$x-11$$ if $$11\leq x \leq 12$$

$$13-x$$ if $$12\leq x \leq 13 \}$$

My aim is to find the distribution function $$F(x)$$ where the integral from $$-\infty$$ to $$+\infty$$ of the pdf $$f(x)$$ equals one. I know I have to integrate the pdf over the various sub-intervals indicated above, however, I get something that is not correct. Could somebody please explain me step by step how to do it? I apologize for my bad typing of the problem, I hope you can understand. Thank you in advance

• The $F(x)$ in your 5th line, is it a cumulative distribution function ? Commented Nov 16, 2018 at 11:55
• Yes it is also a cdf Commented Nov 16, 2018 at 13:04

Since the value of the pdf before $$11$$ is $$0$$, $$F(x)$$ will also be $$0$$ before $$11$$. After $$11$$, we integrate pdf from $$11$$ to $$12$$ separately, and $$12$$ to $$13$$ separately as they have different pdfs.

From $$11$$ to $$12$$ ($$11\leq y\leq 12$$)

$$F(y) = \int_{11}^{y}(x - 11)dx = \frac{y^2}{2} - 11y + \frac{121}{2}$$

For $$12$$ to $$13$$ ($$12\leq y\leq 13$$), we'll need the value of $$F(12)$$ as this will be added to the integral. So putting $$y = 12$$ in the above integral, we get $$F(12) = 0.5$$

Now for $$12$$ to $$13$$ ($$12\leq y\leq 13$$)

$$F(y) = 0.5 + \int_{12}^{y}(13 - x)dx = 13y - \frac{y^2}{2} - 83.5$$

After $$13$$, i.e. $$y\geq 13$$

$$F(y) = 1$$

as can be seen by putting $$y = 13$$ in the second equation.

• Thank you Sauhard! However, the solution that I have reads: $0$ for $x\leq 11$; $\frac{1}{2}(x-11)^2$ for $11 \leq x \leq 12$; $1-\frac{1}{2}(13-x)^2$ for $12 \leq x \leq 13$ and $1$ for $x \geq 12$ Commented Nov 16, 2018 at 13:05
• You can factorise my equations so that they fit your way of solution. For $11\leq y \leq 12$ , rewrite my equation of $F(y) = \frac{y^2}{2} - 11y + \frac{121}{2} = \frac{1}{2}(y^2 - 22y + 121) = \frac{1}{2}(y-11)^2$. For $12 \leq y \leq 13$, rewrite $F(y) = 13y - \frac{y^2}{2} - 83.5 = 1 +13y - \frac{y^2}{2} - 84.5 = 1 - \frac{1}{2}(y^2 - 26y + 169) = 1 - \frac{1}{2}(13 - y)^2$ Commented Nov 16, 2018 at 13:21