0

Let's assume I have a very long list of non-negative numbers (X1, X2, ...), but I don't know the values in the list. What I do know is the rolling sums of the elements (let's say: the sum of all 5 consecutive elements in the original list) Thus, we know the differences of the values which are 5 values away from eachother.

How do I calculate the original values?

I know that there are less equations than variables (exactly 4 less in this case), but I have a constrait on the variables that they are non-negative, which should help I think.

E.g.: If X6=X1-4, it means X1 is at least 4. If the list is long enough, shouldn't these restrictions help to calculate the exact original values?

babo
  • 1
  • I believe it's a [Change-making problem](https://en.wikipedia.org/wiki/Change-making_problem) – Mustapha Belmokhtar Dec 04 '17 at 11:12
  • At first sight I don't see how are they connected. Coul you explain it? – babo Dec 04 '17 at 22:40
  • the change making problem, is to find an algorithm to specify what are the pieces that should be returned to the user knowing their sum, let's say your X's are the pieces of money that you have in the machine, and their sum is what it should be returned to the user as change, this way I see it in that point, that your problem converges to the one I cited above – Mustapha Belmokhtar Dec 05 '17 at 01:10

0 Answers0