# Cdf and pdf of absolute difference of two standard uniform variables X = |X1 − X2|

1. Oct 25, 2009

### roemi

Hi guys!

1. The problem statement, all variables and given/known data

Do you know how to get the cdf and pdf of the absolute difference of two iid standard uniform X1 and X2 : X = |X1 − X2| ?

2. Relevant equations

Come across http://en.wikipedia.org/wiki/Triang...difference_of_two_standard_uniform_variables" we know that the cdf is 2x - x2 and the pdf is 2 -2x.
How do we get/prove it?

Thank you very much!

Last edited by a moderator: Apr 24, 2017
2. Oct 25, 2009

### roemi

Re: cdf and pdf of absolute difference of two standard uniform variables X = |X1 − X2

3. The attempt at a solution

Is it solvable using the joint pdf ? Still trying various boundaries for the integral... kinda stuck there... please help ... T_T
$$F_{X}(x) = \int \int_{|x_{1}-x_{2}|\leq x} f_{x_{1}}(x_{1}) f_{x_{2}}(x_{2}) dx_{1}dx_{2}$$

3. Oct 25, 2009

### roemi

Re: cdf and pdf of absolute difference of two standard uniform variables X = |X1 − X2

*bump*

4. Oct 26, 2009

### Billy Bob

Re: cdf and pdf of absolute difference of two standard uniform variables X = |X1 − X2

Yes, this is the way to do it. I'll use different variables to simplify notation. X is uniform on [0,1], and so is Y.

Fix t. Find P(|X-Y|<t). Draw the region {(x,y) : |x - y| < t}. Intersect it with the unit square [0,1] x [0,1]. The shape of the resulting region depends on t. For the interesting (i.e. nontrivial) values of t, you get a hexagon.

Since f_X(x) and f_Y(y) are constants, the "integration" can be done simply by using elementary geometry formulas (e.g. area of square, area of triangle).

5. Oct 26, 2009

### roemi

Re: cdf and pdf of absolute difference of two standard uniform variables X = |X1 − X2

Thanks for the reply.

Umm... what would be the boundaries/intervals in the first and second integral ?

6. Oct 27, 2009

### roemi

Re: cdf and pdf of absolute difference of two standard uniform variables X = |X1 − X2

*bump*

Anyone interested in solving this problem, please dont hesitate,

still waiting ... :)

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook