I am working on the following exercise:
Let $X,Y$ be two discrete uniform and independent RVs. Show by COMPUTATION that $Cov(X, Y ) = 0$.
We defined $Cov(X,Y) := E(XY)-E(X)E(Y)$. I know that $E(X) = \frac{n+1}{2}$, but I do not know how to compute $E(XY)$ in this general setting with the sum definition of $E(X)$. Is there a trick?
Let's start from the definition of covariance.
$$ \text{Cov}(X, Y) = \mathbb{E}[XY] - \mathbb{E}[X]\mathbb{E}[Y] $$
Recall the definition of expectation, which, in the case of continuous variables, can be expressed as follows:
$$ \mathbb{E}[X] = \int_{x \in \chi} x f(x) \, dx $$
where $f(x)$ denotes the probability density function for the random variable.
Let $X \sim U(a, b)$ and $Y \sim U(c, d)$. Then, we can apply the definition of expectation to rewrite covariance as
$$ \text{Cov}(X, Y) = \int_a^b \int_c^d x y f_x(x) f_y(y) \, dx \, dy - \int_a^b x f_x(x) \, dx \int_c^d y f_y(y) \, dy $$
Because the two RVs are independent, we can see how the nested integral can be rearranged into the second term, resulting in zero.