Notes/Time Value of Money: Why a Dollar Today Beats a Dollar Tomorrow
Back to Notes

Time Value of Money: Why a Dollar Today Beats a Dollar Tomorrow

Present value, future value, discounting, continuous compounding, why Euler's number shows up in finance, and NPV for engineering decisions.

2025-08-22AI-Synthesized from Personal NotesSource1900+ words of raw notesEnrichmentsCode blocks, Interactive charts, GraphicsPipelineMulti-pass AI review · Score: 98/100
Share
Quantitative FinanceTime ValueCompound InterestNpv

Terminology

Term Definition
Time Value of Money (TVM) The principle that a sum of money is worth more now than the same sum in the future, because money available now can earn interest
Present Value (PV) The current worth of a future cash flow, obtained by discounting it at a given rate: $PV = \frac{FV}{(1+r)^n}$
Future Value (FV) The value a present sum grows to after compounding at rate $r$ for $n$ periods: $FV = PV \cdot (1+r)^n$
Discount Rate The interest rate used to convert future cash flows back to their present value, reflecting opportunity cost and risk
Compounding The process where earned interest itself earns interest in subsequent periods, causing exponential growth
Continuous Compounding The limit of compounding as the number of periods per year approaches infinity, yielding $FV = PV \cdot e^{rt}$
Euler's Number ($e$) The mathematical constant $e \approx 2.71828$, the base of the natural logarithm, which emerges as the limit $\lim_{n \to \infty}(1 + 1/n)^n$
Net Present Value (NPV) The sum of all discounted future cash flows minus the initial investment: $NPV = \sum_{t=0}^{T} \frac{C_t}{(1+r)^t}$. Positive NPV means the project adds value
Annuity A series of equal cash flows occurring at regular intervals over a fixed number of periods
Internal Rate of Return (IRR) The discount rate at which a project's NPV equals zero, used to compare the profitability of different investments

What & Why

A dollar today is worth more than a dollar next year. This is not an opinion or a rule of thumb: it is a mathematical consequence of the fact that money can be invested to earn a return. If you can earn 5% annually, then $1.00 today becomes $1.05 in a year. Equivalently, $1.05 arriving next year is worth only $1.00 right now.

This principle, the time value of money, is the foundation of all quantitative finance. Every bond price, stock valuation, mortgage payment, and capital budgeting decision rests on it. For engineers and computer scientists, TVM matters whenever you need to compare costs or benefits that occur at different points in time: should you invest in a faster server now, or wait for next year's hardware? Should you take on technical debt today and pay it down later?

The core operations are straightforward:

  • Compounding moves money forward in time (present to future)
  • Discounting moves money backward in time (future to present)
  • NPV aggregates multiple cash flows at different times into a single present-day number

What makes this topic rich is the mathematics that emerges when you push compounding to its limits. Compound interest at $n$ periods per year, as $n \to \infty$, converges to $e^{rt}$. This is why Euler's number $e$ appears throughout finance, differential equations for growth, and continuous-time models like Black-Scholes.

How It Works

Simple vs Compound Interest

Simple interest grows linearly: you earn interest only on the original principal. Compound interest grows exponentially: each period's interest earns interest in subsequent periods.

$\text{Simple: } FV = PV \cdot (1 + r \cdot n)$
$\text{Compound: } FV = PV \cdot (1 + r)^n$

For small $n$ the difference is minor, but over long horizons compound interest dominates dramatically. This is the "eighth wonder of the world" effect.

The Compounding Frequency Spectrum

When interest compounds more than once per year, the formula adjusts. If the annual rate is $r$ and compounding occurs $m$ times per year for $t$ years:

$FV = PV \cdot \left(1 + \frac{r}{m}\right)^{m \cdot t}$

As $m$ increases, the future value grows, but with diminishing returns. The table below shows \$1000 at 10% for 1 year:

Frequency ($m$) Name $FV$ after 1 year
1 Annual \$1,100.00
4 Quarterly \$1,103.81
12 Monthly \$1,104.71
365 Daily \$1,105.16
$\infty$ Continuous \$1,105.17

The gap between daily and continuous compounding is less than a penny. But the mathematical elegance of the continuous case makes it the standard in quantitative finance.

Why $e$ Shows Up in Finance

Consider investing \$1 at 100% annual interest, compounded $m$ times per year:

$FV = \left(1 + \frac{1}{m}\right)^m$

