1. ## Summation properties

Hi, I'm new to this forum and it's been frankly over 2 decades since I graduated from university... so I'm pretty rusty and hoping to get a little help with a certain math problem that has popped into my work life. I'd be forever grateful for any advice in solving this one that I've been wracking my old brain with for the past couple hours but getting nowhere.

Basically I'm trying to normalize a value, and in order to do that I need to know the maximum value it can have. I have two summations that both are equal to 1:
(n is a constant to all)

(o[1] + ... + o[n]) = 1
(c[1] + ... + c[n]) = 1

and I am taking the difference of each variable and summing their absolute values:

|o[1] - c[1]| + ... + |o[n] - c[n]|

Does anyone know what the maximum value that thing above can have?

Jeremy

2. ## Re: Summation properties

Since |a- b|< |a|+ |b|, |o[1] - c[1]| + ... + |o[n] - c[n]|< |o[1]|+ ...+ |o[n]|+ c[1]+ c[2]+ ...+ c[n]= 2.

Since this is a sum of absolute values the minimum value is 0.

3. ## Re: Summation properties

Hi and thanks for your answer and time, however I'm actually looking for its maximum value (not minimum value)...

4. ## Re: Summation properties

are the o's and c's any real numbers or are they all non-negative?

5. ## Re: Summation properties

Sorry I should have clarified, they are all real non-negative numbers.

6. ## Re: Summation properties

If they are non-negative I'm pretty sure that the maximum will be achieved with

$o_k = \dfrac 1 n \left(1 + (-1)^{k-1}\right),~k=0,1,\dots, n-1$

$c_k = \dfrac 1 n \left(1 + (-1)^k\right),~k=0,1,\dots, n-1$

$\displaystyle{\sum_{k=0}^n}~|o_k - c_k| = 2$

but maybe I'm misunderstanding the question.

7. ## Re: Summation properties

Basically what i'm trying to do is take an original set of percentages (that add up to 100%) and then take a secondary set of percentages and compare them to the original sets and come up with an error value from 0 to 1. 1 being the maximum error, 0 no error (ie: the percentages are exactly the same across the board). I'm basically building a cost function as part of a larger algorithm.

For example:

suppose we had a set of percentages like this:

o[1] = 20%, o[2] = 30%, o[3] = 50%

and we are given a chosen values of (say in this case we are wildly different than the original values)

c[1] = 85%, c[2] = 1%, c[3] = 14%

and we had to calculate an "error":

|o[1]-c[1]| = 65%
|o[2]-c[2]| = 29%
|o[3]-c[3]| = 36%

Summed together comes to 1.30, but I want to normalize this number so that it's expressed between 0-1. So I'm looking for a way to calculate what the maximum number can be in order to normalize the "error" calculation.

8. ## Re: Summation properties

After simming this a bit it's sure looking like 2 is a good normalizing factor.

9. ## Re: Summation properties

Hi Romsek, thanks for your answer it checks out perfectly after some extensive tests I ran!