Find the CDF of $Y=X+|X-a|$ where $X\sim\text{unif}[0,b], b>a>0$

56 Views Asked by At

Given $X\sim\text{unif}[0,b]$, I need to find the following probability:

$$F(y)\triangleq\mathbb{P}(Y\leq y)$$

For all $y\in\mathbb{R}$, where $Y=X+|X-a|$ and $b>a>0$ are given positive constants.

My Attempt: It is clear that $Y\in[a,2b-a]$, therefore $F(y)=0$ for all $y<a$ and $F(y)=1$ for all $y\geq2b-a$. Now we only need to calculate $F(y)$ for $y\in[a,2b-a)$:

$$F(y)=\mathbb{P}(X+|X-a|\leq y)= \\=\mathbb{P}(2X-a\leq y \mid X<a)\mathbb{P}(X<a)+\mathbb{P}(a \leq y \mid X>a)\mathbb{P}(X>a) = \\ =\frac ab\mathbb{P}(X\leq \frac{y+a}{2} \mid X<a)+\frac{b-a}{b}\mathbb{P}(a \leq y \mid X>a)\triangleq\frac ab P_1+\frac{b-a}{b} P_2$$

I figured that $[X|X<a]\sim\text{unif}[a,b]$, therefore:

$$P_1=\frac{1}{b-a}\int_{a}^{\frac{y+a}{2}}\text{d}x=\frac 12 \frac{y-a}{b-a}$$

I used the fact that $(y+a)/2<b$ since I assumed $y<2b-a$. Now here's my problem - I have no idea how to work with $P_2$. My guess was that $P_2=1$ as long as $y\geq a$ (and this exactly agrees with my assumption that $y\in[a,2b-a)$), but in that case:

$$F(y)=\frac{a}{2b} \frac{y-a}{b-a}+\frac{b-a}{b}$$

This doesn't make sense to me. Here's an example why: If my calculations were true, then $F(a)=(b-a)/b$, but actually:

$$F(a)=\mathbb{P}(Y\leq a)=\mathbb{P}(Y=a)+\mathbb{P}(Y<a)=\mathbb{P}(Y=a)=\mathbb{P}(X\leq a)=a/b$$

($\mathbb{P}(Y<a)=0$ since $Y\geq a)$

Thank you!

1

There are 1 best solutions below

1
On BEST ANSWER

You have some cases reversed. If $X < a$, then $|X - a| = a - X$, hence $Y = a$ for this case. Note

$$Y = \begin{cases} a, & X \in [0,a] \\ 2X - a, & X \in (a, 1]. \end{cases}$$

Therefore, $$\Pr[Y \le y] = \Pr[a \le y \mid X \le a]\Pr[X \le a] + \Pr[2X - a \le y \mid X > a]\Pr[X > a].$$ Then since $$\Pr[a \le y \mid X \le a] = \mathbb 1(y \ge a) = \begin{cases} 0, & y < a, \\ 1, & y \ge a, \end{cases}$$ and $$\Pr[X \le \tfrac{a+y}{2} \mid X > a] = \frac{\frac{a+y}{2} - a}{b-a} \mathbb 1(y \ge a) = \frac{y-a}{2(b-a)} \mathbb 1(y \ge a)$$ we obtain $$\Pr[Y \le y] = \mathbb 1 (y \ge a)\left( \frac{a}{b} + \frac{y-a}{2(b-a)}\frac{b-a}{b}\right) = \frac{a+y}{2b} \mathbb 1(y \ge a)$$ which after correcting for the finite bounds on $X$, gives $$\Pr[Y \le y] = \begin{cases} 0, & y < a \\ \frac{a+y}{2b}, & a \le y \le 2b-a \\ 1, & y > 2b-a. \end{cases}$$