# Finding probability, Uniform distribution

What is the probability P(X>Y) given that X,Y are Uniformly distributed between [0,1]?

-

Draw the square $[0,1]\times[0,1]$ and the region $X>Y$ to see the answer.

-
if that so then it will be conditional probability, which is not. if I would solve it the way you suggested above, I have to choose X Or Y before calculating. if I choose X first the probability would be X. if i choose Y first the probability would be 1-Y. – Tarek Abed Feb 27 '13 at 13:37
@TarekAbed One way is to integrate over all possible choices of $X$. What Emanuele did is, she showed you how to visually see it - the square is a set of all possible choices for $(X,Y)$ with each region being as likely an occurrence as its area (because of the uniform distribution for both $X$ and $Y$). So of all possible choices, you need the proportion where $X>Y$, as she indicated in the answer -- it is exactly 1/2... – gt6989b Feb 27 '13 at 13:52

A more general approach is based on symmetry -- since $X,Y$ have the same distribution and $\mathbb{P}[X=Y] = 0$ (here, because both are continuous random variables), any outcome $(x,y)$ where $x>y$ is just as likely as the outcome $(y,x)$, so $X>Y$ exactly half the time.

Note that this is independent of distribution - as long as $\mathbb{P}[X=Y] = 0$.

-

Assuming $X$ and $Y$ are independent, Let $Z=X-Y$, Then were looking for $P(Z>0)$. To obtain the distribution of $Z$, you can convolve $X$ by $-Y$. The result will be a triange in the range $-1<x<1$. Then it it is obvious to see that $P(Z>0)=0.5$.

-
That might work, I will try, thanks a lot. – Tarek Abed Feb 27 '13 at 13:40