# If X is uniformly distributed over $(-1, 1)$, find $P(|X| \gt \frac12)$

If X is uniformly distributed over $(-1, 1)$, find $P(|X| \gt \frac12 )$

I know what the pdf looks like, it is $0$ when $x \gt 1$ and $x \lt -1$, and when $-1 \lt x \lt 1$ it is a constant $\frac12$.
if the question was asking for $P(X \gt \frac12)$ I would do $\int_\frac12^1 \frac12 dx$ and get the answer $\frac14$, but because there is an absolute value around the X in the question I don't know what to do?
Do I have to calculate two integrals and add them?
$\int_\frac12^1 \frac12 dx$ and $\int_{-1}^{-\frac12} \frac12 dx$?

• Yes, you should go with the approach you have mentioned. But clean up your integrals - they don't look right. – soakley Nov 13 '15 at 2:32
• why $\int x dx$? lets start from here – Seyhmus Güngören Nov 13 '15 at 2:32
• You are overcomplicating this. For uniform distribution, evaluating the probability $P(X \gt \frac{1}{2})$ only needs the integral $\int_{\frac{1}{2}}^1 \frac{1}{2} \;dx$, and instead of "integrating" per se, you only need the length of the interval $(1/2,1)$ in proportion to $(-1,1)$. Now consider the union of intervals where $|X|\gt \frac{1}{2}$. – hardmath Nov 13 '15 at 2:33
• I fixed the intervals, I put the x there beause I got confused with the formula of expectation of a pdf – idknuttin Nov 13 '15 at 2:42
• hardmath, the union of intervals where $|X| \gt \frac12$ is the length of the interval $(\frac12, 1)$ and the length of the interval $(-1, {-\frac12})$, this is the same thing as what I am saying in my integrals correct? – idknuttin Nov 13 '15 at 2:49

\begin{align} \mathsf P(\lvert X\rvert > \tfrac 1 2) & = \displaystyle\int_{\{x\in(-1;1):\lvert x\rvert>1/2\}} f_X(x)\operatorname d x \\[1ex] & = \int_{(-1;-1/2)\cup(1/2;1)}\tfrac 1 2\operatorname d x \\[1ex] & = \int_{-1}^{-1/2} \tfrac 1 2\operatorname d x+ \int_{1/2}^1 \tfrac 12\operatorname d x \end{align}
\begin{align} \mathsf P(\lvert X\rvert > \tfrac 1 2) & = \frac{\lvert(-1;-1/2)\cap(1/2;1)\rvert}{\lvert(-1;-1/2)\cap(1/2;1)\rvert}{\lvert(-1;1)\rvert} \\[1ex] & = \tfrac 1 2 \end{align}
• if I wanted to find the density function of random variable |X| would it simply be this? f(|X|) = \begin{cases} \frac12, & \text{if $x$ is in [0, 1)} \\ 0, & \text{else} \end{cases} – idknuttin Nov 13 '15 at 17:43
• Not quite, @idknuttin Remember that the absolute signage folds two intervals into one. $$f_{\lvert X\rvert}(x) = \big(f_X(x)+f_X(-x)\big) \mathbf 1_{x\in [0;1)} = \begin{cases}1 & : x\in [0;1) \\ 0 &: \textsf{otherwise} \end{cases}$$ As a reality check: the integral of the pdf over the support must equal unity. – Graham Kemp Nov 13 '15 at 22:04