Covariance of two functions of the same random variable

311 Views Asked by At

I'm trying to compute the following, and I think I have a minor intuition about it, but I'm not sure.

I have a discrete uniform random variable $X$ that can take values between $[-a,a]$ for a total of ${2a+1}$ possible values.

I have two functions of $X$, $f(X)$ and $g(X)$.

I want to compute the Covariance between $f(X)$ and $g(X)$ using the definition:

$Cov(f(X),g(X))= E[f(X)g(X)] - E[f(X)]E[g(X)]$

The problem I'm having is with $E[f(X)g(X)]$.

$E[f(X)]$ and $E[g(X)]$ are otherwise well defined.

What I'm thinking is that, since both functions are functions of the same random variable, every result that involves $$\sum_{i} \sum_j f(x_i)g(x_j) $$ for every $j\neq i$ cancels, because the probability that $X$ adopts two different values at the same time is zero.

And so, what I'm thinking is that $$E[f(X)g(X)]=\frac{1}{2a+1} \sum_{i=-a}^a f(x_i)g(x_i)$$

Does this make sense?