1

This seems like a really straightforward question but I think maybe I lack the vocabulary to search for it correctly.

Given two random variables $X$ and $Y$ with known probability distribution functions (not necessarily normal), how can I compute $P(X > Y)$? A numerical solution would be fine, I just can't seem to find any information on this topic.

As a possible naive solution, can it be said $P(X - Y > 0) = P(X > Y)$ in general or under known constraints?

StubbornAtom
  • 8,662
  • 1
  • 21
  • 67
  • 1
    Certainly P(X>Y)=P(X-Y>0) but if you don't know the specific distributions you don't have a numerical answer. But you might if you make certain assumptions. If X and Y are independent and continuous and identically distributed then P(X>Y)=P(Y>X)=1/2. Note that in this case P(X=Y)=0 because of the continuity of the random variables. – Michael R. Chernick Apr 07 '18 at 00:32

1 Answers1

6

If you have the joint distribution of $(X,Y)$ at hand, then by definition

\begin{align} P(X>Y)&=E[I_{X>Y}] \\&=\begin{cases}\sum\sum_{i>j}P(X=i,Y=j)&,\small\text{ if } (X,Y)\text{ is discrete having a pmf} \\\iint_{x>y}f_{X,Y}(x,y)\,dx\,dy&,\small\text{ if }(X,Y)\text{ is absolutely continuous with pdf }f_{X,Y}\end{cases} \end{align}

This definition is not valid for mixed random variables or if $(X,Y)$ does not have a pmf/pdf.

Assumption of independence and/or identical distributions of $X$ and $Y$ make further simplifications possible. With independence, joint pmf (pdf) factorizes as product of the marginal pmfs (pdfs). In particular, if $X$ and $Y$ are independent and identically distributed continuous random variables, then $P(X>Y)=1/2$ as mentioned in the comments.

And of course since $P(X>Y)=P(X-Y>0)$, if you can find the distribution of $X-Y$ from the joint distribution of $X$ and $Y$, then this probability can be calculated.

StubbornAtom
  • 8,662
  • 1
  • 21
  • 67