25 / 90

Day 25: Probability Foundations: Events, Conditional Probability, and Bayes

Count outcomes in explicit sample spaces, condition by restricting them, invert with Bayes' rule, and separate empirical frequencies from guaranteed probabilities. Prediction, evidence, and recovery are recorded inside the 480-minute ledger.

Mathematics & Algorithmic Foundations 480 active minutes (8 hours focused study)
01 120 min

Sample spaces, events, and counting

Assistance allowed only after prediction and observed evidence are recorded.

Prerequisites

Complete Day 24 (linear algebra wrap-up); if blocked, review Day 21 before continuing.

Learning Objective

Define a sample space, enumerate equally likely outcomes, and compute event probabilities by counting under explicitly stated fairness and independence assumptions.

Instructions

Study source: within this activity's existing reading/practice time, use Stat 110: Strategic Practice and Homework Problems, Strategic Practice and Homework 1; linked problem and solution document, then explain one connection to the local task in your own words. Keep the local exercise and acceptance checks; use its original explanation if the external source is unavailable. A probability model assumes a sample space $\Omega$ of equally likely outcomes and assigns $P(A) = |A|/|\Omega|$ to an event $A$. For two fair and independent six-sided dice, the sample space is the 36 ordered pairs $(a,b)$, each with probability $1/36$; fair marginals alone are insufficient: if the dice always match, the sum-7 probability is 0 and the at-least-one-6 probability is $1/6$. Required work: predict the counts first, then enumerate the pairs whose sum is 7 and the pairs containing at least one 6 (use inclusion-exclusion so $(6,6)$ is not double-counted). Optional work: repeat the counting exercise with three coins only after the required evidence is complete.

Practice & Prediction Log

For two fair and independent six-sided dice (so each ordered pair has probability $1/36$), predict then compute: (a) $P(\text{sum}=7)$; (b) $P(\text{at least one die shows }6)$. Give each answer as a fraction of the 36 ordered pairs and as a decimal, and state the fairness and independence assumptions you relied on.

Independent Mastery Criterion

Your sample space is the 36 ordered pairs; both probabilities are derived by counting under the explicitly stated assumptions that each die is fair and the dice are independent (equivalently, each pair has probability 1/36), not recalled.

Authoritative Source Resources & Provenance

linking Harvard University copyright; no open reuse license verified linking only; no reproduction

Stat 110: Strategic Practice and Homework Problems

Author: Joe Blitzstein (Harvard University) | Original Source Link ↗

Relevant Section / Range: Strategic Practice and Homework 1; linked problem and solution document

Verified Version & Date: Public edition checked 2026-11-01; moving pages may change

Selection Rationale:

Concept-organized questions plus solutions supply probability teaching practice missing from reference notes. Use early sets, not an entire semester or an unverified free textbook.

Source Prerequisites:

Counting, fractions and the Day 25 probability definitions; use only the identified early problems.

Safe Fallback (Offline Resilience):

Use the original localized explanations, exercises and checks already present in this activity; no external account or purchase is required for that fallback.

Compared Candidate Sources & Selection Analysis (2)
OpenStax Introductory Statistics 2e ↗ compared_alternative [CC BY-NC-SA 4.0]

Retained for accessible definitions and a full statistics sequence; Stat 110 adds targeted probability practice.

OpenIntro Statistics ↗ compared_alternative [CC BY-SA 3.0]

Comparable introductory statistics text; remains a supplementary reference for estimation rather than replacing concept-targeted probability practice.

linking CC BY-NC-SA 4.0 noncommercial share-alike

Introductory Statistics 2e

Author: OpenStax, Rice University (Barbara Illowsky, Susan Dean) | Original Source Link ↗

Relevant Section / Range: Chapter 3: Probability Topics (sample spaces, events, equally likely outcomes)

Verified Version & Date: 2e web edition (Verified: 2026-10-30)

Selection Rationale:

Peer-reviewed open textbook with beginner-grade rigor for sample spaces and counting-based probability.

Source Prerequisites:

High-school algebra

