Two random variables, X and Y, have the joint density function:
$$f(x, y) = \begin{cases} 2 & 0 < x \le y < 1 \\ 0 & ioc\end{cases}$$
Calculate the correlation coefficient between X and Y.
I am pretty much stuck because y is an upper limit for x, and x is a bottom limit for y; so calculating medians and such is proving too hard for me. I'd appreciate it if anyone could lend me a hand and teach me how to solve this.
If it helps save some time, the marginal equations are $f_x (x) = 2 - 2x$ and $f_y (y) = 2y$.
Let $X$ and $Y$ random variables with joint density function given by $$f(x,y)=\begin{cases} 2, \quad \text{if}\quad 0<x\leqslant y<1,\\ 0, \quad \text{if}\quad \text{otherwise}\end{cases}.$$ The coefficient correlation of $X$ and $Y$ is given by, $$\boxed{\rho_{XY}=\frac{{\rm Cov}(X,Y)}{\sigma_{X}\sigma_{Y}}=\frac{\sigma_{XY}}{\sigma_{X}\sigma_{Y}}}$$ where ${\rm Cov}(X,Y)=\mathbb{E}[XY]-\mathbb{E}[X]\mathbb{E}[Y]$ is the covariance of $X$ and $Y$ and $\sigma_{X}$ and $\sigma_{Y}$ standard deviations.
Now,
Therefore, $$\rho_{XY}=\frac{{\rm Cov}(X,Y)}{\sigma_{X}\sigma_{Y}}=\frac{1/36}{(\sqrt{2}/6)^{2}}=\frac{1}{2}>0.$$ Since $\rho_{XY}>0$ then $X$ and $Y$ they are positively, linearly correlated, but not perfectly so.