# Calculating $\sum\left[ x^{2} y \right ]$

Could I calculate the answer to either

$$\sum\left[ x^{2} y \right ] - \sum xy$$

or

$$\sum \left[ \left ( x - \sum xy \right )^{2} y \right ]$$

If I had any of these variables

$\sum xy$; $\sum x$; $\sum y$; $\sum x^2$; $\sum y^2$;
and n ( the amount of items in the list )

adding more info:

I need to calculate the variance of a discrete probability distribution on my calculator. There is no function $\sum \left[ \left ( x - \sum xy \right )^{2} y \right ]$ on my model, and I was wondering if I could get there using the other functions. ( those listed above )

-
Can x and y be complex? –  kennytm Oct 30 '10 at 16:31
no, x is integers while y will be a percentage. see update. –  Stefan Oct 30 '10 at 16:33
Whoops, I tried to retag this "summation" and it turned into "sequences-and-series" instead. Dear moderators, what's a good tag for this? –  Rahul Oct 30 '10 at 18:29

## 1 Answer

No, you cannot recover the variance of the distribution from the information you have. Here is a simple counterexample: $$A = \{(0,1), (1,0), (2,0), (3,1)\},$$ $$B = \{(0,0), (1,1), (2,1), (3,0)\}.$$ Both $A$ and $B$ have the same $n = 4$, $\sum x = 6$, $\sum y = 2$, $\sum x^2 = 14$, $\sum y^2 = 2$, and $\sum xy = 3$, but $\sum x^2 y$ is $9$ for $A$ and $5$ for $B$.

-
do you know of a easy way to apply the formula above to A or B in this instance ( with a calculator's stats mode )? –  Stefan Oct 30 '10 at 18:58
@Stefan: If you have a discrete probability distribution $x \mapsto f(x)$, you could set $y = xf(x)$ instead of $y = f(x)$ like you are doing now, and you should then be able to find the variance in terms of $\sum xy$ etc. I don't know why that didn't occur to me before. –  Rahul Oct 30 '10 at 20:54