Need to construct a finite series with certain properties

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
avalys
Messages
2
Reaction score
0
I need to construct a finite series with N elements, such that:

element 1 has the value A
element N has the value B
elements 1 through N sum to Z

A, B and Z are all positive numbers, as is Z. Additionally, I would like minimize the largest difference between any adjacent numbers in the series - i.e. minimize max_i(abs(N_i - N_i+1))

It is trivial to construct this series:

A, (Z-A-B)/(N-2), (Z-A-B)/(N-2), ..., B

which has the appropriate sum - but I don't know how to implement the minimax criteria.
 
Mathematics news on Phys.org
avalys said:
It is trivial to construct this series:

A, (Z-A-B)/(N-2), (Z-A-B)/(N-2), ..., B

which has the appropriate sum - but I don't know how to implement the minimax criteria.

You can't do any better than to have all of the interior points increasing (if a < b), decreasing (if a > b), or equal (if a = b). So it looks like you already have the answer.