Safe Fallback (Offline Resilience):

All required definitions, counts, and worked answers are reproduced locally in this lesson.

Compared Candidate Sources & Selection Analysis (3)
MIT OCW 6.041 Probabilistic Systems Analysis ↗ compared_deferred [CC BY-NC-SA 4.0]

Rigorous but paced for a full graduate semester; exceeds the depth needed for Days 25-27 training-objective foundations.

Khan Academy Statistics and Probability ↗ compared_alternative [CC BY-NC-SA 3.0]

Accessible video-first coverage; noncommercial/share-alike terms and video pacing make it a supplementary rather than primary link.

Harvard Stat 110 Introduction to Probability (Blitzstein & Hwang) ↗ compared_alternative [CRC Press copyright (book); free lecture videos]

Strong intuition-building course; the printed textbook is paywalled, so it complements rather than replaces the openly licensed OpenStax text.

linking Stanford copyright; public course notes No text extraction or redistribution permitted

CS229 Review of Probability Theory

Author: Stanford CS229 course staff (Arian Maleki, Tom Do) | Original Source Link ↗

Relevant Section / Range: Section 2: Probability spaces, events, and axioms

Verified Version & Date: 2020 public course notes (Verified: 2026-10-30)

Selection Rationale:

Compact machine-learning-oriented probability review connecting axioms to model assumptions.

Source Prerequisites:

Multivariate calculus notation exposure

Safe Fallback (Offline Resilience):

Self-contained definitions and derivations in activity instructions and offline guide.

Compared Candidate Sources & Selection Analysis (2)
OpenStax Introductory Statistics 2e ↗ compared_alternative [CC BY-NC-SA 4.0]

Co-selected: provides the gentler beginner narrative; CS229 provides the ML-oriented notation bridge.

MIT OCW 18.05 Introduction to Probability and Statistics ↗ compared_alternative [CC BY-NC-SA 4.0]

Strong full-course treatment with noncommercial/share-alike terms; heavier than the compact CS229 reference for this three-day block.

02 120 min

Conditional probability and independence

Independent Mastery Check (no AI assistance).

Prerequisites

Complete the previous activity; if blocked, follow Activity 01’s Day 21 review guidance before continuing.

Learning Objective

Compute $P(A\mid B)=P(A\cap B)/P(B)$ by restricting the sample space, and verify independence through the product identity $P(A\cap B)=P(A)P(B)$.

Instructions

Study source: within this activity's existing reading/practice time, use Stat 110: Strategic Practice and Homework Problems, Strategic Practice and Homework 2: Conditional Probability; problems and solutions, then explain one connection to the local task in your own words. Keep the local exercise and acceptance checks; use its original explanation if the external source is unavailable. Conditioning on $B$ shrinks the sample space to $B$ and renormalizes: work inside the reduced space rather than memorizing formulas. Required work: solve (a)-(c) below unaided, writing for each which restricted sample space you used. Independence is a numerical identity to verify, not an intuition to assert.

Practice & Prediction Log

Two fair and independent dice (so each ordered pair has probability 1/36). (a) Given the first die is even, find $P(\text{sum}=8)$. (b) Given the sum is 7, find $P(\text{first die}=4)$. (c) Are 'first die even' and 'sum=7' independent? Compare $P(\text{even})\cdot P(\text{sum}=7)$ with $P(\text{even}\cap\text{sum}=7)$.

Independent Mastery Criterion

All three results are derived unaided by restricted counting; independence is claimed only after the product check $1/12 = 3/36$, with the conditioning set named for each part.

Authoritative Source Resources & Provenance

linking Harvard University copyright; no open reuse license verified linking only; no reproduction

Stat 110: Strategic Practice and Homework Problems

Author: Joe Blitzstein (Harvard University) | Original Source Link ↗

Relevant Section / Range: Strategic Practice and Homework 2: Conditional Probability; problems and solutions

Verified Version & Date: Public edition checked 2026-11-01; moving pages may change

Selection Rationale:

