# Reversing a summation algorithum

I have a bit of a math problem on a hobby project of mine, and I was hoping some of the experts here could give me some guidance.

I am preforming some calculations on a set of numbers where the following is true with any given value for w, where:

For example:

Given the set [{C=100,S=47.9},{C=50,S=28.0}], and w=100

Except now what I need to do is find w for any given value of t. I know I need to solve for w in the equation somehow, and then it should be simple enough to convert it to code for my algorithm. Unfortunately I am having a bit of trouble with the math involved. I know I did these before in calc, but I can't quite remember it.

Would anyone be able to show me how I would go about solving this problem?

Thanks for your time!

-

## migrated from programmers.stackexchange.comAug 17 '13 at 20:52

This question came from our site for professional programmers interested in conceptual questions about software development.

The thing to notice though is that denominator is the same in each term, so it can be factored out ofthe sum. A little rearranging of the terms will then get w one side and t, the sum of all the cn and the sum of cn/sn on the other. – Charles E. Grant Aug 16 '13 at 21:23
This question appears to be off-topic because it is about a solution to a math problem, and one of interest only to the OP. – Charles E. Grant Aug 16 '13 at 21:25
This question might be better suited for math.SE. I have flagged it for migration. – Bart van Ingen Schenau Aug 17 '13 at 11:09

## 1 Answer

It's actually just algebra, no calculus involved. The trick is that the denominator is constant, so you can factor it out.

Sum(Cn) = t(Sum(Cn/Sn) + w/100)
Sum(Cn)/t = Sum(Cn/Sn) + w/100
100 * (Sum(Cn)/t - Sum(Cn/Sn)) = w

-
You are absolutely right! It looks so much easier when you put it like that. Many thanks! :) – drkstr1 Aug 16 '13 at 22:42