What is the PDF of absolute value of $X - Y$ where $X$ and $Y$ are the Cartesian coordinates of a randomly chosen point in a triangle?

685 Views Asked by At

Here is the question:

Let X and Y be the Cartesian coordinates of a randomly chosen point (according to an uniform PDF) in the triangle with vertices at (0,1), (0,-1), and (1,0). Find the PDF of |X-Y|. (Problem 4.6 of Introduction to Probability, 2nd edition, by Dimitri P. Bertsekas and John N. Tsitsilis)

According to my understanding of this question, I drew up a plot of the area to be calculated:

enter image description here

I came up with a very strange answer for half of the area (the lower area): 5z^2/2+z-3/2... (obviously wrong).

While the correct answer is very simple (z/2 +(z^2)/4)+(1/4-((1-z)^2)/4)=z

What have I done wrong, and is there a easier way to find the total of the area for |X-Y|?

2

There are 2 best solutions below

2
On

In your picture, there are three triangles with side lengths in the ratio $1:1:2$.

There is the largest triangle with longest edge having endpoints $(0,1)$ and $(0,-1)$. It has area $1$.

There is a medium triangle with longest edge having endpoints $(0,1)$ and $(0, -z)$. By similarity, it has area $\left(\frac{1+z}{2}\right)^2$.

There is the smallest triangle with longest edge having endpoints $(0,1)$ and $(0, z)$. By similarity, it has area $\left(\frac{1-z}{2}\right)^2$.

The desired region is the medium triangle minus the small triangle, which has area $\left(\frac{1+z}{2}\right)^2 - \left(\frac{1-z}{2}\right)^2 = \frac{1}{4} \cdot 2 \cdot 2z = z$.

0
On

It will be easier to understand the three triangles, as described in comments above:

enter image description here