# Comparison of Uniformly Distributed R.V.

My Calculus of Probability is very rusty, so I need your advice.

I have two independent uniformly distributed random variables $X$ and $Y$ with densities: $$\begin{split} f_X(\omega) &:= \begin{cases} \frac{1}{\Phi} &\text{, if } \xi\leq \omega < \xi + \Phi \\ 0 &\text{, otherwise}\end{cases} \\ f_Y (\omega) &:= \begin{cases} \frac{1}{\Psi} &\text{, if } \eta \leq \omega < \eta + \Psi \\ 0 &\text{, otherwise}\end{cases} \end{split}$$ (with $\xi,\eta \in \mathbb{R}$ and $\Phi,\Psi >0$) and I'm interested in finding sufficient conditions for $\mathbb{P}(X<Y) >0$.

Now, since $\mathbb{P}(X<Y) = \mathbb{P}(X-Y<0)$ and since $X-Y$ is a r.v. with density $f_{X-Y} = f_X * f_{-Y}$ (where $*$ is the convolution operator), I find that a sufficient condition to $\mathbb{P}(X<Y) >0$ is that $0$ lies to the right of the minimum of the support of $f_{X-Y}$, for in this case: $$\mathbb{P}(X<Y) = \mathbb{P}(X-Y<0) = \int_{-\infty}^0 f_{X-Y}(\omega)\ \text{d} \omega > 0\; .$$ Is that correct?

Moreover, I find that $f_{X-Y}$ is a trapezoidal density function. Could someone check if: $$\begin{split} f_{X-Y} (\omega) &= \begin{cases} 0 &\text{, if } \omega < \xi - \eta - \Psi\\ \frac{\omega + \eta + \Psi -\xi}{\Phi \Psi} &\text{, if } \xi - \eta - \Psi \leq \omega < \xi + \Phi - \eta - \Psi\\ \frac{1}{\Psi} &\text{, if } \xi + \Phi - \eta - \Psi \leq \omega < \xi - \eta\\ \frac{\xi + \Phi - \eta -\Psi - \omega}{\Phi \Psi} &\text{, if } \xi - \eta \leq \omega < \xi + \Phi - \eta\\ 0 &\text{, if } \xi +\Phi -\eta \leq \omega \end{cases}\qquad \text{ if } \Psi \geq \Phi \\ f_{X-Y} (\omega) &= \begin{cases} 0 &\text{, if } \omega < \xi - \eta - \Psi\\ \frac{\omega + \eta + \Psi -\xi}{\Phi \Psi} &\text{, if } \xi - \eta - \Psi \leq \omega < \xi - \eta\\ \frac{1}{\Phi} &\text{, if } \xi - \eta \leq \omega < \xi + \Phi - \eta - \Psi\\ \frac{\xi + \Phi - \eta -\Psi - \omega}{\Phi \Psi} &\text{, if } \xi + \Phi - \eta - \Psi \leq \omega < \xi + \Phi - \eta\\ 0 &\text{, if } \xi +\Phi -\eta \leq \omega \end{cases}\qquad \text{ when } \Phi > \Psi \end{split}$$ is correct? These computations imply that $\mathbb{P}(X<Y)>0$ iff $\xi - \eta -\Psi < 0$, i.e. iff $\xi < \eta +\Psi$, don't they?

Is there a simpler way to solve the problem?

I have not check you calculations after the main question. Since both $X, Y$ are uniform random variables and they are independent, $\Pr\{X < Y\} = 0$ if and only if the support of $X$ is "greater" than $Y$, i.e.

$$\xi \geq \eta + \Psi$$

In other words, when the above does not hold, i.e. the support is overlapping or $Y$ is great than $X$ almost surely, $$\xi < \eta + \Psi$$ i.e. the result you obtain, then you have the desired result.

Hint:

To avoid the (annoying) calculation of the density of $X-Y$ apply: $$P\left(X<Y\right)=\int P\left(X<Y\mid Y=y\right)f_{Y}\left(y\right)dy=\int P\left(X<y\right)f_{Y}\left(y\right)dy$$

The first equality is (almost) general.

The second equality follows from the independence of $X$ and $Y$.