Covariance of two dependent continuous random variables

probability

Suppose you have a string of length 1. A random point on this string is uniformly selected (P).

X is the continuous RV for the length of string before the selected point (length P).

Y is the continuous RV for the length of string after the selected point (length 1-P).

The covariance is defined as $Cov(X,Y)=E[XY]-E[X]E[Y]$.

$E[X], E[Y]$ are both $\frac{1}{2}$ (logically). I presume the joint PDF $f_{XY}(x,y)$ is $\frac{\sqrt{2}}{2}$ for all X in [0,1] and Y=1-X, since graphing the possible X,Y pairs in an x-y plane generates a line of length $\sqrt{1^2+1^2}$=$\sqrt{2}$. To be a valid PDF that integrates to 1, $\frac{\sqrt{2}}{2}$ is its height.

$E[XY] = \int_{-\infty}^{\infty}\int_{-\infty}^{\infty}xyf_{XY}(x,y)dydx =\frac{\sqrt{2}}{2}(\int_0^1(\int_{1-X}^{1-X+\delta}xydy)dx)=\frac{\sqrt{2}}{8}\delta$

I presume $E[XY]$ can be represented as 0. Logically, this seems plausible, as the line of possible X,Y pairs is infinitesimally "thin". But I am not sure if this math is legal.

Using the above results, my covariance is $\frac{-1}{4}$. I don't trust this given the extremely linear (dependent) relationship between X and Y.

Am I incorrect in my methodology? Where did I go wrong?

Best Answer

You could directly use $Y = 1-X$ to obtain $$E[XY] = E[X(1-X)] = E[X] - E[X^2] = \frac{1}{2} - \frac{1}{3} = \frac{1}{6}.$$

Related Question