Covariance of not linearly dependent variablies

55 Views Asked by At

X ~ U(−1,1), $Y=SX$. Where $S$ is a random variable, with probability density function $p(s=1)=0.5$ and $p(s=-1)=0.5$.

Are my calculations of $Cov(X, Y)$ correct? Does $ E(X) = 0 \implies E(X^2) = 0$? How to calculate $E(XS), if \,\, E(X) \neq 0 \,\, and \,\, E(S) \neq 0$

Probability density function for X ~ U(−1,1): $$ p(x) = 1, x \in [-1, 1] \\[1ex] p(x) = 0, x \notin [-1, 1] \tag{1}\label{1} \\[1ex] U(a,b) = \frac{1}{b - a}, \,where \,\,b > a \\[1ex] X = U(-1, 1) = \frac{1}{1 - (-1)} = \frac{1}{2} $$

Expectation for X equals: $$ E(X) = \int_{-1}^1U(-1,1)p(x)dx \stackrel{\eqref{1}}= \int_{-1}^1\frac{1}{1 - (-1)}p(x)dx = \int_{-1}^1\frac{1}{2}dx = 0 \tag{2}\label{2} $$

Expectation for S equals: $$ E(S) = \sum_{i=1}^2p(s)s_i = \frac{1}{2}(-1) + \frac{1}{2}(1) = 0 \tag{3}\label{3} $$

Due to $x$ and $s$ are independent: $$ E(XS) = E(X)E(S) = 0 \tag{4}\label{4} $$

Covariance: $$ Cov (X, Y) = E\Bigl(\bigl(X - E(X)\bigr) * \bigl(XS - E(XS)\bigr)\Bigr) \stackrel{\eqref{2}} = \\[1ex] = E\Bigl(X \bigl(XS - E(XS)\bigr)\Bigr) \stackrel{\eqref{4}}= E\bigl(X(XS - 0)\bigr) = \\[1ex] = E(X^2S) \stackrel{\eqref{4}}= E(X^2)E(S) \stackrel{\eqref{3}}= E(X^2) * 0 = 0. $$