Concept-organized questions plus solutions supply probability teaching practice missing from reference notes. Use early sets, not an entire semester or an unverified free textbook.

Source Prerequisites:

Counting, fractions and the Day 25 probability definitions; use only the identified early problems.

Safe Fallback (Offline Resilience):

Use the original localized explanations, exercises and checks already present in this activity; no external account or purchase is required for that fallback.

Compared Candidate Sources & Selection Analysis (2)
OpenStax Introductory Statistics 2e ↗ compared_alternative [CC BY-NC-SA 4.0]

Retained for accessible definitions and a full statistics sequence; Stat 110 adds targeted probability practice.

OpenIntro Statistics ↗ compared_alternative [CC BY-SA 3.0]

Comparable introductory statistics text; remains a supplementary reference for estimation rather than replacing concept-targeted probability practice.

linking CC BY-NC-SA 4.0 noncommercial share-alike

Introductory Statistics 2e

Author: OpenStax, Rice University (Barbara Illowsky, Susan Dean) | Original Source Link ↗

Relevant Section / Range: Chapter 3: Probability Topics (conditional probability, independence)

Verified Version & Date: 2e web edition (Verified: 2026-10-30)

Selection Rationale:

Clear treatment of conditional probability via restricted sample spaces matching this activity's method.

Source Prerequisites:

High-school algebra

Safe Fallback (Offline Resilience):

All required definitions, counts, and worked answers are reproduced locally in this lesson.

Compared Candidate Sources & Selection Analysis (3)
MIT OCW 6.041 Probabilistic Systems Analysis ↗ compared_deferred [CC BY-NC-SA 4.0]

Rigorous but paced for a full graduate semester; exceeds the depth needed for Days 25-27 training-objective foundations.

Khan Academy Statistics and Probability ↗ compared_alternative [CC BY-NC-SA 3.0]

Accessible video-first coverage; noncommercial/share-alike terms and video pacing make it a supplementary rather than primary link.

Harvard Stat 110 Introduction to Probability (Blitzstein & Hwang) ↗ compared_alternative [CRC Press copyright (book); free lecture videos]

Strong intuition-building course; the printed textbook is paywalled, so it complements rather than replaces the openly licensed OpenStax text.

linking Stanford copyright; public course notes No text extraction or redistribution permitted

CS229 Review of Probability Theory

Author: Stanford CS229 course staff (Arian Maleki, Tom Do) | Original Source Link ↗

Relevant Section / Range: Section 3: Conditional probability and independence

Verified Version & Date: 2020 public course notes (Verified: 2026-10-30)

Selection Rationale:

ML-oriented reference for the independence product rule used later in model assumptions.

Source Prerequisites:

Multivariate calculus notation exposure

Safe Fallback (Offline Resilience):

Self-contained definitions and derivations in activity instructions and offline guide.

Compared Candidate Sources & Selection Analysis (2)
OpenStax Introductory Statistics 2e ↗ compared_alternative [CC BY-NC-SA 4.0]

Co-selected: provides the gentler beginner narrative; CS229 provides the ML-oriented notation bridge.

MIT OCW 18.05 Introduction to Probability and Statistics ↗ compared_alternative [CC BY-NC-SA 4.0]

Strong full-course treatment with noncommercial/share-alike terms; heavier than the compact CS229 reference for this three-day block.

03 120 min

Bayes' rule and empirical frequency vs. probability

Assistance allowed only after prediction and observed evidence are recorded.

Prerequisites

Complete the previous activity; if blocked, follow Activity 01’s Day 21 review guidance before continuing.

Learning Objective

Apply Bayes' rule $P(D\mid +)=P(+\mid D)P(D)/P(+)$ with a total-probability denominator, then run a seeded simulation to separate empirical frequencies from guaranteed probabilities.

Instructions

Screening example: prevalence $P(D)=0.01$, sensitivity $P(+\mid D)=0.99$, false-positive rate $P(+\mid \bar D)=0.05$. Compute $P(+)$ by total probability, then $P(D\mid +)$. Then run: python3 -c "import random; random.seed(25); pairs=[(random.randint(1,6), random.randint(1,6)) for _ in range(36)]; print(sum(1 for a,b in pairs if a+b==7))" and compare the observed frequency of sum-7 with $1/6$.

