discrepancy between 'mean times n' and sum

517 Views Asked by At

I hope my title somehow encapsulates my problem.

Let's say we have a 1-D Grid with the values 2,1,5,8,1,1. Imagine those values are of some physical quantity $\alpha$. The mean of this would be $(2+1+5+8+1+1)/6 = 3$

Now let's say we have some function $f(x) = x^2$, which computes another quantity $\beta$ out of the initial ones. When we put in our mean it yields $f(3) = 9$. So one could think that the total $\beta$ would be $6 \times 9=54$.

Now let's compute $\beta$ directly for each grid element and sum it up to get the total amount. $\beta_{total} = 4+1+25+64+1+1=96$

$96 \neq 54$.

Intuitively, I'd say 96 is the right result, but I'm kind of at a loss why the mean times the number of values fails.

2

There are 2 best solutions below

0
On

What you are saying is the special property of linear functions. If $f(x)$ is not linear, the mean value of $f(x)$ will not be equal to $f(\bar {x})$ in general.

0
On

the reason it fails is there's different types of means (arithmetic , harmonic , geometric, ... ) and the one you chose fails for the data given. you may want to look up the L2 norm and square it as that's what PARI/GP uses for norml2 commands. so you may want to look at norms in general in math, not means.