Annuities and Perpetuities

30 minintermediate

4. Annuities and Perpetuities

Annuities and perpetuities are fundamental concepts in finance, representing streams of cash flows over time. Understanding how to value these cash flow streams is essential for many financial applications, including loan analysis, retirement planning, bond valuation, and stock valuation. Annuities involve finite streams of payments, while perpetuities involve infinite streams. Both concepts build on time value of money principles and provide foundations for more advanced financial analysis.

Annuity Fundamentals

An annuity is a series of equal payments made at regular intervals over a specified period. Annuities are common in finance - mortgages are annuities, car loans are annuities, retirement savings plans often involve annuities, and many investment products are structured as annuities. Understanding annuities helps analyze these common financial instruments.

Ordinary Annuities vs. Annuities Due

The timing of annuity payments creates an important distinction. Ordinary annuities (also called annuities in arrears) make payments at the end of each period. Annuities due make payments at the beginning of each period. This timing difference affects valuation because payments received earlier have higher present values.

For example, a mortgage is typically an ordinary annuity - payments are made at the end of each month. A lease payment might be an annuity due - payments are made at the beginning of each period. The distinction matters because receiving payments earlier increases their present value.

The relationship between ordinary annuities and annuities due can be expressed mathematically. The present value of an annuity due equals the present value of an ordinary annuity multiplied by (1 + r), where r is the interest rate per period. This reflects the fact that each payment in an annuity due is received one period earlier than in an ordinary annuity.

Annuity: A series of equal payments made at regular intervals over a specified period. Ordinary annuities make payments at the end of each period, while annuities due make payments at the beginning of each period.

Fixed vs. Variable Annuities

Annuities can also be classified by whether payments are fixed or variable. Fixed annuities make constant payments over the annuity's life. Variable annuities make payments that vary based on the performance of underlying investments or other factors.

Fixed annuities are simpler to value because payments are known. Variable annuities require more complex valuation because future payments are uncertain. However, variable annuities can provide protection against inflation or participation in investment returns, which may be valuable to some investors.

Annuity Payment Structures

Annuity payment structures vary widely. Some annuities make level payments throughout their lives. Some make payments that increase over time (growing annuities). Some make payments that decrease over time. Some defer payments for a period before beginning (deferred annuities). Understanding these structures helps analyze different financial instruments.

The choice of payment structure affects both valuation and suitability for different purposes. Level payment annuities are common for loans and mortgages. Growing annuities might be used for investments where returns are expected to increase. Deferred annuities are common in retirement planning, where payments begin after retirement.

Present Value of Annuities

The present value of an annuity is the sum of the present values of all individual payments. Because annuity payments are equal and occur at regular intervals, we can derive formulas that simplify this calculation. These formulas are among the most important in finance.

Ordinary Annuity PV Formula

The present value of an ordinary annuity can be calculated using the formula:

