Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I had posted this question on stack overflow because I am trying to implement a method that will loop through a set of percentages and add or remove them to a value based on some properties that are set. Here is a link to the question. I believe I have the compounding part correct. I partially have the non-compounding part, the problem is that I need to add just 1 to the very end instead of every time through the loop. The other issue I am facing is how do I mix compounding and non-compounding in the formula. Basically, I have the following scenarios:

All percentages are compounded and removed from the total.
All percentages are non-compounded and removed from the total.
All percentages are compounded and added to the total.
All percentages are non-compounded and added to the total.
All percentages are compounded, but some are removed and some are added.
All percentages are non-compounded, but some are removed and some are added.
Some percentages are compounded and some are non-compounded, but they are all added.
Some percentages are compounded and some are non-compounded, but they are all removed.
Some percentages are compounded and some are non-compounded, and they could be removed or added.

I believe I covered everything.

Thanks for the help

share|improve this question
add comment

1 Answer

What base are the non-compounded ones taken on? For example, assume a 100 base price, a +3% and -6% compounded, a +10% and -8% non-compounded tax. If the non-compounded taxes are on the base you just get $100\cdot1.03\cdot0.94+100\cdot0.10-100\cdot0.08=100(1.03\cdot0.94+0.10-0.08)$ for a final price or $100(1.03\cdot0.94+0.10-0.08)-100$ for the total tax. Is this what you are after?

share|improve this answer
    
If I understand your answer correctly, I believe what I want to do is take the compounded tax on the new base that is calculated from the previous tax. –  Xaisoft Apr 14 '11 at 19:38
    
Yes, that is the meaning of compounded. The total tax won't change with the order you apply them, but how much each tax is will do so. –  Ross Millikan Apr 14 '11 at 20:01
    
I did your example in a calculator, what is supposed to be the correct result. –  Xaisoft Apr 14 '11 at 20:07
    
I just made it up on the fly, but I get 98.82 for the final price, or a tax of -1.18 –  Ross Millikan Apr 14 '11 at 20:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.