Statistics & AI Foundations · Beginner → Intermediate

Probability & Bayes Lab

Watch prior belief branch into competing likelihoods, keep only paths compatible with evidence, normalize them, and arrive at the posterior.

A deterministic probability-tree lab for conditional probability and Bayes' rule. A generic signal-detection example turns prior, sensitivity, false-positive rate, joint path probabilities, likelihood ratios, and posterior odds into one inspectable calculation.

Step by step

  1. Set the prior P(H), the probability of the hypothesis before observing the signal.
  2. Set P(+|H) and P(+|¬H) to describe how the same evidence can arise under two competing states.
  3. Observe either positive or negative evidence and keep only compatible tree branches.
  4. Multiply parent and branch probabilities to obtain joint path probabilities.
  5. Normalize those compatible paths to obtain P(H|evidence).
  6. Convert probabilities to odds and verify posterior odds = prior odds × likelihood ratio.

Core formulas

Bayes' theorem

P(H|E) = P(E|H)P(H) / P(E)

Reverse the conditioning by weighting the prior with the evidence likelihood and normalizing.

Total evidence

P(E)=P(E|H)P(H)+P(E|¬H)P(¬H)

The denominator counts every mutually exclusive way the observed evidence could occur.

Odds form

O(H|E)=O(H)·LR(E)

Evidence multiplies prior odds by its likelihood ratio.

When to use Probability & Bayes Lab

  • Learning conditional probability and the base-rate effect.
  • Understanding why sensitivity or accuracy alone does not determine a posterior probability.
  • Connecting probability trees, joint probabilities, normalization, odds, and likelihood ratios.

Primary references

Penn State STAT 414 — Bayes' Theorem

Stanford Encyclopedia of Philosophy — Bayes' Theorem