Is a cumulative distribution function defined for all real $x$

cumulative-distribution-functionsrandom variables

Suppose that $X$ is a continuous random variable whose probability density function is given by

$$
f(x) = \left\{
\begin{array}{ll}
x & \quad 0\leqq x \leqq 1 \\ -x+2 & \quad 1\leqq x\leqq 2 \\ 0 & \quad \text{otherwise}
\end{array}
\right.
$$

I found the CDF by integration, obtaining

$$
F(x) = \left\{
\begin{array}{ll}
\frac{1}{2}x^2 & \quad 0\leqq x \leqq 1 \\ -\frac{1}{2}x^2+2x-1 & \quad 1\leqq x\leqq 2
\end{array}
\right.
$$

which definitely seems correct, enter image description here

as it is nondecreasing and continuous, with $F(0)=0$ and $F(2)=1$.

My question is, is the CDF defined for $x<0$ and $x>2$? It would make sense for me if the CDF was the constant function $y=1$ for $x>2$ as the CDF specifies the probability that our random variable is less than or equal to $x$, and $P(X\leqq 3)=F(3)$ is definitely equal to $1$. Similarly, would the CDF be $y=0$ for $x<0$. In other words, my question is, is the CDF defined for all real $x \in (-\infty,\infty)$, much like the PDF?

Best Answer

Yes. Your intuition is correct. Indeed the correct CDF is:

$$ F(x) = \left\{ \begin{array}{ll} 0 & \quad x \leq 0 \\ \frac{1}{2}x^2 & \quad 0< x \leq 1 \\ -\frac{1}{2}x^2+2x-1 & \quad 1< x\leq 2\\ 1&\quad 2\leq x \end{array} \right. $$

Related Question