Module 7 · Probability Distributions and Simulation Basics Lesson 65 of 120

Normal Distribution and Standard Normal

Standardizing a processing-time model and reading density correctly.

2:34 clip3:27:33–3:30:08 in the full courseWatch on YouTube

Transcript

19 sentences · select one to jump there

Check your understanding

Is the normal density at fourteen the probability of exactly fourteen?

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.

065-normal-distribution-and-standard-normal.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 065 of 120
 * Normal Distribution and Standard Normal
 * Module 07: Probability Distributions and Simulation Basics
 *
 * Scenario: Standardizing a processing-time model and reading density correctly
 * Rule:     z=(x−μ)/σ; φ(z)=exp(−z²/2)/√(2π)
 *
 * Try it:   Is the normal density at fourteen the probability of exactly fourteen?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/probability-distributions-and-simulation-basics/normal-distribution-and-standard-normal/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson065() {
  const mu=10,sigma=2,x=14;
  const z=(x-mu)/sigma;
  const standardDensity=Math.exp(-z*z/2)/Math.sqrt(2*Math.PI);
  const result={z,standardDensity,densityAtX:standardDensity/sigma};
  return result;
}

export const checkedResult = {"z":2,"standardDensity":0.05399096651318806,"densityAtX":0.02699548325659403};

// Run this file directly: npx tsx lessons/07-probability-distributions-and-simulation-basics/065-normal-distribution-and-standard-normal.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson065(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "z": 2,
  "standardDensity": 0.05399096651318806,
  "densityAtX": 0.02699548325659403
}

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

Lesson notes

The rule

z=(x−μ)/σ; φ(z)=exp(−z²/2)/√(2π)