Skip to content
Tutorials Center
My learning

Topics

Lesson 38 of 38 · Projects and Practice

Project: A Loan and Savings Calculator

Use geometric series, exponentials and logarithms to build a savings-goal and loan-payment calculator, then plot balances and compare with a spreadsheet-style table.

Algebra 2 ideas run real financial tools. In this project you build a small calculator that answers three practical questions using what you learned in this chapter: geometric series, exponential growth and logarithms.

  1. How much will regular savings grow to?
  2. How long will it take to reach a goal?
  3. What is the monthly payment on a loan, and what does the balance look like over time?

All amounts are in generic currency units and the calculators are teaching models (they ignore fees, taxes and rate changes), so do not use them as financial advice.

Part 1: Regular savings (a geometric series)

You deposit D at the end of every month into an account paying an annual rate r, compounded monthly. Let i = r/12 be the monthly rate. The deposit made k months before the end has grown by (1 + i)^k. The total after n deposits is

Text
FV = D·(1 + i)^0 + D·(1 + i)^1 + ... + D·(1 + i)^(n-1)

That is a geometric series with a₁ = D and ratio 1 + i:

Text
FV = D · ((1 + i)ⁿ - 1) / i
Python Savings future value: series vs formula

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The loop adds interest, then the new deposit, each month; the formula is the sum of the series. They agree.

Part 2: Time to reach a goal (logarithms)

How many months n until FV = G? Rearrange G = D((1 + i)ⁿ - 1)/i:

Text
(1 + i)ⁿ = 1 + G·i/D     →     n = ln(1 + G·i/D) / ln(1 + i)
Python Months to reach a savings goal

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Part 3: Loan payments (a geometric series again)

Borrow L and repay it in n equal monthly payments M at monthly rate i. The loan's value is the sum of the discounted payments:

Text
L = M/(1 + i) + M/(1 + i)² + ... + M/(1 + i)ⁿ
  = M · (1 - (1 + i)^(-n)) / i

so the payment is

Text
M = L · i / (1 - (1 + i)^(-n))
Python Loan payment and balance curve

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Extension ideas

  • Compare 15-year and 30-year payments for the same loan. Which costs more in total interest, and why?
  • Add continuous compounding (FV = P·e^(rt)) as an option and compare it with monthly compounding.
  • Use the infinite-series formula a₁/(1 - r) to check a perpetuity: a payment M forever at monthly rate i is worth M/i.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. Regular monthly deposits that earn compound interest form which kind of series?

    Each deposit is multiplied by the factor (1 + i) once more per month, so the terms have a common ratio.
  2. 2. Which tool lets you solve for the number of months n in (1 + i)ⁿ = c?

    Taking logs gives n = ln(c)/ln(1 + i).
  3. 3. If the interest rate is 0, what does a loan payment M become?

    With no interest you just split the loan into n equal parts, so M = L/n (the formula approaches this as i goes to 0).

Summary

  • Savings with regular deposits: FV = D((1 + i)ⁿ - 1)/i, a finite geometric series.
  • Time to a goal uses logarithms: n = ln(1 + Gi/D)/ln(1 + i).
  • Loan payment M = L·i/(1 - (1 + i)^(-n)) also comes from a geometric series.
  • Models help you see how rate and time interact, but they simplify real life.

Return to the Algebra 2 track page.