Suppose that at the beginning of each month I make a deposit of 100 dollars on an account with a 1% monthly rate. I want to calculate the earned interest after 6 months.
Method 1
End of month Earned Interest
1 1 (100*0.01)
2 2.01 ((200 + 1)*0.01)
3 3.0201 ((300 + 2.01)*0.01)
4 4.030201 ((400 + 3.0201)*0.01)
5 5.04030201 ((500 + 4.030201)*0.01)
6 6.0504030201 ((600 + 5.04030201)*0.01)
Total earned interest after 6 months:
21.1510060301
Method 2
End of month Account Balance (invested + interests)
1 101 (100*1.01)
2 203.01 ((101+100)*1.01)
3 306.0401 ((203.01+100)*1.01)
4 410.100501 ((306.0401+100)*1.01)
5 515.20150601 ((410.100501+100)*1.01)
6 621.3535210701 ((515.20150601+100)*1.01)
Total earned interest after 6 months:
21.3535210701 (621.3535210701 - 600)
Why the difference?
With the second method, more than 20 cents more are earned. I thought the difference could be because of rounding issues, but I've even tried to write a Clojure program using its Ratio type and the differences are the same:
211510060301/10000000000 (method 1)
213535210701/10000000000 (method 2)
So, how is the difference explained?
Your method 1 is incorrect. You forgot to add the first dollar of interest to the amount on which interest was calcuated in month 3 (and the same error is repeated thereafter). Here is the correct version:
A better table might have a column for the cumulative interest and account balance: