Random variables and probability distributions
Assistance allowed only after prediction and observed evidence are recorded.
Prerequisites
Complete Day 25 (probability foundations); use the listed recovery link (Day 21) if blocked.
Learning Objective
Define a discrete random variable as a function from outcomes to numbers, validate a probability distribution table, and connect it to categorical distributions over tokens.
Instructions
A random variable $X$ maps each outcome of the sample space to a number; its distribution lists $P(X=x)$ with $\sum_x P(X=x)=1$. For a fair die, $X$ is uniform on $\{1,\dots,6\}$. Required work: compute $E[X]$ for the die, then validate the token-type distribution $p=[0.5,0.25,0.125,0.125]$ over values $\{0,1,2,3\}$.
Practice & Prediction Log
(a) Compute $E[X]$ for a fair die and explain why a non-integer expectation does not contradict the outcomes. (b) For $p=[0.5,0.25,0.125,0.125]$ over $\{0,1,2,3\}$, verify $\sum p = 1$ and compute $P(X\ge 2)$. (c) Interpret $p$ as a categorical distribution over four token types: which value is the most likely token?
$E[X] = (1+2+3+4+5+6)/6$. $P(X\ge 2) = P(X=2)+P(X=3)$. The expectation is a probability-weighted long-run average, not a required outcome.
(a) $E[X] = 21/6 = 3.5$: the expectation is a long-run average, not a die face. (b) $0.5+0.25+0.125+0.125=1$; $P(X\ge 2)=0.125+0.125=0.25$. (c) Token 0 is most likely at $p=0.5$ - a categorical distribution is exactly a probability table over discrete types, the shape language-model output layers produce.
You validate the normalization $\sum p = 1$, compute $P(X\ge2)=0.25$, and explain expectation as an average distinct from any single outcome.
Authoritative Source Resources & Provenance
Introductory Statistics 2e
Relevant Section / Range: Chapter 4: Discrete Random Variables (probability distribution functions)
Verified Version & Date: 2e web edition (Verified: 2026-10-30)
Open textbook treatment of discrete random variables and distribution tables.
High-school algebra; Day 25 probability foundations
All required definitions, tables, and worked answers are reproduced locally in this lesson.
Compared Candidate Sources & Selection Analysis (3)
Rigorous but paced for a full graduate semester; exceeds the depth needed for Days 25-27 training-objective foundations.
Accessible video-first coverage; noncommercial/share-alike terms and video pacing make it a supplementary rather than primary link.
Strong intuition-building course; the printed textbook is paywalled, so it complements rather than replaces the openly licensed OpenStax text.
CS229 Review of Probability Theory
Relevant Section / Range: Section 2.4-2.5: Random variables, distributions, expectation
Verified Version & Date: 2020 public course notes (Verified: 2026-10-30)
ML-oriented definition of random variables bridging to categorical token distributions.
Multivariate calculus notation exposure
Self-contained definitions and derivations in activity instructions and offline guide.
Compared Candidate Sources & Selection Analysis (2)
Co-selected: provides the gentler beginner narrative; CS229 provides the ML-oriented notation bridge.
Strong full-course treatment with noncommercial/share-alike terms; heavier than the compact CS229 reference for this three-day block.