Choose a random point in a triangle. Denote (X, Y) is the coordinate. (a) Find density functions $f_x, f_Y$

Choose a random point in a triangle.

Denote (X, Y) is the coordinate. enter image description here

(a) Find density functions $f_x, f_Y$

(b) $X,Y$ are independent random variables ?

(c) Find cumulative distribution function of $X-Y$

My solution:

(a).

$f(x,y)=\frac{1}{Area\space of \space the \space traingle}=\frac{1}{1}=1$

Case 1: $-1<x<0,y<x+1$

$f_x(x)=\int_{-\infty}^\infty f(x,y) dy=\int_{0}^{x+1} 1dy=x+1$

$f_y(y)=\int_{-\infty}^\infty f(x,y) dx=\int_{y-1}^{0} 1dx=-y+1$

Case 2: $0<x<1,y<-x+1$

$f_x(x)=\int_{-\infty}^\infty f(x,y) dy=\int_{0}^{-x+1} 1dy=-x+1$

$f_y(y)=\int_{-\infty}^\infty f(x,y) dx=\int_{1-y}^{1} 1dx=y$

(b). X,Y are dependant

(c). $f_{X+Y}(a)=\int_{-\infty}^\infty f_X(a-y)f_Y(y)dy \implies f_{X-Y}(a)=\int_{-\infty}^\infty f_X(a+y)f_Y(-y)dy$ I get stuck here.

I am not really sure that my answer is correct ( I have no idea how to find $fx,fy$ without get it into cases).

I will be grateful for feedback\help.

Thanks !


There are some mistakes in your marginal density functions.

For $0 \lt y \lt 1, y-1 \lt x \lt 1-y$

So, $ \displaystyle f_Y(y) = \int_{y-1}^{1-y} dx = 2 (1-y) ~, 0 \lt y \lt 1$

$ \displaystyle f_X(x) = \int_0^{1+x} dy = 1+x ~, ~-1 \lt x \lt 0$

$ \displaystyle f_X(x) = \int_0^{1-x} dy = 1-x ~, ~0 \lt x \lt 1$

For CDF of $Z = X-Y$,

$ \displaystyle F_Z(z) = P(Z \leq z) = 1 - P(Z \gt z)$

$ \displaystyle = 1 - \int_0^{(1-z)/2} \int_{y+z}^{1-y} dx ~dy = 1 - \frac{(1-z)^2}{4}$

The support of $Z$ is $(-1, 1)$