# Finding the range of uniformly distributed random variable when some probability is given

Though this question is quite basic, I'm having a hard time understanding it. This is the question from my textbook:

"A random variable $X$ is uniformly distributed in the interval $(-k, k)$. Find $k$ if $P(X \ge 1) = \frac 13$"

My working:

From what we know about uniform probability distributions, the probability mass function $f(x)$ would be $\frac {1}{2k}$ (This is correct since the area of the rectangle formed in the given interval is $=1$).

I thought this question has something to do with cumulative distribution function. And so I found the CDF (which I found by integrating $\int_{-k}^x f(y) dy$ ), which turned out to be:

CDF $= \begin{cases} 0 & x \gt k \\ \frac x{2k}\ + \frac 12 & -k\le x \lt k \\ 0 & x \ge k\end{cases}$

Since $P(X \ge 1) = \frac 13$, we could find $P( X \le 1 ) = F(x) = \frac 23$

I tried equating $F(1)$ with $\frac 23$, which gave me $k = -3$. The negative value of $k$ doesn't seem right to me. When I omit the negative sign, I seem to get the correct value.

Is this correct? Or is there a proper way of approach?

• But $F(1) = \frac{1}{2k} + \frac{1}{2} = \frac{2}{3} \implies \frac{1}{2k} = \frac{1}{6} \implies k=3$. – Shirish Kulhari May 8 '18 at 10:39

Well, the CDF is $\mathsf P(X\leqslant x)=F_X(x)=\begin{cases}0 &:& x< -k\\ (x+k)/2k &:& -k\leqslant x< k\\ 1 &:& k\leqslant x\end{cases}$
(Recall that a CDF must have $\lim_{x\to\infty} F_X(x)=1$ among other things.)
So, if we assume $1\leqslant k$, then we have $\mathsf P(X\geqslant 1)=(k-1)/2k$ which is to equal $1/3$
Therefore we find that $\dfrac{k-1}{2k}=\dfrac 13\iff 3(k-1)=2k\iff k-3=0\iff\boxed{k=3}$
[Test: $(3-1)/6=1/3 ~~\checkmark$]