Contents
We are working on discrete compound interest when compounding occurs times per year, given by
where is principal, is the nominal annual rate in decimal form, is compounding frequency per year, and 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
Deep Breakdown
Annual compounding is the special case , which collapses to . Discrete compounding generalizes this: each period the balance grows by a factor , and there are such periods over years. Compare to continuous compounding , which is the limit for fixed and .
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 alone.
Flowchart
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 exactly times.
Example in a business
Marketing offers “8% annual interest.” Compliance asks what customers actually earn. If compounding is monthly, , and grows to after one year, an EAR of about , not .
The formula, piece by piece
| Symbol | Meaning |
|---|---|
| Future value after years | |
| Principal | |
| Nominal annual rate, decimal | |
| Compounding periods per year | |
| Time in years | |
| Effective annual rate |
Future value:
Effective annual rate:
Per-period rate:
The formula in words
Split the year into equal slices. In each slice, apply interest at rate . Chain slices for years. The expression is the cumulative growth factor.
Critical Concepts
- Nominal vs effective: APR is not EAR unless .
- Period units: must be in years if is “per year.”
- Day-count conventions in markets add detail beyond this template.
- Continuous limit: gives .
Step-by-step calculation (tiny example)
Let , , (quarterly), .
Step 1, period rate
Step 2, periods
Step 3, future value
Step 4, EAR
So about effective annual.
Code examples
Beginner example (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)
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)
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 , , matching annual compounding. As increases with fixed , increases toward the continuous limit .
Common Pitfalls and Edge Cases
- Using as a percentage (8) instead of decimal (0.08).
- Mismatching monthly in months vs formula expecting years.
- Confusing nominal APR with effective yield.
References and Standard Results
- Discrete compounding: per-period rate and exponent .
- Effective annual rate definition.
- Limit to continuous compounding as .