Module 1 · Mathematical Language and Quantitative Reasoning Lesson 1 of 120

Variables, Constants, Expressions, and Equations

A wallet reconciliation that actually balances.

2:34 clip8:23–10:57 in the full courseWatch on YouTube

Transcript

26 sentences · select one to jump there

Check your understanding

What happens if outflows become 200?

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.

001-variables-constants-expressions-and-equations.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 001 of 120
 * Variables, Constants, Expressions, and Equations
 * Module 01: Mathematical Language and Quantitative Reasoning
 *
 * Scenario: A wallet reconciliation that actually balances
 * Rule:     ending = opening + inflows − outflows
 *
 * Try it:   What happens if outflows become 200?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/mathematical-language-and-quantitative-reasoning/variables-constants-expressions-and-equations/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson001() {
  const opening = 1000;
  const inflows = 250;
  const outflows = 120;
  const ending = opening + inflows - outflows;
  const result = ending;
  return result;
}

export const checkedResult = 1130;

// Run this file directly: npx tsx lessons/01-mathematical-language-and-quantitative-reasoning/001-variables-constants-expressions-and-equations.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson001(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

1130

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

Lesson notes

The rule

ending = opening + inflows − outflows