Module 6 · Probability and Random Variables Lesson 54 of 120

Independence and Dependence

Checking whether two failure mechanisms share information.

2:38 clip2:52:20–2:54:58 in the full courseWatch on YouTube

Transcript

20 sentences · select one to jump there

Check your understanding

Can two mutually exclusive events with positive probabilities be independent?

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.

054-independence-and-dependence.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 054 of 120
 * Independence and Dependence
 * Module 06: Probability and Random Variables
 *
 * Scenario: Checking whether two failure mechanisms share information
 * Rule:     independence: P(A∩B)=P(A)P(B)
 *
 * Try it:   Can two mutually exclusive events with positive probabilities be independent?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/probability-and-random-variables/independence-and-dependence/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson054() {
  const a=.20, b=.30;
  const independentJoint=a*b;
  const measuredJoint=.12;
  const result = {independentJoint,
    jointGap:measuredJoint-independentJoint,
    bGivenA:measuredJoint/a};
  return result;
}

export const checkedResult = {"independentJoint":0.06,"jointGap":0.06,"bGivenA":0.6};

// Run this file directly: npx tsx lessons/06-probability-and-random-variables/054-independence-and-dependence.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson054(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "independentJoint": 0.06,
  "jointGap": 0.06,
  "bGivenA": 0.6
}

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

Lesson notes

The rule

independence: P(A∩B)=P(A)P(B)