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 \begin{equation} P(X \leq x) = F_X(x) = \begin{cases} 0 & x<0,\\ x & 0\leq x\leq 1\\ 1 & x>1 \end{cases}. \end{equation}
For my attempt at the problem, I have done: \begin{equation} \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} \end{equation} However, the solutions in my book is: \begin{equation} 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}. \end{equation} 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.
you have done well but there are some points you are missing, first of all:
\begin{equation} P(X \leq x) = F_X(x) = \begin{cases} 0 & x<0,\\ x & 0\leq x < 1\\ 1 & x \geq1 \end{cases}. \end{equation}
and another one is in the last step of calculations, where:
\begin{equation} \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} \end{equation}
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.