From Iteration to Insight

An interactive demonstration of how applying mathematical theory provides a more elegant and efficient solution to a real-world problem.

College Savings Calculator

Adjust the sliders to see how two different methods calculate your required monthly savings. Notice the difference in speed and approach.

Bisection Method

(Iterative Guessing)

$1,161.10

Calculation Time: ...

Formula Method

(Direct Calculation)

$1,161.10

Calculation Time: ...

Approach 1: The Intuitive Numerical Solution

A logical first approach is to build a simulation. We can create a function that takes a monthly contribution as input and simulates the account balance year by year. The bisection method is a root-finding algorithm that repeatedly guesses an answer to narrow down the correct result.

How It Works:

  1. Start with a low guess (e.g., $0) and a high guess.
  2. Calculate the final balance using the midpoint of the guess range.
  3. If the balance is too high, the midpoint becomes the new high guess.
  4. If the balance is too low, the midpoint becomes the new low guess.
  5. Repeat until the balance is acceptably close to zero.

Visualizing the Convergence

Connecting Theory to Practice: The Derivation

The "magic" formula isn't arbitrary; it's derived from the fundamental, year-by-year calculation using the sum of a finite geometric series. This shows how theory creates efficient, practical solutions.

1. The Long Calculation (The Sum of Present Values):

PV = P/(1+r)¹ + P/(1+r)² + ... + P/(1+r)ⁿ

2. Factor out the Payment (P):

PV = P [ 1/(1+r)¹ + 1/(1+r)² + ... + 1/(1+r)ⁿ ]

3. Identify the Geometric Series and Apply its Sum Formula:

Sum = a * (1 - qⁿ) / (1 - q)

4. Simplify the Expression:

Sum = (1 - (1+r)⁻ⁿ) / r

5. The Final Formula:

PV = P [ (1 - (1+r)⁻ⁿ) / r ]