As $m \to \infty$, this expression converges to Euler's number:

$e = \lim_{m \to \infty}\left(1 + \frac{1}{m}\right)^m \approx 2.71828$

This is not a coincidence or a convention. It is a mathematical fact: the exponential function $e^x$ is the unique function that equals its own derivative, $\frac{d}{dx}e^x = e^x$. This property makes $e$ the natural base for modeling continuous growth and decay.

For a general rate $r$ over time $t$, continuous compounding gives:

$FV = PV \cdot e^{rt}$

And discounting (the inverse operation):

$PV = FV \cdot e^{-rt}$
PV present value compound x e^(rt) FV future value discount x e^(-rt) PV present value FV future value Compounding moves money forward; discounting moves it backward

Discounting and Present Value

Discounting answers the question: "What is a future payment worth today?" If someone promises you \$1000 in 3 years and the discount rate is 8%, the present value is:

$PV = \frac{1000}{(1.08)^3} = \frac{1000}{1.2597} \approx \$793.83$

This means you should be indifferent between receiving \$793.83 today and \$1000 in three years, assuming you can invest at 8%. The discount rate captures the opportunity cost of capital: what you could earn by investing elsewhere.

Higher discount rates shrink present values more aggressively. This reflects greater risk or better alternative investments:

Net Present Value (NPV)

NPV extends discounting to a sequence of cash flows. Given an initial investment $C_0$ (typically negative) and future cash flows $C_1, C_2, \ldots, C_T$:

$NPV = \sum_{t=0}^{T} \frac{C_t}{(1+r)^t} = C_0 + \frac{C_1}{(1+r)} + \frac{C_2}{(1+r)^2} + \cdots + \frac{C_T}{(1+r)^T}$

The decision rule is simple:

  • NPV > 0: the project creates value, accept it
  • NPV < 0: the project destroys value, reject it
  • NPV = 0: the project breaks even at the required rate of return

For engineering decisions, NPV lets you compare options with different cost and benefit timelines on equal footing. Should you spend \$50,000 now on infrastructure that saves \$15,000/year for 5 years? NPV gives you a concrete answer.

NPV for Engineering Decisions: A Worked Example

Suppose you are deciding whether to invest \$50,000 in a caching layer that will save \$15,000 per year in server costs for 5 years. Your company's cost of capital is 10%.

Initial investment: \$50,000. Sum of discounted inflows: \$56,862. NPV = \$56,862 - \$50,000 = \$6,862. Since NPV > 0, the caching investment creates value.

Complexity Analysis

TVM computations are numerically simple but appear everywhere in financial systems. The computational cost depends on the operation:

