Distribution of $X-Y$ where $X,Y$ iid ~U[0,a]

57 Views Asked by At

The original question was to calculate the characteristic function of a triangular distribution, with PDF $\frac{1}{a}(1-\frac{|x|}{a})$ for $x\in(-a,a)$, so I was calculating it by definition, but at my class, we "saw" that this PDF is also PDF of $X-Y$, where X,Y iid and ~$U(0,a)$. Here I am, trying to prove it.

I calculated the PDF of -Y, which is: $g(y)=\frac{1}{a}$ for $y\in(-a,0)$

now, the density of X-Y should be $h(x)=\int_{-\infty}^{\infty}f(x-y)g(y)dy$, but I do not know how to convert it from here.

1

There are 1 best solutions below

0
On BEST ANSWER

Let's do it for special case $a=1$.

Observe that $f(x-y)g(y)$ takes values in $\{0,1\}$ and: $$f(x-y)g(y)=1\iff f(x-y)=1\text{ and } g(y)=1\iff 0<x-y<1\text{ and }-1<y<0\iff$$$$ x-1<y<x\text{ and }-1<y<0$$

That inspires to discern the cases:

  • $x\leq-1$ resulting in $\int^{\infty}_{-\infty} f(x-y)g(y)dy=0$ because the integrand is $0$ for every $y$.
  • $-1<x<0$ resulting in $\int^{\infty}_{-\infty} f(x-y)g(y)dy=\int_{-1}^xdy=1+x$
  • $0<x<1$ resulting in $\int^{\infty}_{-\infty} f(x-y)g(y)dy=\int_{x-1}^0dy=1-x$
  • $1\leq x$ resulting in $\int^{\infty}_{-\infty} f(x-y)g(y)dy=0$ because the integrand is $0$ for every $y$.

So actually we found that $h(x)=1-|x|$ if $-1<x<1$ and $h(x)=0$ otherwise.

This is the result for $a=1$.

We can find the more general case by observing that $\frac1{a}h(\frac{x}{a})$ is the PDF for $a(X-Y)$