0.0000(saved0.0000 (saved

This equation states that the present value (PVPV) equals the payment amount (PMTPMT) times an annuity factor. The annuity factor, 1−(1+r)−nr\frac{1 - (1+r)^{-n}}{r}, represents the present value of $1 per period for nn periods at interest rate rr.

The annuity factor decreases as the interest rate increases, because higher interest rates reduce the present value of future payments. The annuity factor increases as the number of periods increases, because more payments create more value, though the increase diminishes as periods become more distant.

Let's visualize how the present value of annuities varies with interest rates and time:

Python exercise

#| label: annuity-0
#| fig-cap: "Present Value of Annuities: Sensitivity to Interest Rates and Time Periods"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false

# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib

import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display

# Set style
plt.style.use('default')
plt.rcParams['figure.facecolor'] = 'white'
plt.rcParams['axes.grid'] = True
plt.rcParams['grid.alpha'] = 0.3

# Annuity parameters
payment = 1000  # $1,000 per period
periods_range = np.arange(1, 31)  # 1 to 30 periods
interest_rates = np.array([0.02, 0.04, 0.06, 0.08, 0.10])  # 2% to 10%

# Calculate PV of ordinary annuity: PV = PMT * [(1 - (1+r)^(-n)) / r]
def pv_annuity(pmt, r, n):
    if r == 0:
        return pmt * n
    return pmt * (1 - (1 + r) ** (-n)) / r

fig, axes = plt.subplots(2, 2, figsize=(16, 10))
fig.suptitle('Present Value of Annuities: Sensitivity to Interest Rates and Time Periods', 
             fontsize=16, fontweight='bold', y=0.995)

# Plot 1: PV vs Number of Periods (different interest rates)
ax1 = axes[0, 0]
colors = ['blue', 'green', 'orange', 'red', 'purple']
for i, rate in enumerate(interest_rates):
    pv_values = [pv_annuity(payment, rate, n) for n in periods_range]
    ax1.plot(periods_range, pv_values, linewidth=2.5, marker='o', markersize=4,
            label=f'r = {rate*100:.0f}%', color=colors[i], alpha=0.8)

ax1.set_xlabel('Number of Periods (n)', fontsize=12, fontweight='bold')
ax1.set_ylabel('Present Value ($)', fontsize=12, fontweight='bold')
ax1.set_title('PV of Annuity vs. Number of Periods\n(PMT = $1,000 per period)', 
              fontsize=13, fontweight='bold')
ax1.grid(True, alpha=0.3, linestyle='--')
ax1.legend(loc='best', fontsize=9)
ax1.set_ylim(0, 30000)

# Plot 2: PV vs Interest Rate (different time periods)
ax2 = axes[0, 1]
rate_range = np.linspace(0.01, 0.15, 50)
time_periods = [5, 10, 15, 20, 30]
for i, n in enumerate(time_periods):
    pv_values = [pv_annuity(payment, r, n) for r in rate_range]
    ax2.plot(rate_range * 100, pv_values, linewidth=2.5,
            label=f'n = {n} periods', color=colors[i % len(colors)], alpha=0.8)

ax2.set_xlabel('Interest Rate (%)', fontsize=12, fontweight='bold')
ax2.set_ylabel('Present Value ($)', fontsize=12, fontweight='bold')
ax2.set_title('PV of Annuity vs. Interest Rate\n(PMT = $1,000 per period)', 
              fontsize=13, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--')
ax2.legend(loc='best', fontsize=9)

# Plot 3: Annuity Factor (PV of $1 per period)
ax3 = axes[1, 0]
annuity_factors = np.zeros((len(interest_rates), len(periods_range)))
for i, rate in enumerate(interest_rates):
    for j, n in enumerate(periods_range):
        annuity_factors[i, j] = pv_annuity(1, rate, n)

im = ax3.imshow(annuity_factors, cmap='viridis', aspect='auto', interpolation='nearest')
ax3.set_xlabel('Number of Periods', fontsize=12, fontweight='bold')
ax3.set_ylabel('Interest Rate', fontsize=12, fontweight='bold')
ax3.set_title('Annuity Factor: PV of $1 per Period', fontsize=13, fontweight='bold')
ax3.set_xticks(range(0, len(periods_range), 5))
ax3.set_xticklabels(periods_range[::5])
ax3.set_yticks(range(len(interest_rates)))
ax3.set_yticklabels([f'{r*100:.0f}%' for r in interest_rates])
cbar = plt.colorbar(im, ax=ax3)
cbar.set_label('Annuity Factor', fontsize=11, fontweight='bold')

# Plot 4: Comparison - Ordinary Annuity vs Annuity Due
ax4 = axes[1, 1]
n_periods = 20
rate = 0.06
pv_ordinary = [pv_annuity(payment, rate, n) for n in periods_range]
pv_due = [pv_annuity(payment, rate, n) * (1 + rate) for n in periods_range]  # PV_due = PV_ordinary * (1+r)

ax4.plot(periods_range, pv_ordinary, 'b-', linewidth=2.5, marker='o', markersize=4,
        label='Ordinary Annuity', alpha=0.8)
ax4.plot(periods_range, pv_due, 'r--', linewidth=2.5, marker='s', markersize=4,
        label='Annuity Due', alpha=0.8)
ax4.fill_between(periods_range, pv_ordinary, pv_due, alpha=0.2, color='green',
                label='Difference (1+r factor)')
ax4.set_xlabel('Number of Periods (n)', fontsize=12, fontweight='bold')
ax4.set_ylabel('Present Value ($)', fontsize=12, fontweight='bold')
ax4.set_title(f'Ordinary Annuity vs. Annuity Due\n(r = {rate*100:.0f}%, PMT = $1,000)', 
              fontsize=13, fontweight='bold')
ax4.grid(True, alpha=0.3, linestyle='--')
ax4.legend(loc='best', fontsize=9)

# Add annotation
ax4.text(0.02, 0.98, f'PV_due = PV_ordinary × (1+r)\nAt n={n_periods}: ${pv_ordinary[n_periods-1]:,.0f} vs ${pv_due[n_periods-1]:,.0f}',
       transform=ax4.transAxes, fontsize=10, fontweight='bold',
       bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8),
       verticalalignment='top')

try:
    plt.tight_layout()
except:
    pass  # Ignore tight_layout errors in Pyodide
display(fig)
plt.close(fig)

print(f"\n📊 **Present Value of Annuities Analysis**")
print(f"{'='*70}")
print(f"Formula: PV = PMT × [(1 - (1+r)^(-n)) / r]")
print(f"  where PMT = Payment per period")
print(f"        r = Interest rate per period")
print(f"        n = Number of periods")
print(f"{'='*70}")
print(f"Key Insights:")
print(f"  • PV decreases as interest rate increases (higher discounting)")
print(f"  • PV increases as number of periods increases (more payments)")
print(f"  • Annuity Due has higher PV than Ordinary Annuity (payments received earlier)")
print(f"  • Relationship: PV_due = PV_ordinary × (1+r)")
print(f"{'='*70}")
print(f"Example: $1,000 per period, 20 periods, 6% rate:")
print(f"  PV (Ordinary): ${pv_annuity(1000, 0.06, 20):,.2f}")
print(f"  PV (Due):      ${pv_annuity(1000, 0.06, 20) * 1.06:,.2f}")

Annuity Due PV Formula

The present value of an annuity due can be calculated as:

0.0000(saved0.0000 (saved

This equation states that the present value of an annuity due (PVduePV_{due}) equals the present value of an ordinary annuity multiplied by (1 + r). This reflects the fact that each payment is received one period earlier, increasing its present value.

The relationship between ordinary annuities and annuities due is important because many financial instruments can be analyzed using either framework, depending on the timing convention used. Understanding both helps analyze different instruments correctly.

Deferred Annuities

Deferred annuities begin payments after a deferral period. For example, a retirement annuity might begin payments 20 years in the future. Valuing deferred annuities requires two steps: first, value the annuity as if it begins immediately, then discount that value back to the present by the deferral period.

The present value of a deferred annuity can be expressed as:

PVdeferred=PVannuity×(1+r)−dPV_{deferred} = PV_{annuity} \times (1+r)^{-d}

This equation states that the present value of a deferred annuity equals the present value of an immediate annuity (starting in period d+1d+1) discounted back dd periods. This captures both the annuity valuation and the deferral discounting.

Applications to Loan Amortization

Loan amortization is one of the most important applications of annuity valuation. When you take out a loan, you typically make equal monthly payments that include both principal and interest. The loan amount equals the present value of these payments, using the loan's interest rate.

Understanding annuity valuation helps explain how loan payments are calculated and how loans are structured. It also helps analyze loan refinancing decisions, where you compare the present value of remaining payments under different interest rates.

Let's visualize loan amortization schedules:

Python exercise

#| label: annuity-1
#| fig-cap: "Loan Amortization: Payment Breakdown and Balance Over Time"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false

# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib

import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display

# Set style
plt.style.use('default')
plt.rcParams['figure.facecolor'] = 'white'
plt.rcParams['axes.grid'] = True
plt.rcParams['grid.alpha'] = 0.3

# Loan parameters
loan_amount = 200000  # $200,000 loan
annual_rate = 0.05  # 5% annual interest
years = 30  # 30-year mortgage
monthly_rate = annual_rate / 12
num_payments = years * 12

# Calculate monthly payment using annuity formula
# PV = PMT * [(1 - (1+r)^(-n)) / r]
# PMT = PV * [r / (1 - (1+r)^(-n))]
monthly_payment = loan_amount * (monthly_rate / (1 - (1 + monthly_rate) ** (-num_payments)))

# Calculate amortization schedule
periods = np.arange(1, num_payments + 1)
remaining_balance = np.zeros(num_payments)
interest_paid = np.zeros(num_payments)
principal_paid = np.zeros(num_payments)
cumulative_interest = np.zeros(num_payments)
cumulative_principal = np.zeros(num_payments)

balance = loan_amount
for i in range(num_payments):
    interest = balance * monthly_rate
    principal = monthly_payment - interest
    balance -= principal
    
    interest_paid[i] = interest
    principal_paid[i] = principal
    remaining_balance[i] = balance
    cumulative_interest[i] = np.sum(interest_paid[:i+1])
    cumulative_principal[i] = np.sum(principal_paid[:i+1])

fig, axes = plt.subplots(2, 2, figsize=(16, 10))
fig.suptitle('Loan Amortization Schedule: Payment Breakdown and Balance Over Time', 
             fontsize=16, fontweight='bold', y=0.995)

# Plot 1: Remaining Balance Over Time
ax1 = axes[0, 0]
ax1.plot(periods / 12, remaining_balance / 1000, 'b-', linewidth=2.5, alpha=0.8)
ax1.fill_between(periods / 12, 0, remaining_balance / 1000, alpha=0.3, color='blue')
ax1.set_xlabel('Years', fontsize=12, fontweight='bold')
ax1.set_ylabel('Remaining Balance ($ thousands)', fontsize=12, fontweight='bold')
ax1.set_title(f'Loan Balance Over Time\n(${loan_amount:,.0f} loan, {annual_rate*100:.1f}% APR, {years} years)', 
              fontsize=13, fontweight='bold')
ax1.grid(True, alpha=0.3, linestyle='--')
ax1.axhline(y=0, color='red', linestyle='--', linewidth=2, alpha=0.7, label='Paid Off')
ax1.legend(loc='best', fontsize=9)

# Plot 2: Payment Breakdown (Interest vs Principal)
ax2 = axes[0, 1]
# Show first 5 years in detail
years_to_show = 5
months_to_show = years_to_show * 12
ax2.bar(periods[:months_to_show] / 12, interest_paid[:months_to_show], 
       width=1/12, label='Interest', color='red', alpha=0.7, edgecolor='black', linewidth=0.5)
ax2.bar(periods[:months_to_show] / 12, principal_paid[:months_to_show], 
       width=1/12, bottom=interest_paid[:months_to_show], label='Principal', 
       color='green', alpha=0.7, edgecolor='black', linewidth=0.5)
ax2.axhline(y=monthly_payment, color='blue', linestyle='--', linewidth=2, 
           label=f'Total Payment: ${monthly_payment:,.2f}', alpha=0.7)
ax2.set_xlabel('Years', fontsize=12, fontweight='bold')
ax2.set_ylabel('Payment Amount ($)', fontsize=12, fontweight='bold')
ax2.set_title('Monthly Payment Breakdown (First 5 Years)', fontsize=13, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--', axis='y')
ax2.legend(loc='best', fontsize=9)

# Plot 3: Cumulative Interest and Principal
ax3 = axes[1, 0]
ax3.plot(periods / 12, cumulative_interest / 1000, 'r-', linewidth=2.5, 
        label='Cumulative Interest', alpha=0.8)
ax3.plot(periods / 12, cumulative_principal / 1000, 'g-', linewidth=2.5, 
        label='Cumulative Principal', alpha=0.8)
ax3.plot(periods / 12, (cumulative_interest + cumulative_principal) / 1000, 
        'b--', linewidth=2, label='Total Paid', alpha=0.7)
ax3.axhline(y=loan_amount / 1000, color='orange', linestyle=':', linewidth=2, 
           label=f'Original Loan: ${loan_amount/1000:.0f}K', alpha=0.7)
ax3.set_xlabel('Years', fontsize=12, fontweight='bold')
ax3.set_ylabel('Cumulative Amount ($ thousands)', fontsize=12, fontweight='bold')
ax3.set_title('Cumulative Interest and Principal Payments', fontsize=13, fontweight='bold')
ax3.grid(True, alpha=0.3, linestyle='--')
ax3.legend(loc='best', fontsize=9)

# Plot 4: Interest/Principal Ratio Over Time
ax4 = axes[1, 1]
interest_principal_ratio = interest_paid / principal_paid
# Show first 10 years
years_to_show2 = 10
months_to_show2 = years_to_show2 * 12
ax4.plot(periods[:months_to_show2] / 12, interest_principal_ratio[:months_to_show2], 
        'purple', linewidth=2.5, marker='o', markersize=3, alpha=0.8)
ax4.axhline(y=1, color='gray', linestyle='--', linewidth=2, 
           label='Equal Interest/Principal', alpha=0.7)
ax4.set_xlabel('Years', fontsize=12, fontweight='bold')
ax4.set_ylabel('Interest / Principal Ratio', fontsize=12, fontweight='bold')
ax4.set_title('Interest-to-Principal Ratio Over Time', fontsize=13, fontweight='bold')
ax4.grid(True, alpha=0.3, linestyle='--')
ax4.legend(loc='best', fontsize=9)
ax4.set_ylim(0, max(interest_principal_ratio[:months_to_show2]) * 1.1)

try:
    plt.tight_layout()
except:
    pass  # Ignore tight_layout errors in Pyodide
display(fig)
plt.close(fig)

print(f"\n📊 **Loan Amortization Analysis**")
print(f"{'='*70}")
print(f"Loan Details:")
print(f"  Principal:              ${loan_amount:,.2f}")
print(f"  Annual Interest Rate:   {annual_rate*100:.2f}%")
print(f"  Term:                   {years} years ({num_payments} months)")
print(f"  Monthly Payment:        ${monthly_payment:,.2f}")
print(f"{'='*70}")
print(f"Total Payments Over Life of Loan:")
print(f"  Total Amount Paid:      ${monthly_payment * num_payments:,.2f}")
print(f"  Total Interest Paid:    ${cumulative_interest[-1]:,.2f}")
print(f"  Total Principal Paid:   ${cumulative_principal[-1]:,.2f}")
print(f"  Interest as % of Total: {(cumulative_interest[-1] / (monthly_payment * num_payments) * 100):.1f}%")
print(f"{'='*70}")
print(f"Key Insights:")
print(f"  • Early payments are mostly interest, later payments mostly principal")
print(f"  • Interest/Principal ratio decreases over time")
print(f"  • Total interest can exceed original loan amount for long-term loans")
print(f"  • Loan balance decreases slowly at first, faster later")

Future Value of Annuities

The future value of an annuity is the sum of the future values of all individual payments, evaluated at the end of the annuity period. Future value calculations are important for savings and investment planning, where you want to know how much a series of deposits will be worth in the future.

Ordinary Annuity FV Formula

The future value of an ordinary annuity can be calculated using the formula:

FV=PMT×(1+r)n−1rFV = PMT \times \frac{(1+r)^n - 1}{r}

This equation states that the future value (FVFV) equals the payment amount (PMTPMT) times a future value annuity factor. The future value annuity factor, (1+r)n−1r\frac{(1+r)^n - 1}{r}, represents the future value of $1 per period for nn periods at interest rate rr.

The future value annuity factor increases with both the interest rate and the number of periods. Higher interest rates mean that each payment earns more interest over time. More periods mean more payments and more time for each payment to earn interest.

Annuity Due FV Formula

The future value of an annuity due can be calculated as:

FVdue=PMT×(1+r)n−1r×(1+r)FV_{due} = PMT \times \frac{(1+r)^n - 1}{r} \times (1+r)

This equation states that the future value of an annuity due equals the future value of an ordinary annuity multiplied by (1 + r). This reflects the fact that each payment earns interest for one additional period because payments are made at the beginning of each period.

Sinking Funds

Sinking funds are applications of future value annuities. A sinking fund is a fund established to accumulate money to pay off a future obligation, such as a bond's principal repayment. Regular deposits are made to the fund, and the fund earns interest, accumulating to the required amount by the obligation date.

Understanding future value annuities helps design sinking funds - determining how much must be deposited periodically to accumulate a target amount. This is important for corporate finance, where companies establish sinking funds for bond repayments or other obligations.

Retirement Planning Applications

Future value annuities are central to retirement planning. When you save for retirement, you make regular contributions to retirement accounts, and these contributions earn returns over time. The future value of these contributions determines how much you will have available for retirement.

Retirement planning requires understanding how contribution amounts, contribution frequency, investment returns, and time horizons interact to determine retirement wealth. Future value annuity formulas provide the mathematical foundation for these calculations, though real-world retirement planning also requires considering taxes, inflation, and other factors.

Let's visualize retirement planning scenarios:

Python exercise

#| label: annuity-2
#| fig-cap: "Retirement Planning: Future Value of Annuity Contributions Over Time"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false

# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib

import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display

# Set style
plt.style.use('default')
plt.rcParams['figure.facecolor'] = 'white'
plt.rcParams['axes.grid'] = True
plt.rcParams['grid.alpha'] = 0.3

# Retirement planning parameters
annual_contribution = 6000  # $6,000 per year (IRA limit example)
annual_return = 0.07  # 7% annual return
years = np.arange(0, 41)  # 0 to 40 years

# Calculate FV of ordinary annuity: FV = PMT * [((1+r)^n - 1) / r]
def fv_annuity(pmt, r, n):
    if r == 0:
        return pmt * n
    return pmt * (((1 + r) ** n - 1) / r)

# Different contribution scenarios
scenarios = {
    'Conservative ($3K/year)': {'contribution': 3000, 'return': 0.05, 'color': 'blue'},
    'Moderate ($6K/year)': {'contribution': 6000, 'return': 0.07, 'color': 'green'},
    'Aggressive ($10K/year)': {'contribution': 10000, 'return': 0.09, 'color': 'orange'},
    'Early Starter ($4K/year, 40 years)': {'contribution': 4000, 'return': 0.07, 'color': 'purple'},
}

fig, axes = plt.subplots(2, 2, figsize=(16, 10))
fig.suptitle('Retirement Planning: Future Value of Annuity Contributions', 
             fontsize=16, fontweight='bold', y=0.995)

# Plot 1: FV Growth Over Time (Different Scenarios)
ax1 = axes[0, 0]
for label, scenario in scenarios.items():
    fv_values = np.array([fv_annuity(scenario['contribution'], scenario['return'], n) for n in years])
    ax1.plot(years, fv_values / 1000, linewidth=2.5, marker='o', markersize=3,
            label=label, color=scenario['color'], alpha=0.8)

ax1.set_xlabel('Years', fontsize=12, fontweight='bold')
ax1.set_ylabel('Future Value ($ thousands)', fontsize=12, fontweight='bold')
ax1.set_title('Retirement Savings Growth Over Time', fontsize=13, fontweight='bold')
ax1.grid(True, alpha=0.3, linestyle='--')
ax1.legend(loc='best', fontsize=9)

# Plot 2: Impact of Starting Age
ax2 = axes[0, 1]
starting_ages = [25, 30, 35, 40, 45]
retirement_age = 65
colors_age = ['green', 'blue', 'orange', 'red', 'purple']

for i, start_age in enumerate(starting_ages):
    years_to_retire = retirement_age - start_age
    years_range = np.arange(0, years_to_retire + 1)
    fv_values = np.array([fv_annuity(annual_contribution, annual_return, n) for n in years_range])
    ax2.plot(years_range + start_age, fv_values / 1000, linewidth=2.5, marker='o', markersize=4,
            label=f'Start at {start_age}', color=colors_age[i], alpha=0.8)
    # Mark final value
    ax2.plot(retirement_age, fv_values[-1] / 1000, 'o', markersize=10, 
            color=colors_age[i], markeredgecolor='black', markeredgewidth=2, zorder=5)

ax2.set_xlabel('Age', fontsize=12, fontweight='bold')
ax2.set_ylabel('Future Value ($ thousands)', fontsize=12, fontweight='bold')
ax2.set_title(f'Impact of Starting Age\n(${annual_contribution:,}/year, {annual_return*100:.0f}% return, retire at 65)', 
              fontsize=13, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--')
ax2.legend(loc='best', fontsize=9)
ax2.axvline(x=65, color='gray', linestyle='--', linewidth=1.5, alpha=0.5, label='Retirement Age')

# Plot 3: Contribution Amount vs Final Value
ax3 = axes[1, 0]
contribution_amounts = np.arange(1000, 15001, 500)
final_values = np.array([fv_annuity(amt, annual_return, 40) for amt in contribution_amounts])
ax3.plot(contribution_amounts, final_values / 1000, 'b-', linewidth=2.5, marker='o', markersize=4, alpha=0.8)
ax3.fill_between(contribution_amounts, 0, final_values / 1000, alpha=0.3, color='blue')
ax3.set_xlabel('Annual Contribution ($)', fontsize=12, fontweight='bold')
ax3.set_ylabel('Final Value at 40 Years ($ thousands)', fontsize=12, fontweight='bold')
ax3.set_title(f'Final Value vs. Contribution Amount\n({annual_return*100:.0f}% return, 40 years)', 
              fontsize=13, fontweight='bold')
ax3.grid(True, alpha=0.3, linestyle='--')

# Add annotation for key points
key_contributions = [3000, 6000, 10000]
for contrib in key_contributions:
    idx = np.where(contribution_amounts == contrib)[0]
    if len(idx) > 0:
        fv = final_values[idx[0]]
        ax3.plot(contrib, fv / 1000, 'ro', markersize=10, zorder=5)
        ax3.annotate(f'${contrib:,}/yr\n→ ${fv/1000:.0f}K', 
                    xy=(contrib, fv / 1000), xytext=(contrib + 1000, fv / 1000 + 50),
                    fontsize=9, fontweight='bold',
                    bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8),
                    arrowprops=dict(arrowstyle='->', color='red', lw=1.5))

# Plot 4: Return Rate Sensitivity
ax4 = axes[1, 1]
return_rates = np.linspace(0.03, 0.12, 20)
final_values_rates = np.array([fv_annuity(annual_contribution, r, 40) for r in return_rates])
ax4.plot(return_rates * 100, final_values_rates / 1000, 'g-', linewidth=2.5, marker='o', markersize=4, alpha=0.8)
ax4.fill_between(return_rates * 100, 0, final_values_rates / 1000, alpha=0.3, color='green')
ax4.set_xlabel('Annual Return Rate (%)', fontsize=12, fontweight='bold')
ax4.set_ylabel('Final Value at 40 Years ($ thousands)', fontsize=12, fontweight='bold')
ax4.set_title(f'Final Value vs. Return Rate\n(${annual_contribution:,}/year, 40 years)', 
              fontsize=13, fontweight='bold')
ax4.grid(True, alpha=0.3, linestyle='--')

# Add annotation
ax4.axvline(x=annual_return * 100, color='red', linestyle='--', linewidth=2, 
           label=f'Base Case: {annual_return*100:.0f}%', alpha=0.7)
ax4.legend(loc='best', fontsize=9)

try:
    plt.tight_layout()
except:
    pass  # Ignore tight_layout errors in Pyodide
display(fig)
plt.close(fig)

print(f"\n📊 **Retirement Planning Analysis**")
print(f"{'='*70}")
print(f"Formula: FV = PMT × [((1+r)^n - 1) / r]")
print(f"  where PMT = Annual contribution")
print(f"        r = Annual return rate")
print(f"        n = Number of years")
print(f"{'='*70}")
print(f"Example: ${annual_contribution:,}/year, {annual_return*100:.0f}% return, 40 years:")
print(f"  Final Value: ${fv_annuity(annual_contribution, annual_return, 40):,.2f}")
print(f"  Total Contributions: ${annual_contribution * 40:,.2f}")
print(f"  Investment Earnings: ${fv_annuity(annual_contribution, annual_return, 40) - annual_contribution * 40:,.2f}")
print(f"{'='*70}")
print(f"Impact of Starting Age (${annual_contribution:,}/year, {annual_return*100:.0f}% return):")
for start_age in starting_ages:
    years_to_retire = retirement_age - start_age
    fv = fv_annuity(annual_contribution, annual_return, years_to_retire)
    print(f"  Start at {start_age}: ${fv:,.0f} at age 65 ({years_to_retire} years)")
print(f"{'='*70}")
print(f"✅ Starting early has enormous impact due to compounding")
print(f"✅ Small increases in contribution or return rate create large differences")
print(f"✅ Time is the most powerful factor in retirement savings")

Perpetuities

A perpetuity is an annuity with an infinite number of payments. While infinite payment streams might seem theoretical, perpetuities have important practical applications, particularly in stock valuation and bond analysis. The perpetuity formula is simpler than the annuity formula because the infinite series converges to a finite value.

Perpetuity Valuation Formula

The present value of a perpetuity can be calculated using the formula:

PV=PMTrPV = \frac{PMT}{r}

This equation states that the present value (PVPV) equals the payment amount (PMTPMT) divided by the interest rate (rr). This simple formula reflects the fact that an infinite stream of payments has a finite present value when discounted at a positive interest rate.

The perpetuity formula is derived from the annuity formula by taking the limit as the number of periods approaches infinity. As the number of periods increases, the annuity factor approaches 1/r, which is the perpetuity factor. This convergence occurs because payments become so distant that their present values become negligible.

Perpetuity: An annuity with an infinite number of payments. The present value of a perpetuity equals the payment divided by the interest rate: PV = PMT / r.

Growing Perpetuities

A growing perpetuity makes payments that grow at a constant rate over time. Growing perpetuities are particularly important in stock valuation, where dividends are often assumed to grow at a constant rate. The present value of a growing perpetuity can be calculated as:

PV=PMT1r−gPV = \frac{PMT_1}{r-g}

This equation states that the present value equals the first payment (PMT1PMT_1) divided by the difference between the interest rate (rr) and the growth rate (gg). This formula requires that the growth rate be less than the interest rate; otherwise, the present value would be infinite.

The growing perpetuity formula is fundamental to the dividend discount model for stock valuation, where a stock's value equals the present value of its expected future dividends, often assumed to grow at a constant rate. This application makes growing perpetuities one of the most important concepts in equity valuation.

Let's visualize perpetuity and growing perpetuity valuation:

Python exercise

#| label: annuity-3
#| fig-cap: "Perpetuity and Growing Perpetuity Valuation: Present Value Calculations"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false

# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib

import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display

# Set style
plt.style.use('default')
plt.rcParams['figure.facecolor'] = 'white'
plt.rcParams['axes.grid'] = True
plt.rcParams['grid.alpha'] = 0.3

# Perpetuity parameters
payment = 100  # $100 per period
interest_rates = np.linspace(0.02, 0.15, 50)  # 2% to 15%
growth_rates = np.array([0.0, 0.02, 0.03, 0.04, 0.05])  # 0% to 5% growth

# Perpetuity PV: PV = PMT / r
def pv_perpetuity(pmt, r):
    return pmt / r

# Growing perpetuity PV: PV = PMT / (r - g), where g < r
def pv_growing_perpetuity(pmt, r, g):
    if g >= r:
        return np.inf  # Infinite value if growth >= discount rate
    return pmt / (r - g)

fig, axes = plt.subplots(2, 2, figsize=(16, 10))
fig.suptitle('Perpetuity and Growing Perpetuity Valuation', 
             fontsize=16, fontweight='bold', y=0.995)

# Plot 1: Perpetuity PV vs Interest Rate
ax1 = axes[0, 0]
pv_perpetuity_values = [pv_perpetuity(payment, r) for r in interest_rates]
ax1.plot(interest_rates * 100, pv_perpetuity_values, 'b-', linewidth=3, alpha=0.8)
ax1.fill_between(interest_rates * 100, 0, pv_perpetuity_values, alpha=0.3, color='blue')
ax1.set_xlabel('Interest Rate (%)', fontsize=12, fontweight='bold')
ax1.set_ylabel('Present Value ($)', fontsize=12, fontweight='bold')
ax1.set_title(f'Perpetuity PV vs. Interest Rate\n(PV = PMT / r, PMT = ${payment})', 
              fontsize=13, fontweight='bold')
ax1.grid(True, alpha=0.3, linestyle='--')

# Add annotation
ax1.axvline(x=5, color='red', linestyle='--', linewidth=2, alpha=0.7, label='r = 5%')
pv_at_5 = pv_perpetuity(payment, 0.05)
ax1.plot(5, pv_at_5, 'ro', markersize=10, zorder=5)
ax1.annotate(f'PV = ${pv_at_5:,.0f}\nat r = 5%', 
            xy=(5, pv_at_5), xytext=(8, pv_at_5 + 500),
            fontsize=10, fontweight='bold',
            bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8),
            arrowprops=dict(arrowstyle='->', color='red', lw=2))
ax1.legend(loc='best', fontsize=9)

# Plot 2: Growing Perpetuity PV vs Interest Rate (Different Growth Rates)
ax2 = axes[0, 1]
colors_growth = ['blue', 'green', 'orange', 'red', 'purple']
for i, g in enumerate(growth_rates):
    # Only show valid range where r > g
    valid_rates = interest_rates[interest_rates > g]
    if len(valid_rates) > 0:
        pv_values = [pv_growing_perpetuity(payment, r, g) for r in valid_rates]
        label = f'g = {g*100:.0f}%' if g > 0 else 'g = 0% (Perpetuity)'
        ax2.plot(valid_rates * 100, pv_values, linewidth=2.5,
                label=label, color=colors_growth[i], alpha=0.8)

ax2.set_xlabel('Interest Rate (%)', fontsize=12, fontweight='bold')
ax2.set_ylabel('Present Value ($)', fontsize=12, fontweight='bold')
ax2.set_title(f'Growing Perpetuity PV vs. Interest Rate\n(PV = PMT / (r - g), PMT = ${payment})', 
              fontsize=13, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--')
ax2.legend(loc='best', fontsize=9)
ax2.set_ylim(0, 15000)

# Plot 3: PV Comparison - Perpetuity vs Long Annuity
ax3 = axes[1, 0]
# Compare perpetuity to annuities of different lengths
def pv_annuity(pmt, r, n):
    if r == 0:
        return pmt * n
    return pmt * (1 - (1 + r) ** (-n)) / r

annuity_lengths = np.arange(10, 101, 10)  # 10 to 100 periods
rate = 0.05
pv_perp = pv_perpetuity(payment, rate)
pv_annuities = [pv_annuity(payment, rate, n) for n in annuity_lengths]

ax3.plot(annuity_lengths, pv_annuities, 'b-o', linewidth=2.5, markersize=6,
        label=f'Annuity (r = {rate*100:.0f}%)', alpha=0.8)
ax3.axhline(y=pv_perp, color='r', linestyle='--', linewidth=2.5,
           label=f'Perpetuity (r = {rate*100:.0f}%)', alpha=0.8)
ax3.set_xlabel('Number of Periods (n)', fontsize=12, fontweight='bold')
ax3.set_ylabel('Present Value ($)', fontsize=12, fontweight='bold')
ax3.set_title('Annuity vs. Perpetuity: Convergence as n → ∞', 
              fontsize=13, fontweight='bold')
ax3.grid(True, alpha=0.3, linestyle='--')
ax3.legend(loc='best', fontsize=9)

# Add annotation showing convergence
ax3.annotate(f'As n → ∞, Annuity PV → Perpetuity PV\n(${pv_perp:,.0f})',
            xy=(100, pv_perp), xytext=(60, pv_perp + 500),
            fontsize=10, fontweight='bold',
            bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8),
            arrowprops=dict(arrowstyle='->', color='red', lw=2))

# Plot 4: Dividend Discount Model Application (Stock Valuation)
ax4 = axes[1, 1]
# Stock valuation using growing perpetuity
dividend = 2.00  # $2.00 annual dividend
required_return = np.linspace(0.06, 0.15, 50)  # 6% to 15% required return
growth_scenarios = [0.0, 0.02, 0.03, 0.04]  # 0% to 4% dividend growth

for i, g in enumerate(growth_scenarios):
    valid_returns = required_return[required_return > g]
    if len(valid_returns) > 0:
        stock_values = [pv_growing_perpetuity(dividend, r, g) for r in valid_returns]
        label = f'Dividend Growth = {g*100:.0f}%' if g > 0 else 'No Growth'
        ax4.plot(valid_returns * 100, stock_values, linewidth=2.5,
                label=label, color=colors_growth[i], alpha=0.8)

ax4.set_xlabel('Required Return (Discount Rate) (%)', fontsize=12, fontweight='bold')
ax4.set_ylabel('Stock Value ($)', fontsize=12, fontweight='bold')
ax4.set_title('Stock Valuation: Dividend Discount Model\n(PV = D₁ / (r - g), D₁ = $2.00)', 
              fontsize=13, fontweight='bold')
ax4.grid(True, alpha=0.3, linestyle='--')
ax4.legend(loc='best', fontsize=9)

try:
    plt.tight_layout()
except:
    pass  # Ignore tight_layout errors in Pyodide
display(fig)
plt.close(fig)

print(f"\n📊 **Perpetuity and Growing Perpetuity Analysis**")
print(f"{'='*70}")
print(f"Perpetuity Formula: PV = PMT / r")
print(f"  where PMT = Payment per period")
print(f"        r = Interest rate per period")
print(f"{'='*70}")
print(f"Growing Perpetuity Formula: PV = PMT / (r - g)")
print(f"  where PMT = First payment")
print(f"        r = Interest rate per period")
print(f"        g = Growth rate per period (must be < r)")
print(f"{'='*70}")
print(f"Example: $100 payment, 5% interest rate:")
print(f"  Perpetuity PV: ${pv_perpetuity(100, 0.05):,.2f}")
print(f"  Growing Perpetuity (3% growth): ${pv_growing_perpetuity(100, 0.05, 0.03):,.2f}")
print(f"{'='*70}")
print(f"Applications:")
print(f"  • Preferred Stock: Fixed dividend → Perpetuity")
print(f"  • Common Stock: Growing dividend → Growing Perpetuity")
print(f"  • Consol Bonds: Perpetual interest payments → Perpetuity")
print(f"{'='*70}")
print(f"✅ Perpetuity is the limit of annuity as n → ∞")
print(f"✅ Growing perpetuity requires g < r (otherwise infinite value)")
print(f"✅ Dividend Discount Model uses growing perpetuity for stock valuation")

Applications to Stock Valuation

The dividend discount model uses perpetuity concepts to value stocks. If a stock is expected to pay dividends that grow at a constant rate forever, the stock's value equals a growing perpetuity. This provides a theoretical foundation for stock valuation, though real-world stock valuation also requires considering other factors.

The perpetuity framework also helps value preferred stock, which typically pays fixed dividends. Preferred stock can be valued as a perpetuity if dividends are expected to continue indefinitely. This makes preferred stock valuation relatively straightforward compared to common stock valuation.

Consol Bonds

Consol bonds (or perpetual bonds) are bonds that pay interest forever without repaying principal. These bonds are valued as perpetuities, with the interest payment serving as the perpetuity payment. While consol bonds are rare in modern markets, they provide a clear example of perpetuity valuation and help illustrate the concept.

Advanced Annuity Topics

More complex annuity structures require extensions of the basic annuity formulas. Growing annuities, continuous annuities, and annuities with changing payments all build on the fundamental annuity concepts but require additional mathematical tools.

Growing Annuities

A growing annuity makes payments that increase at a constant rate over time. The present value of a growing annuity can be calculated as:

PV=PMT1×1−(1+g1+r)nr−gPV = PMT_1 \times \frac{1 - (\frac{1+g}{1+r})^n}{r-g}

This equation states that the present value equals the first payment (PMT1PMT_1) times a growing annuity factor. The growing annuity factor accounts for both the time value of money and the payment growth. This formula requires that the growth rate be less than the interest rate.

Growing annuities are useful for analyzing investments where cash flows are expected to grow, such as rental properties with increasing rents or businesses with growing revenues. They also provide a bridge between fixed annuities and growing perpetuities, as a growing perpetuity is the limit of a growing annuity as the number of periods approaches infinity.

Let's visualize growing annuities and compare them to fixed annuities:

Python exercise

#| label: annuity-4
#| fig-cap: "Growing Annuities: Comparison with Fixed Annuities and Impact of Growth Rate"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false

# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib

import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display

# Set style
plt.style.use('default')
plt.rcParams['figure.facecolor'] = 'white'
plt.rcParams['axes.grid'] = True
plt.rcParams['grid.alpha'] = 0.3

# Growing annuity parameters
first_payment = 1000  # $1,000 first payment
interest_rate = 0.06  # 6% interest rate
num_periods = 20
growth_rates = np.array([0.0, 0.02, 0.03, 0.04])  # 0% to 4% growth

# PV of growing annuity: PV = PMT₁ × [(1 - ((1+g)/(1+r))^n) / (r - g)]
def pv_growing_annuity(pmt1, r, g, n):
    if r == g:
        return pmt1 * n / (1 + r)  # Special case when r = g
    if r == 0:
        return pmt1 * n  # No discounting
    return pmt1 * (1 - ((1 + g) / (1 + r)) ** n) / (r - g)

# FV of growing annuity: FV = PMT₁ × [((1+r)^n - (1+g)^n) / (r - g)]
def fv_growing_annuity(pmt1, r, g, n):
    if r == g:
        return pmt1 * n * (1 + r) ** (n - 1)  # Special case
    if r == 0:
        return pmt1 * n  # No growth
    return pmt1 * (((1 + r) ** n - (1 + g) ** n) / (r - g))

fig, axes = plt.subplots(2, 2, figsize=(16, 10))
fig.suptitle('Growing Annuities: Comparison with Fixed Annuities', 
             fontsize=16, fontweight='bold', y=0.995)

# Plot 1: Payment Streams Over Time
ax1 = axes[0, 0]
periods = np.arange(1, num_periods + 1)
for i, g in enumerate(growth_rates):
    payments = [first_payment * ((1 + g) ** (p - 1)) for p in periods]
    label = f'Growth = {g*100:.0f}%' if g > 0 else 'Fixed (g = 0%)'
    ax1.plot(periods, payments, linewidth=2.5, marker='o', markersize=4,
            label=label, alpha=0.8)

ax1.set_xlabel('Period', fontsize=12, fontweight='bold')
ax1.set_ylabel('Payment Amount ($)', fontsize=12, fontweight='bold')
ax1.set_title('Payment Streams: Fixed vs. Growing Annuities', 
              fontsize=13, fontweight='bold')
ax1.grid(True, alpha=0.3, linestyle='--')
ax1.legend(loc='best', fontsize=9)

# Plot 2: Present Value Comparison
ax2 = axes[0, 1]
pv_values = []
for g in growth_rates:
    pv = pv_growing_annuity(first_payment, interest_rate, g, num_periods)
    pv_values.append(pv)

colors = ['blue', 'green', 'orange', 'red']
bars = ax2.bar(range(len(growth_rates)), pv_values, color=colors, alpha=0.7, 
               edgecolor='black', linewidth=2)
ax2.set_xlabel('Growth Rate', fontsize=12, fontweight='bold')
ax2.set_ylabel('Present Value ($)', fontsize=12, fontweight='bold')
ax2.set_title(f'PV Comparison: Fixed vs. Growing Annuities\n(r = {interest_rate*100:.0f}%, n = {num_periods} periods)', 
              fontsize=13, fontweight='bold')
ax2.set_xticks(range(len(growth_rates)))
ax2.set_xticklabels([f'{g*100:.0f}%' for g in growth_rates])
ax2.grid(True, alpha=0.3, linestyle='--', axis='y')

# Add value labels
for i, (bar, pv) in enumerate(zip(bars, pv_values)):
    height = bar.get_height()
    ax2.text(bar.get_x() + bar.get_width()/2., height + height*0.02,
            f'${pv:,.0f}', ha='center', va='bottom', fontsize=10, fontweight='bold')

# Plot 3: PV Sensitivity to Growth Rate
ax3 = axes[1, 0]
growth_range = np.linspace(0, 0.055, 100)  # 0% to 5.5% (just below r)
pv_sensitivity = [pv_growing_annuity(first_payment, interest_rate, g, num_periods) 
                 if g < interest_rate else np.nan for g in growth_range]
ax3.plot(growth_range * 100, pv_sensitivity, 'b-', linewidth=2.5, alpha=0.8)
ax3.fill_between(growth_range * 100, 0, pv_sensitivity, alpha=0.3, color='blue')
ax3.axvline(x=interest_rate * 100, color='red', linestyle='--', linewidth=2,
           label=f'Interest Rate = {interest_rate*100:.0f}%', alpha=0.7)
ax3.set_xlabel('Growth Rate (%)', fontsize=12, fontweight='bold')
ax3.set_ylabel('Present Value ($)', fontsize=12, fontweight='bold')
ax3.set_title(f'PV Sensitivity to Growth Rate\n(PMT₁ = ${first_payment}, r = {interest_rate*100:.0f}%, n = {num_periods})', 
              fontsize=13, fontweight='bold')
ax3.grid(True, alpha=0.3, linestyle='--')
ax3.legend(loc='best', fontsize=9)

# Add annotation
ax3.annotate('PV → ∞ as g → r\n(Requires g < r)',
            xy=(interest_rate * 100 - 0.5, max(pv_sensitivity) * 0.8),
            xytext=(interest_rate * 100 + 1, max(pv_sensitivity) * 0.6),
            fontsize=10, fontweight='bold',
            bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8),
            arrowprops=dict(arrowstyle='->', color='red', lw=2))

# Plot 4: Future Value Comparison
ax4 = axes[1, 1]
fv_values = []
for g in growth_rates:
    fv = fv_growing_annuity(first_payment, interest_rate, g, num_periods)
    fv_values.append(fv)

bars2 = ax4.bar(range(len(growth_rates)), fv_values, color=colors, alpha=0.7,
               edgecolor='black', linewidth=2)
ax4.set_xlabel('Growth Rate', fontsize=12, fontweight='bold')
ax4.set_ylabel('Future Value ($)', fontsize=12, fontweight='bold')
ax4.set_title(f'FV Comparison: Fixed vs. Growing Annuities\n(r = {interest_rate*100:.0f}%, n = {num_periods} periods)', 
              fontsize=13, fontweight='bold')
ax4.set_xticks(range(len(growth_rates)))
ax4.set_xticklabels([f'{g*100:.0f}%' for g in growth_rates])
ax4.grid(True, alpha=0.3, linestyle='--', axis='y')

# Add value labels
for i, (bar, fv) in enumerate(zip(bars2, fv_values)):
    height = bar.get_height()
    ax4.text(bar.get_x() + bar.get_width()/2., height + height*0.02,
            f'${fv:,.0f}', ha='center', va='bottom', fontsize=10, fontweight='bold')

try:
    plt.tight_layout()
except:
    pass  # Ignore tight_layout errors in Pyodide
display(fig)
plt.close(fig)

print(f"\n📊 **Growing Annuities Analysis**")
print(f"{'='*70}")
print(f"Growing Annuity PV Formula: PV = PMT₁ × [(1 - ((1+g)/(1+r))^n) / (r - g)]")
print(f"  where PMT₁ = First payment")
print(f"        r = Interest rate per period")
print(f"        g = Growth rate per period (must be < r)")
print(f"        n = Number of periods")
print(f"{'='*70}")
print(f"Growing Annuity FV Formula: FV = PMT₁ × [((1+r)^n - (1+g)^n) / (r - g)]")
print(f"{'='*70}")
print(f"Example: PMT₁ = ${first_payment}, r = {interest_rate*100:.0f}%, n = {num_periods} periods")
for g in growth_rates:
    pv = pv_growing_annuity(first_payment, interest_rate, g, num_periods)
    fv = fv_growing_annuity(first_payment, interest_rate, g, num_periods)
    label = f'Growth = {g*100:.0f}%' if g > 0 else 'Fixed (g = 0%)'
    print(f"  {label}:")
    print(f"    PV: ${pv:,.2f}")
    print(f"    FV: ${fv:,.2f}")
print(f"{'='*70}")
print(f"Applications:")
print(f"  • Rental properties with increasing rents")
print(f"  • Salary increases over time")
print(f"  • Dividend growth in stock valuation")
print(f"  • Inflation-adjusted cash flows")
print(f"{'='*70}")
print(f"✅ Growing annuities bridge fixed annuities and growing perpetuities")
print(f"✅ Growth rate must be less than interest rate (g < r)")
print(f"✅ Higher growth increases both PV and FV")

Continuous Annuities

Continuous annuities make payments continuously rather than at discrete intervals. While most real-world annuities make discrete payments, continuous annuities are useful theoretical constructs and can approximate discrete annuities with high payment frequencies.

The present value of a continuous annuity can be calculated using calculus, integrating the present value of continuous payments over time. Continuous annuities provide mathematical convenience in some applications and can be more accurate when payment frequencies are very high.

Annuity Optimization Problems

Annuity optimization problems involve finding optimal payment amounts, frequencies, or structures to achieve financial objectives. For example, you might want to minimize loan payments subject to constraints, or maximize retirement wealth subject to contribution limits.

These optimization problems require combining annuity formulas with optimization techniques. They illustrate how annuity concepts apply to real-world financial decision-making, where multiple objectives and constraints must be balanced.

Summary: Cash Flow Stream Valuation

Annuities and perpetuities provide frameworks for valuing streams of cash flows, which are fundamental to many financial applications. Understanding these concepts helps analyze loans, bonds, stocks, retirement plans, and many other financial instruments. The formulas for annuities and perpetuities build on time value of money principles and provide foundations for more advanced financial analysis.

The distinction between ordinary annuities and annuities due, between fixed and growing payments, and between finite and infinite streams, creates a rich set of tools for analyzing different financial instruments. Each variation has its applications, and understanding when to use which formula is as important as knowing the formulas themselves.

As financial instruments become more complex, annuity and perpetuity concepts remain relevant as building blocks. More complex instruments can often be analyzed as combinations of simpler annuities and perpetuities, making these fundamental concepts essential for advanced financial analysis.

In Module 4: Mathematics for Finance

  1. Introduction
  2. Time Value of Money: The Foundation of Finance
  3. Compound Interest: The Power of Exponential Growth
  4. Present Value and Future Value: Valuing Money Across Time
  5. Annuities and Perpetuities
  6. Basic Statistics and Probability: Understanding Uncertainty
  7. Financial Ratios and Percentages: Tools for Analysis
  8. Advanced Financial Mathematics
  9. Mathematical Modeling in Finance
  10. End-of-Module Assessment