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

Simple Return

A dividend can change the answer even when the price is known.

2:40 clip50:15–52:56 in the full courseWatch on YouTube

Transcript

20 sentences · select one to jump there

Check your understanding

Could adding cash to an already total-return-adjusted series double count?

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.

016-simple-return.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 016 of 120
 * Simple Return
 * Module 02: Financial Arithmetic, Time Value, and Returns
 *
 * Scenario: A dividend can change the answer even when the price is known
 * Rule:     R = (P₁ − P₀ + cash)/P₀
 *
 * Try it:   Could adding cash to an already total-return-adjusted series double count?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/financial-arithmetic-time-value-and-returns/simple-return/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson016() {
  const start = 100, end = 108, cash = 2;
  if (start <= 0) throw new Error("Positive base required");
  const priceReturn = (end - start) / start;
  const totalReturn = (end - start + cash) / start;
  const result = {priceReturn, totalReturn};
  return result;
}

export const checkedResult = {"priceReturn":0.08,"totalReturn":0.1};

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

Your output

Press Run to execute the code in your browser.

Expected output

{
  "priceReturn": 0.08,
  "totalReturn": 0.1
}

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

Lesson notes

The rule

R = (P₁ − P₀ + cash)/P₀