Finding pdf and cdf of a random variable

probabilityproof-verification

For a random variable given as:

$X=\begin{cases}3 , -3<x<5 \\ x,5 \leq x \leq 7 \\
8, 7<x<9\end{cases}$

I am not sure if this describes a discrete random variable or continuous, as if it is discrete I would just list all the values $X$ can take and their probability:

$X={3,5,6,7,8}$

$P(X=3)=\frac{7}{11}$

$P(X=5)=P(X=6)=P(X=7)=P(X=8)=\frac{1}{11}$

$F(x)=\begin{cases}0 , x\le -3 \\ \frac{7}{11},-3<x<5 \\
\frac{10}{11}, 5 \leq x \leq 7 \\ 1, x> 7\end{cases}$

I am not sure how to do it if X was a continuous random variable, as other examples I have seen already have a pdf given so cdf is just the integral.

UPDATE: as brought up by Bungo, I am also given that the random variable is sampled uniformly.

So I guess using the uniform distribution

$f(x)=\begin{cases}0 , otherwise \\ \frac{1}{8},-3<x<5 \\
\frac{1}{2}, 5 \leq x \leq 7 \\ \frac{1}{2}, 7<x<9 \end{cases},F(x)=\begin{cases}0 , otherwise \\ \frac{1}{8},-3<x<5 \\
\frac{5}{8}, 5 \leq x \leq 7 \\ \frac{9}{8}, 7<x<9 \end{cases} $

But I think this is incorrect as $\frac{9}{8}$ should be 1

Best Answer

The random variable is neither discrete nor continuous. It takes values other than $3,5,6,7,8$. It is defined on the space $(-3,9)$ with normalized Lebesgue measure as the basic probability measure. The correct values of $F(x)$ are $0$ for $x <3$, $2/3$ for $3 \leq x \leq 5$, $\frac {x+5} {12}$ for $5 \leq x \leq 7$, $1$ for $x \geq 8$.

Related Question