随机变量与概率分布
仅在记录预测与观察证据后才允许辅助。
前置要求
完成第 25 天(概率基础);如遇阻塞,使用所列恢复链接(第 21 天)。
学习目标
把离散随机变量定义为从结果到数的函数,验证概率分布表,并把它与词元上的类别分布联系起来。
操作指引
随机变量 $X$ 把样本空间的每个结果映射为一个数;其分布列出满足 $\sum_x P(X=x)=1$ 的 $P(X=x)$。公平骰的 $X$ 是 $\{1,\dots,6\}$ 上的均匀分布。必做:计算骰子的 $E[X]$,再验证取值 $\{0,1,2,3\}$ 上的词元型分布 $p=[0.5,0.25,0.125,0.125]$。
自主演练与记录
(a) 求公平骰的 $E[X]$,并解释非整数期望为何不与结果矛盾。(b) 对 $\{0,1,2,3\}$ 上的 $p=[0.5,0.25,0.125,0.125]$,验证 $\sum p = 1$ 并求 $P(X\ge 2)$。(c) 把 $p$ 解释为四个词元类型上的类别分布:哪个是最可能的词元?
$E[X] = (1+2+3+4+5+6)/6$。$P(X\ge 2) = P(X=2)+P(X=3)$。期望是概率加权的长期平均,不是必然出现的结果。
(a) $E[X] = 21/6 = 3.5$:期望是长期平均而非骰面。(b) $0.5+0.25+0.125+0.125=1$;$P(X\ge 2)=0.125+0.125=0.25$。(c) $p=0.5$ 的词元 0 最可能——类别分布就是离散类型上的概率表,正是语言模型输出层产生的形状。
验证归一化 $\sum p = 1$、算出 $P(X\ge2)=0.25$,并能把期望解释为区别于任何单一结果的平均。
权威源资源与权利证明
Introductory Statistics 2e
对应章节 / 时间戳: Chapter 4: Discrete Random Variables (probability distribution functions)
验证版本与日期: 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.
对比候选资源与选型分析 (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
对应章节 / 时间戳: Section 2.4-2.5: Random variables, distributions, expectation
验证版本与日期: 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.
对比候选资源与选型分析 (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.