Module 8 · Sampling, Estimation, and Statistical Inference Lesson 78 of 120

Null and Alternative Hypotheses

Testing an explicit baseline rather than a vague improvement claim.

2:36 clip4:08:03–4:10:40 in the full courseWatch on YouTube

Transcript

20 sentences · select one to jump there

Check your understanding

Does not rejecting H₀ prove μ equals three?

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.

078-null-and-alternative-hypotheses.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 078 of 120
 * Null and Alternative Hypotheses
 * Module 08: Sampling, Estimation, and Statistical Inference
 *
 * Scenario: Testing an explicit baseline rather than a vague improvement claim
 * Rule:     H₀: μ=μ₀; statistic=(estimate−μ₀)/SE
 *
 * Try it:   Does not rejecting H₀ prove μ equals three?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/sampling-estimation-and-statistical-inference/null-and-alternative-hypotheses/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson078() {
  const estimate=3.2,nullMean=3,se=Math.sqrt(.7/5);
  const statistic=(estimate-nullMean)/se;
  const result={statistic,rejectTwoSidedNormal:Math.abs(statistic)>1.96};
  return result;
}

export const checkedResult = {"statistic":0.5345224838248492,"rejectTwoSidedNormal":false};

// Run this file directly: npx tsx lessons/08-sampling-estimation-and-statistical-inference/078-null-and-alternative-hypotheses.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson078(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "statistic": 0.5345224838248492,
  "rejectTwoSidedNormal": false
}

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

Lesson notes

The rule

H₀: μ=μ₀; statistic=(estimate−μ₀)/SE