第 02 章
条件概率、独立性与期望:从贝叶斯到骰子悖论
用飞镖盘重新理解条件概率,用掷两次骰子的四个事件区分「看起来独立」与「真的独立」,推出全概率公式与贝叶斯公式,并用真实医学数据与 Mossel 骰子悖论说明直觉为何失效;最后引入随机变量、期望与指示函数。
Conditional Probability, Independence and Expectation: Bayes to the Dice Paradox
A dartboard makes conditioning intuitive, four events on two dice separate 'looks independent' from 'is independent', the law of total probability and Bayes' rule follow, real mammogram data and Mossel's dice paradox show where intuition fails, and the lecture closes with random variables, expectation and indicators.
篇内目录
- One-sentence orientation
- Timeline
- Review: four tools from last time
- Conditional probability: shrink the world to
- Definition
- The dartboard picture
- Independence: conditioning changes nothing
- Definition and equivalent form
- Example: two rolls of a die
- Counterintuitive case one: is not independent
- Counterintuitive case two: replace by and independence appears
- The law of total probability: split a hard probability
- Two-part version
- General version
- The tree diagram
- Application: Monty Hall
- Bayes' rule: turn the conditional around
- Formula and derivation
- Real data: mammography
- Why intuition fails
- Random variables and expectation
- Definition
- Example one: flip until heads
- Example two: mean time to failure
- Indicator functions and linearity
- Turning events into random variables
- Linearity
- A trap worth naming
- Mossel's dice paradox
- The question
- The wrong intuition:
- The correct value:
- What went wrong
- What this lecture establishes
- Comprehension check
- Relation to neighbouring lectures
一句话定位
上一讲说清了「概率是什么」,这一讲说清「知道了某件事之后,概率怎么变」。核心只有两个定义——条件概率与独立性——但它们推出的结论会反复与直觉冲突:医生会把 读成 ,而一个看起来该等于 的期望其实是 。
冲突的来源不是公式难,而是样本空间被重新归一化之后,人的直觉没有跟着更新。这一讲用同一个飞镖盘把这件事讲到不能再清楚。
时间轴
| 时间 | 内容 |
|---|---|
| 0:00 | 复习:样本空间、概率测度、均匀分布、事件 |
| 2:51 | 条件概率:定义与飞镖盘图像 |
| 7:32 | 独立性:定义、等价形式、掷两次骰子的例子 |
| 17:55 | 全概率公式:两分版本与一般分割 |
| 22:17 | 树状图:把全概率公式画出来 |
| 26:48 | Monty Hall:用树状图一次讲清 |
| 31:24 | 贝叶斯公式与推导 |
| 34:14 | 真实例子:钼靶检查, |
| 41:18 | 随机变量与期望的定义 |
| 45:38 | 抛硬币的期望: |
| 50:33 | 平均无故障时间: |
| 54:11 | 指示函数与期望的线性性 |
| 1:00:52 | Mossel 骰子悖论:条件期望为什么是 而不是 |
复习:上一讲的四件工具
- 样本空间 :一切可能结果的集合,可以是无限的。
- 概率测度 :满足 且 。
- 均匀分布:在有限样本空间 上,每个结果都取 。
- 事件:样本空间的子集 ,其概率是其中各结果概率之和。
事件的并 表示「至少发生一个」,交 表示「两个都发生」。这一讲要在这两种组合之上再加一种:在已知某事件发生的条件下。
条件概率:把样本空间缩到 里
定义
设 。在已知 发生的条件下, 发生的条件概率定义为
这个公式没有任何神秘之处:它只是把概率重新归一化到 上。原来的测度把总质量 分摊在整个 上;现在已知结果落在 内,于是把 内每个结果的概率都除以 ,让新的总质量重新等于 。
飞镖盘图像
把样本空间画成一个矩形,概率对应「随机投一支飞镖,落在某区域的概率等于该区域占的比例」。
- 无条件时, 是区域 占整个矩形的比例。
- 已知落在 中后,整个「世界」缩成区域 : 是 占 的比例。
关键的一句是:重要的不是 在 中占多大,而是 在 中占多大。同样大小的 ,如果它大部分落在 外,那么条件概率会很小;如果它大部分落在 内,条件概率会很大。
独立性:条件不改变概率
定义与等价形式
两个事件 、 称为独立,若
若 ,两边除以 并用条件概率的定义,得到等价形式
两个条件完全等价,检查哪个方便就用哪个。它说的是:知道 发生与否,不会改变对 的判断。
例子:掷两次骰子
掷一枚公平骰子两次,样本空间是 个有序对 ,每个结果的概率为 。
定义
- : 是奇数;
- :。
直观上它们独立,因为一个只看第一次,另一个只看第二次。计算确认:
而 由 、 的所有组合构成,共 个结果,所以
乘积结构正是独立性的来源:两个事件分别约束不同的坐标,组合数自然相乘。
反直觉之一: 不独立
定义 :。满足条件的有
所以 。
而 只有一个结果 ( 是奇数),故 。另一方面
所以 与 不独立。原因也直观: 同时涉及 与 ,它与 共享了对第一次投掷的依赖。
反直觉之二:把 换成 就独立了
定义 :。满足条件的是
所以 。而 只有 ,故 。检查:
于是 与 独立。
这个例子值得停一下:两个事件明明都依赖 ,却满足独立性的定义。它说明独立性是一个计算性质,不是「看起来有没有关系」。当直觉说不清时,只能代公式。
全概率公式:把难算的概率拆开
两分版本
对任意事件 、,
其中 是 的补事件。理由只有一句话: 被分成「 且 」与「 且非 」两块,两块不相交,合起来正好是 。
用条件概率改写每一项,得到
这在实用上极为有力:当 很难直接算,但「在各种情形下 的概率」容易算时,就拆开算。
一般版本
设 两两不交且并集为整个样本空间(这样的集合族称为一个分割),则
两分版本就是取 、 的特例。
树状图
全概率公式有一个几乎不需要记的图像:把随机过程想成一棵树。
- 首先分出若干分支 ,走哪条分支的概率是 。
- 在每个分支之后,事件 发生的概率是 。
- 一条完整路径的概率是沿途概率之积 。
- 把所有以 结尾的路径概率相加,就是 。
树的叶子是样本空间中的结果;树的第一层不是「最终结果」,而是「落在哪个区域」。这个视角的价值在于:它把「先发生什么、再发生什么」的因果顺序直接画了出来。
应用:Monty Hall
三门问题:一扇门后是汽车,另外两扇是山羊。你先选一扇门;主持人知道答案,从你没选的两扇中打开一扇有山羊的门;然后问你要不要换到剩下那扇没开的门。
结论:换,胜率 ;不换,胜率 。
用树状图看,一切都很清楚。奖品在随机位置,所以
- 你初选到山羊的概率是 ;
- 你初选到汽车的概率是 。
如果初选到山羊(概率 ),主持人没有选择:他只能打开另一扇山羊门。此时剩下的那扇门必然是汽车,换就必赢。
如果初选到汽车(概率 ),主持人可以打开任意一扇山羊门;换就必输。
把策略固定为「换」,则
树状图让「主持人没有选择」这一点变得显眼:他不是随机开门,而是被迫避开汽车。这正是很多人算错的地方——把主持人的行为当成与奖品位置无关的随机事件。
贝叶斯公式:把条件反过来
公式与推导
设 、,则
证明。 由定义 ,两边乘以 :
右边正是 (因为 ,交运算与顺序无关)。
推导只有一行,但用法很讲究:它把「已知患病时检测阳性的概率」换成「已知阳性时真正患病的概率」,这两者常常相差一个数量级。
真实例子:钼靶检查
给定以下数据(课程强调这些数字都是真实的):
- – 岁女性中约 患乳腺癌,即 ,其中 表示患病;
- 假阳性率 ,即 ,其中 表示检测阳性;
- 假阴性率 ,即 ,等价于灵敏度 。
问:检测阳性时,真正患病的概率是多少?
先算分母(检测阳性的总概率),用全概率公式:
再用贝叶斯公式:
答案约为 ,远不是 。
为什么直觉会错
把人数摊开来看最清楚。假设有 名女性:
| 患病 | 未患病 | 合计 | |
|---|---|---|---|
| 检测阳性 | |||
| 检测阴性 | |||
| 合计 |
阳性者共 人,其中真正患病的只有 人,比例约 。
直觉的错误在于盯着「假阳性率只有 」看,却忘了未患病的人数是患病者的 倍。基数决定了:即使误报率很低,误报的绝对人数仍然可观。
课程提到,一项对数百名医生的调查显示,平均回答是 ——比正确答案高出一个数量级。这不是数学难题,而是没有把先验概率放进计算。
随机变量与期望
定义
事件是样本空间的子集;随机变量则是定义在样本空间上的函数
它把每个结果映射成一个实数。
期望是随机变量的加权平均:
权重正是每个结果发生的概率。赌博的赔付、系统的寿命、抛硬币的次数,都可以写成随机变量。
例一:抛到正面为止
公平硬币一直抛,直到第一次出现正面。样本空间是所有形如
的序列,其中第 个序列( 个反面后接一个正面)的概率是 。
令 为抛掷的总次数,则
这个和可以逐列求和:
各列之和依次是 ,总和
所以抛到正面为止的期望次数是 。也可以直接用公式 ,取 得 ,再乘 得 。
例二:平均无故障时间
一台机器每天独立地以概率 发生故障,令 为它撑过的天数。则
直接求和会很麻烦,但有一个递归技巧。把第一次观察拆开:
- 以概率 ,第一天就坏,;
- 以概率 ,第一天没坏,那么整个过程重新开始,只是已经多花了一天,于是剩余寿命的期望仍是 。
所以
整理:
这个「无记忆性」是几何分布的核心:过去没有坏,不会让明天更容易坏。对抛硬币例子取 ,立刻得到 ,与逐列求和一致。
指示函数与期望的线性性
把事件变成随机变量
对事件 ,定义指示函数
它的期望恰好是 的概率:
因为求和里只有属于 的项非零,其余全部消失。于是事件的概率问题可以翻译成随机变量的期望问题,两种语言随时互换。
线性性
对任意随机变量 与常数 ,
这条性质对任意随机变量成立,不要求独立。证明只是把求和拆开重排:
一个容易踩的坑
线性性给出
但这不等于 。原因是 不再是 – 指示函数:当结果落在 中时,它取值为 。也就是说,交集被数了两次。
正确的关系是
这正是下一讲容斥原理的起点。用期望的语言说:线性性永远成立,但「把指示函数相加」与「把事件取并」是两件不同的事。
Mossel 骰子悖论
问题
不断掷一枚公平骰子,直到出现 为止,记 为掷的总次数。已知所有掷出的点数都是偶数,问 等于多少?
错误直觉:
一个很自然的推理是:既然每次都是偶数,可能的点数只有 ,每次出现 的概率是 ,所以期望次数是 。
这个推理听起来无懈可击,但答案是错的。
正确计算:
先算条件事件的概率。要使「所有掷出都是偶数」且总共掷 次,前 次必须都是 或 (每次概率 ),最后一次必须是 (概率 )。于是
对所有 求和:
条件分布因此是
这是一个成功概率为 的几何分布,期望为
也可以直接用定义验证:
再除以 得 。
错在哪里
条件化不是「把每次掷骰的分布换成均匀的 」。条件事件「所有掷出都是偶数」对序列长度有偏置:序列越长,满足条件的概率按 衰减,因此长的序列被大幅压低权重。
从条件分布看得很清楚:,而且
也就是说,在已知全为偶数的条件下,第一次就掷出 的概率高达 ——因为一旦第一掷是 ,实验立刻结束,「全为偶数」自动成立;而若第一掷是 或 ,后面还要继续,且必须一直保持偶数。
这个例子说明:条件概率的正确性只能靠计算保证,直觉在这里系统性地偏向错误方向。
本节结论
- 条件概率 是在 上重新归一化;看的是 在 中的比例。
- 独立性有两种等价写法: 或 ;它必须按定义验证,不能凭「看起来有没有关系」判断。
- 全概率公式把 按一个分割拆成 ,树状图是它的直观图像。
- 贝叶斯公式 把条件反过来;钼靶例子中,阳性后真正患病的概率只有约 ,因为先验只有 。
- 随机变量是 的函数,期望是 。
- 几何分布的期望是 ;抛硬币到正面为 次,平均无故障时间为 。
- ;期望的线性性无条件成立,但 不是并集的指示函数——交集被重复计数。
- 条件期望可能严重偏离朴素直觉:Mossel 悖论的答案是 ,不是 。
理解检验
1. 用飞镖盘解释:为什么 与 在整个样本空间中占的比例无关?
参考答案:条件化把「世界」从 缩小成 :已知结果落在 内,就把 的总概率重新归一化为 。此时 能发生的位置只剩下 ,所以
若 有一大块落在 之外,那部分在条件化后被完全排除,不贡献任何概率;反过来, 在 中很小但几乎全在 内时,条件概率可以很大。决定条件概率的是 相对于 的大小。
2. 掷两次公平骰子,,,。验证 与 不独立、 与 独立。
参考答案: 有 个结果,。,;,。而 ,故不独立。 ,;,。而 ,恰好相等,故独立。两个事件都依赖 ,却仍可独立——独立性是计算性质,不是因果性质。
3. 写出全概率公式的一般形式,并说明对 的两个要求各自起什么作用。
参考答案:若 两两不交且 ,则
「两两不交」保证 被切成互不重叠的块 ,相加时不会重复计数;「并集为 」保证没有遗漏, 的每一部分都落在某个 里。缺任何一个,等式都不成立:不交缺失会重复计,覆盖缺失会漏计。两分版本取 、。
4. 钼靶例子中,若把患病率改成 (其余不变), 变成多少?这说明什么?
参考答案:,于是
患病率从 提高到 ,阳性后的患病概率从约 升到 。这说明同样的检测,结论强烈依赖先验概率:检测的灵敏度与假阳性率没有变,变的只是被检测人群中真正患病者的比例。忽略先验(基率)是医学判断中最常见的条件概率错误。
5. 为什么 ,却不能由此推出 ?
参考答案:期望的线性性对任意随机变量成立,不需要独立,所以等式左边确实等于 。但 与 不是同一个随机变量:当结果落在 时,前者取 ,后者取 。因此 并不等于 。正确关系是
即容斥原理;差的那一项正是被重复计数的交集。
6. Mossel 悖论中,为什么「只剩 三种可能,所以期望是 」是错的?正确值 的直觉解释是什么?
参考答案:错误在于把条件化当成「每次独立地在 上均匀取值」。实际上条件事件是「整段序列的所有掷出都是偶数」,它的概率随序列长度按 衰减,因此条件分布对短序列赋予了更大权重。精确计算:
这是成功概率 的几何分布,期望 。直觉解释:在「全为偶数」的条件下,第一掷就是 的概率是 ——第一掷为 时实验立刻结束,条件自动满足;第一掷为 或 时还必须继续并一直保持偶数,路径越长越难。条件化系统性地偏向「早停」。
与前后课的关系
这一讲把「事件」这套语言用到了极限:条件、独立、分割、树状图、贝叶斯。下一讲用容斥原理处理「至少一个事件发生」的计数,正好接上本讲最后指出的问题——指示函数相加会重复计数交集。此后生成函数、尾界与编码理论都会反复调用本讲的工具,尤其是全概率公式与期望的线性性。
一句话记住这一讲:先验决定了后验的量级,而条件化会改变整个分布,不只是改变一个数字。
One-sentence orientation
The previous lecture said what probability is; this one says how probability changes once something is known. Everything rests on two definitions — conditional probability and independence — yet their consequences keep colliding with intuition: doctors read as , and an expectation that looks like is actually .
The collision is not caused by hard formulas. It is caused by renormalising the sample space while leaving human intuition un-updated. A single dartboard picture settles the matter.
Timeline
| Time | Topic |
|---|---|
| 0:00 | Review: sample space, probability measure, uniform distribution, events |
| 2:51 | Conditional probability: definition and the dartboard picture |
| 7:32 | Independence: definition, equivalent form, two-dice example |
| 17:55 | Law of total probability: two-part and general partitions |
| 22:17 | Tree diagrams as a picture of the law |
| 26:48 | Monty Hall, settled by the tree |
| 31:24 | Bayes' rule and its derivation |
| 34:14 | Real data: mammography, |
| 41:18 | Random variables and the definition of expectation |
| 45:38 | Expected coin flips: |
| 50:33 | Mean time to failure: |
| 54:11 | Indicator functions and linearity of expectation |
| 1:00:52 | Mossel's dice paradox: why the conditional expectation is , not |
Review: four tools from last time
- Sample space : the set of all possible outcomes, possibly infinite.
- Probability measure : and .
- Uniform distribution: on a finite , every outcome gets .
- Event: a subset , with probability the sum of the probabilities of its outcomes.
The union means "at least one happens"; the intersection means "both happen". This lecture adds a third way to combine: given that something happened.
Conditional probability: shrink the world to
Definition
For ,
There is nothing mysterious here: the probability is renormalised onto . The original measure spread mass over ; once the outcome is known to lie in , every outcome inside is divided by so that the new total mass is again .
The dartboard picture
Draw the sample space as a rectangle, with probability corresponding to "a dart thrown at random lands in a region with probability proportional to its area".
- Unconditionally, is the fraction of the whole rectangle covered by .
- Given that the dart lies in , the world shrinks to : is the fraction of covered by .
The key sentence: what matters is not how much of that occupies, but how much of that occupies. A set of fixed size has a small conditional probability if most of it lies outside , and a large one if most of it lies inside.
Independence: conditioning changes nothing
Definition and equivalent form
Events and are independent if
When , dividing by and using the definition of conditional probability gives
The two conditions are equivalent; use whichever is convenient. In words: learning whether happened does not change your assessment of .
Example: two rolls of a die
Roll a fair die twice. The sample space is the ordered pairs , each with probability .
Let
- : is odd;
- : .
They look independent, since one constrains only the first roll and the other only the second. Compute:
and consists of all pairs with and , namely outcomes, so
The product structure is exactly where independence comes from: the two events constrain different coordinates, so the counts multiply.
Counterintuitive case one: is not independent
Let : . The outcomes are
so . Now contains only (since is odd), so . But
Hence and are not independent. The reason is visible: involves both and , and therefore shares the dependence on the first roll with .
Counterintuitive case two: replace by and independence appears
Let : . The outcomes are
so , while , so . Now
So and are independent.
This deserves a pause: both events clearly depend on , yet the definition is satisfied. Independence is a computational property, not a causal one. When intuition is unsure, substitute into the formula.
The law of total probability: split a hard probability
Two-part version
For any events and ,
where is the complement of . The reason is one sentence: splits into " and " together with " and not "; the pieces are disjoint and their union is .
Rewriting each piece with conditional probability,
This is powerful in practice: when is hard to compute directly but "the probability of within each scenario" is easy, split it.
General version
Let be pairwise disjoint with union the whole sample space (such a family is a partition). Then
The two-part version is the special case , .
The tree diagram
The law has a picture that barely needs memorising: think of the random process as a tree.
- The first level splits into branches , taken with probabilities .
- After each branch, happens with probability .
- The probability of a complete path is the product .
- Summing the probabilities of all paths that end in gives .
The leaves are outcomes; the first level is not "the final answer" but "which region the outcome falls in". The value of the picture is that it displays the causal order — what happens first, what happens next.
Application: Monty Hall
Three doors, a car behind one and goats behind the others. You pick a door; the host, who knows the answer, opens a different door revealing a goat; then you may switch to the remaining unopened door.
Result: switching wins with probability ; staying wins with probability .
The tree makes it obvious. The prize is placed uniformly, so
- your first pick is a goat with probability ;
- your first pick is the car with probability .
If your first pick is a goat (probability ), the host has no choice: he must open the only other goat door. The remaining door is then necessarily the car, so switching wins for sure.
If your first pick is the car (probability ), the host may open either goat door, and switching loses.
Fix the strategy "always switch". Then
The tree exposes the point people miss: the host is not opening a door at random — he is forced to avoid the car. Treating his action as an event independent of the prize location is precisely the error.
Bayes' rule: turn the conditional around
Formula and derivation
For and ,
Proof. By definition . Multiply both sides by :
The right-hand side is , since .
The derivation is one line, but its use is subtle: it converts "the chance of a positive test given disease" into "the chance of disease given a positive test". Those two numbers often differ by an order of magnitude.
Real data: mammography
The lecture stresses that all numbers are real:
- about of women aged – have breast cancer, so , where denotes disease;
- the false positive rate is , i.e. , where denotes a positive test;
- the false negative rate is , i.e. , equivalently sensitivity .
Question: given a positive test, what is the probability of actually having the disease?
First compute the denominator with the law of total probability:
Then Bayes:
About , not .
Why intuition fails
Lay out the population. Among women:
| Disease | No disease | Total | |
|---|---|---|---|
| Positive | |||
| Negative | |||
| Total |
There are positives, of whom only truly have the disease — about .
The error is to stare at "false positives are only " while forgetting that people without the disease outnumber those with it to . The base rate decides: even a low error rate produces a large number of false alarms.
The lecture notes that a survey of hundreds of physicians averaged — an order of magnitude too high. This is not a hard calculation; it is a failure to put the prior into the computation.
Random variables and expectation
Definition
Events are subsets of the sample space; a random variable is a function on the sample space,
assigning a real number to each outcome.
The expectation is the weighted average
with each outcome weighted by its probability. Payoffs, lifetimes and numbers of coin flips all become random variables.
Example one: flip until heads
Flip a fair coin until the first head. The sample space consists of
where the sequence with tails has probability .
Let be the total number of flips. Then
Sum column by column:
so the column totals are and
Hence the expected number of flips is . The closed form with gives , times , again .
Example two: mean time to failure
A machine fails independently each day with probability . Let be the number of days it survives. Then
Summing directly is painful, but a recursion settles it. Split on the first day:
- with probability it fails immediately, ;
- with probability it survives, at which point the whole process restarts, one day older, so the remaining expected lifetime is again .
Therefore
Rearranging,
This memorylessness is the heart of the geometric distribution: having survived so far does not make tomorrow more likely to fail. For the coin example gives , matching the column sum.
Indicator functions and linearity
Turning events into random variables
For an event , define the indicator
Its expectation is exactly the probability of :
because only the terms with survive. Events and random variables can therefore be translated back and forth at will.
Linearity
For any random variables and constants ,
This holds for all random variables, with no independence required. The proof just splits and rearranges the sum:
A trap worth naming
Linearity gives
But this is not . The sum is no longer a – indicator: on it equals . The intersection is counted twice.
The correct relation is
which is the seed of the next lecture's inclusion–exclusion. In expectation language: linearity always holds, but adding indicators is not the same as taking the union of events.
Mossel's dice paradox
The question
Roll a fair die until the first appears, and let be the number of rolls. Given that every roll was even, what is ?
The wrong intuition:
A natural argument: since every roll is even, only are possible; each roll shows with probability ; so the expected number of rolls is .
It sounds airtight. It is wrong.
The correct value:
First compute the probability of the conditioning event. For the process to stop at roll with all rolls even, the first rolls must be or (probability each) and the last must be (probability ). Hence
Summing over ,
The conditional distribution is therefore
a geometric distribution with success probability , whose expectation is
As a check,
and dividing by gives .
What went wrong
Conditioning is not "replace each roll's distribution by the uniform distribution on ". The event "all rolls are even" biases the length of the sequence: the probability of satisfying it decays like , so long sequences are heavily down-weighted.
The conditional law makes this plain: , and
That is, given that all rolls were even, the first roll was a with probability — because a first roll of ends the experiment immediately and satisfies the condition automatically, whereas a first roll of or forces the process to continue and to stay even for longer and longer.
The lesson: correctness of conditional probability can only be guaranteed by computing. Here intuition is systematically wrong.
What this lecture establishes
- Conditional probability renormalises onto ; what matters is the share of occupied by .
- Independence has two equivalent forms: or ; it must be verified by definition, not by appearance.
- The law of total probability splits as over a partition; the tree diagram is its picture.
- Bayes' rule reverses the conditional; in the mammogram example a positive test implies disease with probability only about , because the prior is .
- A random variable is a function ; its expectation is .
- The geometric distribution has expectation : flips on average to see a head, and days to failure.
- ; linearity is unconditional, but is not the indicator of a union — the intersection is double-counted.
- Conditional expectation can depart sharply from naive intuition: Mossel's paradox gives , not .
Comprehension check
1. Using the dartboard, explain why does not depend on the share of the whole sample space occupied by .
Reference answer: Conditioning shrinks the world from to : knowing the outcome lies in , we renormalise so that the total probability of becomes . The only place where can still occur is , so
Any part of lying outside is excluded and contributes nothing; conversely, a small lying almost entirely inside can have a large conditional probability. The deciding quantity is the size of relative to .
2. Roll a fair die twice. Let , , . Verify that and are dependent while and are independent.
Reference answer: contains outcomes, . with ; with . But , so they are dependent. with ; with . And , equal, so they are independent. Both events depend on , yet independence holds — a computational property, not a causal one.
3. State the general law of total probability and explain what each condition on the is needed for.
Reference answer: If are pairwise disjoint with , then
Pairwise disjointness ensures is cut into non-overlapping pieces , so nothing is counted twice; covering ensures nothing is missed, so every part of lies in some . Without either condition the identity fails. The two-part version takes , .
4. In the mammogram example, if the prevalence were instead of (all else equal), what would be, and what does that show?
Reference answer: , so
Raising prevalence from to raises the post-positive probability from about to . The test's sensitivity and false positive rate are unchanged; only the composition of the tested population changed. Ignoring the base rate is the most common conditional-probability error in medicine.
5. Why is true, and why does it not imply ?
Reference answer: Linearity of expectation holds for arbitrary random variables with no independence requirement, so the left side indeed equals . But and are different random variables: on the former equals while the latter equals . Hence is not . The correct identity is
the inclusion–exclusion principle; the subtracted term is exactly the double-counted intersection.
6. In Mossel's paradox, why is "only remain, so the expectation is " wrong, and what is the intuitive reading of ?
Reference answer: The error is treating conditioning as "each roll is independently uniform on ". The event is actually "the entire sequence is even", whose probability decays like , so the conditional law heavily down-weights long sequences. Precisely,
a geometric law with success probability , expectation . Intuition: under the condition, the first roll is with probability — a first roll of ends the experiment at once and satisfies the condition for free, while a first roll of or forces a longer run that must stay even throughout. Conditioning systematically favours early stopping.
Relation to neighbouring lectures
This lecture pushes the language of events to its limit: conditioning, independence, partitions, trees, Bayes. The next lecture uses inclusion–exclusion to count "at least one event occurs", which answers the double-counting problem raised at the end here. Generating functions, tail bounds and coding theory later reuse these tools, especially the law of total probability and linearity of expectation.
One sentence to keep: the prior sets the order of magnitude of the posterior, and conditioning changes the whole distribution, not just a number.