{ "version": "1", "metadata": { "marimo_version": "0.23.3", "script_metadata_hash": null }, "cells": [ { "id": "Hbol", "code_hash": "e238d786bb62a06c07450dfbac87a566", "outputs": [ { "type": "data", "data": { "text/plain": "" } } ], "console": [] }, { "id": "MJUe", "code_hash": "0fa01e2b9524c22d32e81c353f6d2c43", "outputs": [ { "type": "data", "data": { "text/markdown": "

Bayes' Theorem: Updating Beliefs with Evidence

\nBayes' Theorem is a fundamental concept in probability theory that helps us update our beliefs based on new evidence.\nThe formula is:\n$||(P(A|B) = \nrac{P(B|A)P(A)}{P(B)}||)$\nWhere:\n
" } } ], "console": [] }, { "id": "vblA", "code_hash": "c9e1e66d44b3c17a7882a8b80ef41e2e", "outputs": [ { "type": "data", "data": { "text/markdown": "

Medical Testing Example

\nLet's say we're testing for a rare disease:\n\nWhat's the probability that someone who tests positive actually has the disease?
" } } ], "console": [] }, { "id": "bkHC", "code_hash": "f43af12daae0fc2b4b02e4a47de73c57", "outputs": [ { "type": "data", "data": { "text/markdown": "Given:\n\nUsing Bayes' theorem:\nP(Disease|Test+) = [P(Test+|Disease) \u00d7 P(Disease)] / P(Test+)\nP(Test+) = P(Test+|Disease) \u00d7 P(Disease) + P(Test+|No Disease) \u00d7 P(No Disease)\nP(Test+) = 0.99 \u00d7 0.001 + 0.05 \u00d7 0.999\nP(Test+) = 0.0509\nP(Disease|Test+) = (0.99 \u00d7 0.001) / 0.0509 = 0.019\nOnly 1.9% of people who test positive actually have the disease!" } } ], "console": [] }, { "id": "lEQa", "code_hash": "0945116d7539b44c0a5f8141266727b2", "outputs": [ { "type": "data", "data": { "text/html": "" } } ], "console": [] }, { "id": "PKri", "code_hash": "a9f080ba5ad2d0c9d8a454b3258bfda1", "outputs": [ { "type": "data", "data": { "text/markdown": "

Why This Matters

\nThis example shows why Bayes' Theorem is important:\n
    \n
  1. High false positive rate combined with low prevalence leads to counterintuitive results
  2. \n
  3. 95% accurate tests can still give misleading results when the condition is rare
  4. \n
  5. Bayes' Theorem forces us to think about:
      \n
    • Our initial beliefs (prior probability)
    • \n
    • How likely we are to observe evidence given our beliefs
    • \n
    • How to update our beliefs in light of new evidence
    • \n
    \n
  6. \n
\nThis same logic applies to:\n
" } } ], "console": [] }, { "id": "WyvZ", "code_hash": null, "outputs": [ { "type": "data", "data": { "text/plain": "" } } ], "console": [] }, { "id": "IAFF", "code_hash": null, "outputs": [], "console": [] } ] }