Module 2 · Financial Arithmetic, Time Value, and Returns Lesson 14 of 120

Discount Factors and Discount Rates

One price today for one unit paid later.

2:33 clip45:06–47:40 in the full courseWatch on YouTube

Transcript

20 sentences · select one to jump there

Check your understanding

What is the discount factor at time zero?

Choose one answer

Code lab

Run it yourself

The lesson source in 7 languages. Edit it, run TypeScript and Python right here, and compare with the expected output.

014-discount-factors-and-discount-rates.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 014 of 120
 * Discount Factors and Discount Rates
 * Module 02: Financial Arithmetic, Time Value, and Returns
 *
 * Scenario: One price today for one unit paid later
 * Rule:     DF(t) = (1+r)⁻ᵗ
 *
 * Try it:   What is the discount factor at time zero?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/financial-arithmetic-time-value-and-returns/discount-factors/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson014() {
  const rate = 0.10;
  const discountFactor = (t: number) => (1 + rate) ** -t;
  const factor = discountFactor(2);
  const result = {factor, present: 1210 * factor};
  return result;
}

export const checkedResult = {"factor":0.8264462809917354,"present":999.9999999999999};

// Run this file directly: npx tsx lessons/02-financial-arithmetic-time-value-and-returns/014-discount-factors-and-discount-rates.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson014(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "factor": 0.8264462809917354,
  "present": 999.9999999999999
}

Prefer your own machine? Every file is in the course repository · open it in Codespaces.

Lesson notes

The rule

DF(t) = (1+r)⁻ᵗ