Operation Time Space Notes
Future value (single) $O(\log n)$ $O(1)$ Exponentiation by squaring for $(1+r)^n$
Present value (single) $O(\log n)$ $O(1)$ Same exponentiation, then one division
Continuous FV/PV $O(1)$ $O(1)$ Single $e^{rt}$ call via hardware or library
NPV of $T$ cash flows $O(T)$ $O(1)$ One pass through cash flows with running discount factor
Annuity PV (closed form) $O(\log n)$ $O(1)$ Uses $\frac{1 - (1+r)^{-n}}{r}$ formula
IRR (Newton's method) $O(T \cdot k)$ $O(1)$ $k$ iterations, each evaluating NPV in $O(T)$

The key insight: individual TVM calculations are cheap. The computational challenge in finance comes from doing millions of them (pricing a portfolio of bonds, running Monte Carlo simulations) or from the numerical precision required (avoiding floating-point drift over many compounding periods).

Numerical Precision

When computing $(1+r)^n$ for large $n$, floating-point errors accumulate. The relative error after $n$ multiplications is approximately:

$\epsilon_{\text{rel}} \approx n \cdot \epsilon_{\text{machine}}$

For 64-bit doubles ($\epsilon_{\text{machine}} \approx 10^{-16}$), this stays negligible for typical financial horizons ($n < 10^4$). For high-frequency trading or very long-dated instruments, arbitrary-precision arithmetic or logarithmic accumulation ($\exp(n \cdot \ln(1+r))$) may be needed.

Implementation

Future Value (Discrete Compounding)

FUNCTION futureValue(pv, rate, periods):
    INPUT: pv (present value), rate (interest rate per period), periods (number of periods)
    OUTPUT: future value after compounding

    RETURN pv * power(1 + rate, periods)

Present Value (Discrete Discounting)

FUNCTION presentValue(fv, rate, periods):
    INPUT: fv (future value), rate (discount rate per period), periods (number of periods)
    OUTPUT: present value

    RETURN fv / power(1 + rate, periods)

Continuous Compounding

FUNCTION futureValueContinuous(pv, rate, time):
    INPUT: pv (present value), rate (annual rate), time (years)
    OUTPUT: future value under continuous compounding

    RETURN pv * exp(rate * time)

FUNCTION presentValueContinuous(fv, rate, time):
    INPUT: fv (future value), rate (annual rate), time (years)
    OUTPUT: present value under continuous discounting

    RETURN fv * exp(-rate * time)

Net Present Value

FUNCTION npv(rate, cashFlows):
    INPUT: rate (discount rate per period), cashFlows (array of cash flows, index 0 = time 0)
    OUTPUT: net present value

    total ← 0
    discountFactor ← 1.0

    FOR t ← 0 TO LENGTH(cashFlows) - 1 DO
        total ← total + cashFlows[t] * discountFactor
        discountFactor ← discountFactor / (1 + rate)
    END FOR

    RETURN total

Annuity Present Value (Closed Form)

FUNCTION annuityPV(payment, rate, periods):
    INPUT: payment (equal periodic payment), rate (discount rate), periods (number of payments)
    OUTPUT: present value of the annuity

    IF rate = 0 THEN
        RETURN payment * periods
    END IF

    RETURN payment * (1 - power(1 + rate, -periods)) / rate

Internal Rate of Return (Newton's Method)

FUNCTION irr(cashFlows, tolerance, maxIterations):
    INPUT: cashFlows (array), tolerance (convergence threshold), maxIterations
    OUTPUT: discount rate where NPV = 0

    guess ← 0.10    // start with 10% as initial guess

    FOR i ← 1 TO maxIterations DO
        npvValue ← npv(guess, cashFlows)
        derivative ← npvDerivative(guess, cashFlows)

        IF |derivative| < 1e-12 THEN
            ERROR "Derivative too small, method may not converge"
        END IF

        newGuess ← guess - npvValue / derivative

        IF |newGuess - guess| < tolerance THEN
            RETURN newGuess
        END IF

        guess ← newGuess
    END FOR

    ERROR "IRR did not converge within maxIterations"

FUNCTION npvDerivative(rate, cashFlows):
    INPUT: rate, cashFlows
    OUTPUT: d(NPV)/d(rate)

    total ← 0
    FOR t ← 1 TO LENGTH(cashFlows) - 1 DO
        total ← total - t * cashFlows[t] / power(1 + rate, t + 1)
    END FOR
    RETURN total

Real-World Applications

  • Bond pricing: a bond's price is the NPV of its coupon payments plus the discounted face value at maturity. Every bond trader uses TVM dozens of times per day
  • Mortgage amortization: monthly mortgage payments are calculated using the annuity formula. The split between principal and interest each month comes directly from TVM math
  • Capital budgeting: companies use NPV to decide which projects to fund. A new data center, a software rewrite, or a hiring plan all get evaluated by discounting projected cash flows
  • Engineering trade-offs: should you optimize code now (developer time cost) to save on compute later (server cost savings)? NPV quantifies the answer by putting both costs in present-day terms
  • Options pricing: the Black-Scholes model uses continuous discounting ($e^{-rt}$) to price options. The risk-free rate enters through the TVM framework
  • Startup valuation (DCF): discounted cash flow analysis projects a company's future free cash flows and discounts them to today. This is the standard method for valuing businesses
  • Technical debt quantification: you can model technical debt as a negative cash flow stream, with the "interest" being increased maintenance cost over time. NPV helps decide when refactoring pays off

Key Takeaways

  • Money has a time dimension: \$1 today is worth more than \$1 in the future because it can be invested to earn a return
  • Compounding moves money forward in time ($FV = PV \cdot (1+r)^n$), discounting moves it backward ($PV = FV / (1+r)^n$)
  • Euler's number $e$ emerges naturally from continuous compounding: $\lim_{m \to \infty}(1 + r/m)^{mt} = e^{rt}$
  • NPV converts a stream of future cash flows into a single present-day number, enabling apples-to-apples comparison of projects with different timelines
  • TVM computations are individually $O(1)$ to $O(\log n)$, but financial systems run millions of them, making efficient implementation important