Why the function f(x) is not a probability density function(PDF)

density functionprobabilityprobability distributions

I saw this example but I can't understand why its's not PDF.

Exmaple:
Suppose $ f(x)=\left\{\begin{array}{ll} c\left(1-x^{2}\right) & \text { if }-2 \leq x \leq 2 \\ 0 & \text { otherwise. } \end{array}\right. $, Is there a value of c for which $f(x)$ is a probability density function? Why or why not?

Solution: This cannot be a probability density function. If $ c=0 $, then it does not integrate 1 . For any $ c \neq 0 $, there is an interval in $ -2 \leq x \leq 2 $ over which the integral is negative, and therefore does not represent a probability over this interval.

I understand that $c$ shouldn't equal $0$ and the outcome in the first case shouldn't be negative, right?
so what if $c$ is negative, then the outcome will be positive for $-2 \leq x \leq 2$. Or is there otherway to show that with integral ? since it should be 1, right?

Best Answer

If $c>0$ then $f$ is negative in $[-2,2] \setminus [-1,1]$. If $c<0$ then $f$ is negative in $(-1,1)$. Either way it is negative somewhere.

The "gotcha" part of this question is that $\int_{-2}^2 1-x^2 dx=-4/3 \neq 0$, so the students not paying careful attention are expected to say that if $c=-3/4$ then you have a PDF. But because this $f$ isn't nonnegative, it is still not a PDF.

Related Question