# Uniform distribution joint $\to$ marginal

Let vector $(X,Y)$ have a uniform distribution on the set $N = \{ (x,y): x<1,y<1,1<x+y\}$. Determine distribution $X-Y$.

So far I've thought of this: \begin{align} P[X | Y=y] &\sim U(0,1-x) \space \forall y \in (0,1)\\ P[Y|X=x] &\sim U(0,1-y) \space \forall x \in (0,1)\\ \end{align} but honestly I don't know how to go about it.

Any hints?

-
Draw the picture of $N$ and draw a line $X-Y<C\Leftrightarrow Y>X-C$. And think carefully how you would interprete the areas. –  newbie May 25 '13 at 19:00
You may want to discuss the conditions $C\leq -1, -1<C\leq 0,0<C\leq 1$ and $C>1$. –  newbie May 25 '13 at 19:06

So, random variables $X$ and $Y$ have joint pdf $f(x,y)$:

which appears thusly:

Let $Z=X-Y$. Then, the cdf of $Z$ is $P(Z<z)$ = $P(X-Y<z)$:

where Prob is a mathStatica function.

Simply differentiate to obtain the pdf ...

-

There is actually a fully "visual" solution to this.

The couple $(X,Y)$ is uniformly distributed on the triangle $T$ with vertices $(1,0)$, $(1,1)$ and $(0,1)$. Thus $-1\leqslant X-Y\leqslant1$ with full probability. Let $-1\leqslant z\leqslant1$. The intersection of the triangle $T$ with the line $x-y=z$ is a segment of length $1-|z|$.

(This segment starts from the boundary $x+y=1$ of $T$ at the point $(\frac12(1+z),\frac12(1-z))$ and ends at the point $(1,1-z)$ on the boundary $x=1$ if $z\gt0$ and at the point $(1+z,1)$ on the boundary $y=1$ if $z\lt0$.)

Thus the density of $X-Y$ is proportional to the function $f:z\mapsto(1-|z|)\mathbf 1_{|z|\leqslant1}$. Since the integral of $f$ is $1$, $f$ is the density of $X-Y$.

-