BRAGA

02 Writing02-02 Notes02-02-499

Compound Interest (Discrete)

Published 16 Apr 20264 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
  3. 03Real-world use
  4. 04The formula, piece by piece
  5. 05The formula in words
  6. 06Critical Concepts
  7. 07Step-by-step calculation (tiny example)
  8. 08Code examples
  9. 09Self-check: mathematical verification
  10. 10Common Pitfalls and Edge Cases
  11. 11References and Standard Results
A=P(1+rn)ntA = P\left(1 + \dfrac{r}{n}\right)^{nt}
(1)

We are working on discrete compound interest when compounding occurs nn times per year, given by

A=P(1+rn)nt,A = P\left(1 + \dfrac{r}{n}\right)^{nt},
(2)

where PP is principal, rr is the nominal annual rate in decimal form, nn is compounding frequency per year, and tt is time in years. The setting is periodic accrual (monthly, quarterly, and so on) with a constant rate and no cash flows between periods. The effective annual rate (EAR) satisfies

EAR=(1+rn)n−1.\text{EAR} = \left(1 + \frac{r}{n}\right)^n - 1.
(3)

Deep Breakdown

Annual compounding is the special case n=1n=1, which collapses to A=P(1+r)tA=P(1+r)^t. Discrete compounding generalizes this: each period the balance grows by a factor (1+rn)\left(1 + \frac{r}{n}\right), and there are ntnt such periods over tt years. Compare to continuous compounding A=PertA=Pe^{rt}, which is the limit n→∞n\to\infty for fixed rr and tt.

Why this matters in DA/DS:

  • loan and savings products quote nominal APR but compound monthly or daily,
  • Monte Carlo and cashflow models need the correct period rate,
  • comparing two products requires EAR, not nominal rr alone.

Flowchart

Principal P,nominal annualrate rChoosecompoundingfrequency n peryearPeriod rate r/nNumber ofperiods = n * tFuture value A =P*(1+r/n)^(n*t)Optionallycompute EAR =(1+r/n)^n - 1Compareproducts onEAR or A

Real-world use

Where it is used

Personal finance, corporate treasury, pricing of deposits, loan amortization, and any model where interest accrues on a fixed calendar.

Problem it solves

Nominal annual rates are ambiguous unless compounding frequency is known. The formula converts nominal rate plus frequency into a unique ending balance.

How it solves the problem

It applies the correct per-period rate rn\frac{r}{n} exactly ntnt times.

Example in a business

Marketing offers “8% annual interest.” Compliance asks what customers actually earn. If compounding is monthly, n=12n=12, and 10001000 grows to 1000(1+0.08/12)12≈1083.001000(1+0.08/12)^{12}\approx 1083.00 after one year, an EAR of about 8.30%8.30\%, not 8.00%8.00\%.

The formula, piece by piece

Symbol Meaning
AA Future value after tt years
PP Principal
rr Nominal annual rate, decimal
nn Compounding periods per year
tt Time in years
EAR\text{EAR} Effective annual rate

Future value:

A=P(1+rn)ntA = P\left(1 + \frac{r}{n}\right)^{nt}
(4)

Effective annual rate:

EAR=(1+rn)n−1\text{EAR} = \left(1 + \frac{r}{n}\right)^n - 1
(5)

Per-period rate:

rperiod=rnr_{\text{period}} = \frac{r}{n}
(6)

The formula in words

Split the year into nn equal slices. In each slice, apply interest at rate rn\frac{r}{n}. Chain ntnt slices for tt years. The expression (1+rn)nt\left(1+\frac{r}{n}\right)^{nt} is the cumulative growth factor.

Critical Concepts

  • Nominal vs effective: APR is not EAR unless n=1n=1.
  • Period units: tt must be in years if nn is “per year.”
  • Day-count conventions in markets add detail beyond this template.
  • Continuous limit: n→∞n\to\infty gives PertPe^{rt}.

Step-by-step calculation (tiny example)

Let P=1000P=1000, r=0.08r=0.08, n=4n=4 (quarterly), t=1t=1.

Step 1, period rate

rn=0.084=0.02\frac{r}{n} = \frac{0.08}{4} = 0.02
(7)

Step 2, periods

nt=4nt = 4
(8)

Step 3, future value

A=1000(1.02)4≈1082.43A = 1000(1.02)^4 \approx 1082.43
(9)

Step 4, EAR

EAR=(1.02)4−1≈0.08243\text{EAR} = (1.02)^4 - 1 \approx 0.08243
(10)

So about 8.24%8.24\% effective annual.

Code examples

Beginner example (Python)

python
P = 1000.0
r = 0.08
n = 12
t = 1.0
A = P * (1 + r / n) ** (n * t)
ear = (1 + r / n) ** n - 1
print(round(A, 2), round(ear, 6))

Beginner example (R)

r
P <- 1000.0
r <- 0.08
n <- 12
t <- 1.0
A <- P * (1 + r / n)^(n * t)
ear <- (1 + r / n)^n - 1
print(c(A = round(A, 2), EAR = round(ear, 6)))

Professional example (Python)

python
from dataclasses import dataclass

RANDOM_SEED = 42


@dataclass(frozen=True)
class DiscreteCompoundResult:
    future_value: float
    effective_annual_rate: float


def discrete_compound(*, principal: float, annual_rate: float, n_per_year: int, years: float) -> DiscreteCompoundResult:
    if principal <= 0:
        raise ValueError("principal must be positive")
    if n_per_year < 1:
        raise ValueError("n_per_year must be at least 1")
    if years < 0:
        raise ValueError("years must be non-negative")
    factor = (1 + annual_rate / n_per_year) ** (n_per_year * years)
    fv = principal * factor
    ear = (1 + annual_rate / n_per_year) ** n_per_year - 1
    return DiscreteCompoundResult(future_value=fv, effective_annual_rate=ear)


def main() -> None:
    _ = RANDOM_SEED
    out = discrete_compound(principal=2500.0, annual_rate=0.0525, n_per_year=365, years=3.0)
    print(out)


if __name__ == "__main__":
    main()

Self-check: mathematical verification

When n=1n=1, A=P(1+r)tA=P(1+r)^t, matching annual compounding. As nn increases with fixed r,tr,t, AA increases toward the continuous limit PertPe^{rt}.

Common Pitfalls and Edge Cases

  • Using rr as a percentage (8) instead of decimal (0.08).
  • Mismatching monthly tt in months vs formula expecting years.
  • Confusing nominal APR with effective yield.

References and Standard Results

  • Discrete compounding: per-period rate and exponent ntnt.
  • Effective annual rate definition.
  • Limit to continuous compounding as n→∞n\to\infty.

#economics-business#financial-mathematics#interest-and-growth

Keyboard shortcuts

Single keys, ignored while typing in a field or with Cmd, Ctrl or Alt held.

0
Home
1 2 3 4
Work, Writing, Tools, About
j / k
Next / previous section on this page
n / p
Next / previous project or essay
u
Up one level
l
Deutsch
t
Light or dark theme
?
This list
Esc
Close