Given is a density function. Calculate $P(X<2)$ and $P(X \geq 2.5)$

81 Views Asked by At

Given the density function$$f(x)=\begin{cases} \frac{x^2}{2}&\mbox{if }0\leq x<1\\ -x^2+3x-\frac{3}{2}&\mbox{if }1\leq x<2\\ \frac{(3-x)^2}{2}&\mbox{if }2\leq x<3\\ 0&\mbox{else}\end{cases}$$

Calculate $P(X<2)$ and $P(X \geq 2.5)$

Can you please tell me if I did it correctly? I would do it like that in the exam I write soon (I just left integration away to keep it a little shorter)!

$$P(X<2) = P(0 \leq X < 1)+P(1 \leq X <2) = \int_{0}^{1}\frac{x^2}{2} \; dx + \int_{1}^{2} -x^2+3x-\frac{3}{2}\; dx$$


$$P(X \geq 2.5)=1-P(X<2.5)= \\= 1-\Big(P(0 \leq X<1) + P(1 \leq X <2) + P(2 \leq X <2.5)\Big) = \\ = 1- \bigg(\int_{0}^{1}\frac{x^2}{2}\;dx+\int_{1}^{2}-x^2+3x-\frac{3}{2}\;dx+\int_{2}^{2.5}\frac{(3-x)^2}{2}\;dx\bigg)$$