Practice & Prediction Log

(a) Compute $P(D\mid +)$ for the screening scenario. (b) Report the seeded frequency of sum-7 in 36 simulated pairs and explain why it need not equal $1/6$. (c) If an event is never observed in $n$ trials, is its probability exactly zero?

Independent Mastery Criterion

Bayes arithmetic shows a total-probability denominator; the observed simulation frequency is reported honestly; the zero-count caveat and the frequency/probability distinction are stated in your own words.

Authoritative Source Resources & Provenance

linking CC BY-NC-SA 4.0 noncommercial share-alike

Introductory Statistics 2e

Author: OpenStax, Rice University (Barbara Illowsky, Susan Dean) | Original Source Link ↗

Relevant Section / Range: Chapter 3: Probability Topics (Bayes' rule, law of total probability); Chapter 1 (relative frequency)

Verified Version & Date: 2e web edition (Verified: 2026-10-30)

Selection Rationale:

Open treatment of Bayes' rule and the relative-frequency interpretation of probability.

Source Prerequisites:

High-school algebra

Safe Fallback (Offline Resilience):

All required definitions, counts, and worked answers are reproduced locally in this lesson.

Compared Candidate Sources & Selection Analysis (3)
MIT OCW 6.041 Probabilistic Systems Analysis ↗ compared_deferred [CC BY-NC-SA 4.0]

Rigorous but paced for a full graduate semester; exceeds the depth needed for Days 25-27 training-objective foundations.

Khan Academy Statistics and Probability ↗ compared_alternative [CC BY-NC-SA 3.0]

Accessible video-first coverage; noncommercial/share-alike terms and video pacing make it a supplementary rather than primary link.

Harvard Stat 110 Introduction to Probability (Blitzstein & Hwang) ↗ compared_alternative [CRC Press copyright (book); free lecture videos]

Strong intuition-building course; the printed textbook is paywalled, so it complements rather than replaces the openly licensed OpenStax text.

linking PSF License Version 2

Python 3 random: Generate pseudo-random numbers

Author: Python Software Foundation | Original Source Link ↗

Relevant Section / Range: random.seed, random.randint, random.choices (reproducible simulations)

Verified Version & Date: Python 3.12 documentation (Verified: 2026-10-30)

Selection Rationale:

Normative reference for seeded pseudo-random sampling used in the empirical-frequency experiment.

Source Prerequisites:

Basic Python syntax

Safe Fallback (Offline Resilience):

Use the installed interpreter's help(random) and the included deterministic commands.

Compared Candidate Sources & Selection Analysis (2)
NumPy random Generator documentation ↗ compared_deferred [BSD 3-Clause]

Faster vectorized sampling but adds a third-party dependency before the tensor track; deferred to the models-and-training days.

Python secrets module documentation ↗ compared_rejected_for_days_25_27 [PSF License Version 2]

Cryptographically secure randomness is unnecessary for reproducible statistical pedagogy and obscures the seed-based determinism the exercises require.

04 120 min

Independent mastery check: probability foundations

Independent Mastery Check (no AI assistance).

Prerequisites

Complete the previous activity; if blocked, follow Activity 01’s Day 21 review guidance before continuing.

Learning Objective

Solve unseen probability problems unaided, stating every assumption (priors, likelihoods, independence) used.

Instructions

No AI, references, or calculators beyond arithmetic during this check. Solve all three items, record predictions before verifying, then review errors and follow a recovery link for any missed idea. Preserve the first unaided attempt unchanged; afterwards, error review and any assisted recovery are a distinct phase, and a missed idea counts as remediated only after a fresh equivalent unaided check whose answer is not shown in advance. Second check (only after remediation; unaided, no hints): (a) $P(\text{spam})=0.3$, $P(w\mid\text{spam})=0.8$, $P(w\mid\text{ham})=0.2$: compute $P(\text{spam}\mid w)$. (b) Two cards drawn without replacement from a 52-card deck: compute $P(\text{both hearts})$. (c) For a naive Bayes score using two words $w_1,w_2$, write the factorisation it assumes and one reason it fails for real text. This card gives no answer for the second check: grade it by the same standard as the mastery criterion (exact values from the stated model, every assumption written), and verify only after finishing, by a second method (a 1000-message frequency table, or counting ordered pairs). Remediate a missed (a) with day-25-act-03 (Bayes' rule, total-probability denominator), (b) with day-25-act-02 (dependent events) and day-25-act-01 (counting), and (c) with day-25-act-02 (independence).

Practice & Prediction Log

(a) A spam filter: $P(\text{spam})=0.2$, $P(w\mid\text{spam})=0.9$ for a suspicious word $w$, $P(w\mid\text{ham})=0.1$. Compute $P(\text{spam}\mid w)$. (b) Two cards drawn without replacement from a 52-card deck: compute $P(\text{both aces})$. (c) For a multi-feature naive Bayes classifier scoring a message with several suspicious words, state the conditional-independence assumption it adds, and say whether it is realistic. ((a) used a single feature, so its posterior comes from Bayes' rule alone.)

Independent Mastery Criterion

Unaided answers match $9/13$ and $1/221$; the assumed model (prior, likelihoods, conditional independence, sampling without replacement) is stated explicitly; misses route to a recovery link, and each missed idea is remediated only by a fresh equivalent unaided check.

Authoritative Source Resources & Provenance

linking CC BY-NC-SA 4.0 noncommercial share-alike

Introductory Statistics 2e

Author: OpenStax, Rice University (Barbara Illowsky, Susan Dean) | Original Source Link ↗

Relevant Section / Range: Chapter 3: Probability Topics (review problems)

Verified Version & Date: 2e web edition (Verified: 2026-10-30)

Selection Rationale:

Open end-of-chapter review coverage aligned with this day's assessment scope.

Source Prerequisites:

High-school algebra

Safe Fallback (Offline Resilience):

The assessment is self-contained with original items and worked reference answers.

Compared Candidate Sources & Selection Analysis (3)
MIT OCW 6.041 Probabilistic Systems Analysis ↗ compared_deferred [CC BY-NC-SA 4.0]

Rigorous but paced for a full graduate semester; exceeds the depth needed for Days 25-27 training-objective foundations.

Khan Academy Statistics and Probability ↗ compared_alternative [CC BY-NC-SA 3.0]

Accessible video-first coverage; noncommercial/share-alike terms and video pacing make it a supplementary rather than primary link.

Harvard Stat 110 Introduction to Probability (Blitzstein & Hwang) ↗ compared_alternative [CRC Press copyright (book); free lecture videos]

Strong intuition-building course; the printed textbook is paywalled, so it complements rather than replaces the openly licensed OpenStax text.

linking Stanford copyright; public course notes No text extraction or redistribution permitted

CS229 Review of Probability Theory

Author: Stanford CS229 course staff (Arian Maleki, Tom Do) | Original Source Link ↗

Relevant Section / Range: Sections 2-3: axioms, conditional probability, Bayes' rule

Verified Version & Date: 2020 public course notes (Verified: 2026-10-30)

Selection Rationale:

Reference for the probability toolkit this assessment checks without assistance.

Source Prerequisites:

Multivariate calculus notation exposure

Safe Fallback (Offline Resilience):

The assessment is self-contained with original items and worked reference answers.

Compared Candidate Sources & Selection Analysis (2)
OpenStax Introductory Statistics 2e ↗ compared_alternative [CC BY-NC-SA 4.0]

Co-selected: provides the gentler beginner narrative; CS229 provides the ML-oriented notation bridge.

MIT OCW 18.05 Introduction to Probability and Statistics ↗ compared_alternative [CC BY-NC-SA 4.0]

Strong full-course treatment with noncommercial/share-alike terms; heavier than the compact CS229 reference for this three-day block.