# Math Help - Sum problem!

1. ## Sum problem!

Hi all

I have the following problem, i have attached the following equation into a file.

lets suppused i have the following vector :

A={10,20,50,60,70,49,21,23}

how i solve the equation (my main problem is how to threat the double sum function with diffrent indexies i.e. i,j) ?

Best Regreats

2. ## any one ?

Can any one help me please (it's very urget)?

3. Originally Posted by cobra
Can any one help me please (it's very urget)?
This is the same as ((sum of all Ai) squared) minus (sum of (Ai squared)) (note the parentheses!).

4. OKI thank you, but what if i have minus i.e.:

sum(sum(Ai-Aj)

The first sum is from 0:N (N-vector length)

The secound sum is from 0:N (without when i=j)

Best Regretes,

Dvir

5. Originally Posted by cobra
sum(sum(Ai-Aj)

The first sum is from 0:N (N-vector length)

The second sum is from 0:N (without when i=j)
I assume the outer sum is over i and the inner over j (not =i).
Write sum'_j to indicate that the sum is over j, but skips the term j=i.
There are n+1 terms in sum_i and n terms in sum'_j.

Let A = sum_i Ai = sum_j Aj. Thus sum'_j Aj = A - Ai. Then

sum_i(sum'_j(Ai-Aj))
= sum_i(nAi - sum'_j Aj)
= sum_i(nAi - (A-Ai))
= sum_i((n+1)Ai - A)
= (n+1)sum_i (Ai) - (n+1)A
= 0.

6. Thanks u All.

So the answer is in this case is always zero.