Module 3 · Data, Variables, Samples, and Measurement Lesson 28 of 120

Measurement Error, Resolution, Accuracy, and Precision

A clock can be consistent and still wrong.

2:38 clip1:26:59–1:29:37 in the full courseWatch on YouTube

Transcript

23 sentences · select one to jump there

Check your understanding

Does a small spread prove accuracy?

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.

028-measurement-error-resolution-accuracy-and-precision.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 028 of 120
 * Measurement Error, Resolution, Accuracy, and Precision
 * Module 03: Data, Variables, Samples, and Measurement
 *
 * Scenario: A clock can be consistent and still wrong
 * Rule:     error = measured − reference
 *
 * Try it:   Does a small spread prove accuracy?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/data-variables-samples-and-measurement/measurement-error-resolution-accuracy-and-precision/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson028() {
  const reference = 100;
  const measured = [105, 105, 106, 104];
  const errors = measured.map(x => x - reference);
  const bias = errors.reduce((s,x) => s+x,0) / errors.length;
  const result = {errors, bias};
  return result;
}

export const checkedResult = {"errors":[5,5,6,4],"bias":5};

// Run this file directly: npx tsx lessons/03-data-variables-samples-and-measurement/028-measurement-error-resolution-accuracy-and-precision.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson028(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "errors": [
    5,
    5,
    6,
    4
  ],
  "bias": 5
}

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

Lesson notes

The rule

error = measured − reference