I have a number $X$ (lets say $45$)
and I have five other numbers, lets say $(3, 4, ,5, 6, 7)$
I want to know the difference between my number and the other numbers like this:
(X-3) + (X-4) + (X-5) + (X-6) + (X - 7)
=
(45-3) + (45-4) + (45-5) + (45-6) + (45 - 7)
=
42 + 41 + 40 + 39 + 38
=
200
but what I found is:
if we get the average of these five points like this:
average = (3 + 4 + 5 + 6 + 7)/5 = 5
and then we calculate the difference between X and the average like this:
X-average = 45 - 5 = 40
and then multipli the result by the number of 5 (because we have 5 numbers) like this:
40 * 5 = 200
I got the same value.
so my questions is this a rule? or my numbers are setted by accident to have the same values by both ways?
if there is a prove mathmatically using whatever x and whatever points kindly tell me
More generally, if $(x_1,x_2,\dots,x_n)$ and $(y_1,y_n,\dots,y_n)$ then the average of differences: $$(x_1-y_1,x_2-y_2,\dots,x_n-y_n)$$ is just the difference of the averages.
In your case, all of the $x$ values are the same value, and hence their average is also the same value.
This is because:
$$(x_1-y_1)+(x_2-y_2)+\cdots+(x_n-y_n) = (x_1+x_2+\cdots +x_n)-(y_1+y_2+\cdots+y_n)$$
then divide both sides by $n$.
The averaging operation actually has a stronger behavior - it is what mathematicians call a "linear funtional."