# When is the sum of a product (approx) equal to the product of sums?

Consider a population where each individual has two attributes, $x_i$ and $y_i$. These attributes come from two random variables, $X$ and $Y$, respectively.

I have $n$ observations of such population. I am looking for the conditions under which the following is true (as an approximation in the sample, certainly in the population):

$$\sum_{i} x_i y_i \approx \sum_i x_i \sum_i y_i$$

My intuition tells me this is true if $X$ and $Y$ are independent (or at least, not linearly dependent, i.e. uncorrelated). Is this the case? Does this depend on the underlying distributions in the population? For example, does this requires independent observations?

Mathematically, my intuition comes from the known fact that if $X$ and $Y$ are independent, $E(X \cdot Y) = E(X)E(Y)$. I thought the above would be the "sample-equivalent" to this equality. However, math does not seem to match:

$$\sum_{i} \frac{x_i y_i}{n} \approx \sum_i \frac{x_i}{n} \sum_i \frac{ y_i}{n}$$

Which means that:

$$n \sum_{i} x_i y_i \approx \sum_i x_i \sum_i y_i$$

This is not quite the same of what I am trying to prove.

• Well $\sum_i x_i \sum_j y_j = \sum_i x_i y_i + \sum_{i \neq j} x_i y_j$ so i think your approximate identity is more about the off diagonal terms – P.Windridge May 19 '17 at 8:51
• Also, I guess you've seen the Cauchy Schwarz inequality... this might give you some ideas about where your identity /doesn't/ hold.. – P.Windridge May 19 '17 at 9:07
• For this approximation to have any chance of holding, some of the data will have to be negative and some positive so that the $n(n-1)$ terms you have dropped will experience a lot of cancellation. Unless you provide some extremely restrictive assumptions about the $(x_i,y_i)$ pairs, little can be said. – whuber May 19 '17 at 13:00
• @whuber So we can say that, in the general case, the equivalence does not hold. I am happy to accept such answer. – luchonacho May 19 '17 at 13:11