Comparing r
The Impact of r¶
The difference between rates can have dramatic impacts when considering them in the context of compounding. First, work through graphically how different rates would look.
In [13]:
p = 100
years = list(range(31))
r1 = .05
A1 = [compoundInterest(p,r1,t) for t in years]
r2 = .10
A2 = [compoundInterest(p,r2,t) for t in years]
r3 = .15
A3 = [compoundInterest(p,r3,t) for t in years]
plt.plot(years,A1,label="r=5%")
plt.plot(years,A2,label="r=10%")
plt.plot(years,A3,label="r=15%")
plt.xlabel("Year")
plt.ylabel("A")
plt.title("Compound Interest")
plt.legend()
plt.show()
The difference over the long run is quick amazing. If we were to look at the total amount of money earned between the three accounts, it is obvious that the 15% account earns much more than 3X the 5% account because of the impact of compouding.
In [14]:
print(A3[-1] - p)
print(A2[-1] - p)
print(A1[-1] - p)