# Calculate cumulative probability for X~U(0,1)

I'm trying to calculate $$P\left( |X - \mu_X| \geq k \sigma_X \right)$$ for $$X\sim$$uniform(0,1). I've calculated that $$E[X]=1/2$$, Var$$[X]=1/12$$, know that $$f_X(x) = 1, 0 \leq x \leq 1$$ and calculated that $$$$P(X \leq x) = F_X(x) = \begin{cases} 0 & x<0,\\ x & 0\leq x\leq 1\\ 1 & x>1 \end{cases}.$$$$

For my attempt at the problem, I have done: \begin{aligned} P\left(\left| X-\frac{1}{2}\right|\geq\frac{k}{\sqrt{12}}\right) & = 1 - P\bigg(\frac{1}{2}-\frac{k}{\sqrt{12}}\leq X\leq \frac{1}{2}+\frac{k}{\sqrt{12}} \bigg)\\ & = 1-\int_{\frac{1}{2}-\frac{k}{\sqrt{12}}}^{\frac{1}{2}+\frac{k}{\sqrt{12}}} f_X(x)dx\\ & = 1-\frac{k}{\sqrt{3}} \end{aligned} However, the solutions in my book is: $$$$P\left(\left| X-\frac{1}{2}\right|\geq\frac{k}{\sqrt{12}}\right) = \begin{cases}1-\frac{2k}{\sqrt{12}} & k<\sqrt{3}\\ 0& k\geq \sqrt{3} \end{cases}.$$$$ I don't understand how they went from the first step to the last step, and the work they did was omitted. If anyone could elucidate, I would greatly appreciate it.

• $f_X(x)=1$ only when $x\in (0,1)$. When is $(1/2-k/\sqrt{12}, 1/2+k/\sqrt{12}) \subset (0,1)$? Nov 15, 2019 at 21:12
• $1- \dfrac{2k}{\sqrt{12}} = 1- \dfrac{k}{\sqrt{3}}$ Nov 15, 2019 at 21:31

you have done well but there are some points you are missing, first of all:

$$$$P(X \leq x) = F_X(x) = \begin{cases} 0 & x<0,\\ x & 0\leq x < 1\\ 1 & x \geq1 \end{cases}.$$$$

and another one is in the last step of calculations, where:

\begin{aligned} P\left(\left| X-\frac{1}{2}\right|\geq\frac{k}{\sqrt{12}}\right) & = 1 - P\bigg(\frac{1}{2}-\frac{k}{\sqrt{12}}\leq X\leq \frac{1}{2}+\frac{k}{\sqrt{12}} \bigg)\\ & = 1-\int_{\frac{1}{2}-\frac{k}{\sqrt{12}}}^{\frac{1}{2}+\frac{k}{\sqrt{12}}} f_X(x)dx\\ \end{aligned}

So if $$\frac{1}{2}+\frac{k}{\sqrt{12}} < 1$$ and $$\frac{1}{2}-\frac{k}{\sqrt{12}} \geq 0$$ then $$F_X(x) = x$$ and :

$$1-\int_{\frac{1}{2}-\frac{k}{\sqrt{12}}}^{\frac{1}{2}+\frac{k}{\sqrt{12}}} f_X(x)dx = 1-(\frac{1}{2}+\frac{k}{\sqrt{12}}-(\frac{1}{2}-\frac{k}{\sqrt{12}})) = 1-\frac{2k}{\sqrt{12}} = 1-\frac{k}{\sqrt{3}}$$

In this case, the conditions leads to:

$$\frac{1}{2}+\frac{k}{\sqrt{12}} < 1 \Rightarrow k < \sqrt{3}$$

and if $$\frac{1}{2}+\frac{k}{\sqrt{12}} \geq 1$$ then $$F_X(x) = 1$$, So:

$$1-\int_{\frac{1}{2}-\frac{k}{\sqrt{12}}}^{\frac{1}{2}+\frac{k}{\sqrt{12}}} f_X(x)dx = 1 - 1 = 0$$

In this case, the conditions leads to:

$$\frac{1}{2}+\frac{k}{\sqrt{12}} \geq 1 \Rightarrow k \geq \sqrt{3}$$

Also, in case of $$\frac{1}{2}+\frac{k}{\sqrt{12}} < 0$$ we will have $$F_X(x) = 0$$, So:

$$1-\int_{\frac{1}{2}-\frac{k}{\sqrt{12}}}^{\frac{1}{2}+\frac{k}{\sqrt{12}}} f_X(x)dx = 1 - 0 = 1$$

But in this case we will see that:

$$\frac{1}{2}+\frac{k}{\sqrt{12}} < 0 \Rightarrow k < -\sqrt{3} \Rightarrow \frac{1}{2}-\frac{k}{\sqrt{12}} > 1$$

So, it will be unacceptable.