# Random variable with density proportional to a function and finite in some points

Let $X$ be a random variable on $[-1,3]$ with density $f(x) = k x^2$ (with $k \in \mathbb{R}$ to be determined) on $[-1,3]$ apart from some points s.t. $p(X=-1) = p(X=3) = \dfrac{1}{4}$ and $p(X=0) = \dfrac{1}{3}$.
What is the cumulative distribution function of $X$? How much is $p(-1 \leq X < 3)$?

To find $k$ I would just calculate $$k = \dfrac{1}{\int_{-1}^3 x^2 \ dx}$$ and then the cumulative distribution should be $$F(x) = \int_{-1}^x f(t) \ dt$$ while $$p(-1 \leq X < 3) = 1 - p(X = 3) = \dfrac{3}{4}$$ Any suggestion would be appreciated.

-

You can't calculate $k$ the way you suggest because the total probability due to the continuous part of the PDF isn't 1. There are three possibilities, and $$\mathrm P(X=-1) + \mathrm P(X=3) + \mathrm P(-1<X<3) = 1$$

Therefore we have

$$\mathrm P(X=-1) = \mathrm P(X=3) = \frac 1 4 \implies \mathrm P(-1<X<3) = 1 - \frac 1 4 - \frac 1 4 = \frac 1 2$$

Thus $$k = \frac {1/2}{\int_{-1}^3 x^2}$$

Then e.g. the cumulative function is zero below -1, then jumps to $\frac 1 4$ as you cross $-1$ and smoothly increases to $\frac 3 4$ at $3$, then jumps to one.

Have another go at the question!

-