第 18 章
噪声信道与 Shannon 编码定理
二元对称信道以概率 p 翻转每一位。重复码能把错误率压到零,但速率趋于零。Shannon 定理说明存在恒定的正速率 1−H(p):随机码本加「环」解码给出可达性证明,计数与并集界给出逆定理。
Transmitting Reliably over a Noisy Channel: Shannon’s Coding Theorem
A binary symmetric channel flips each bit with probability p. Repetition codes drive the error to zero and the rate to zero with it. Shannon's theorem shows a constant positive rate 1−H(p) is achievable: random codebooks and ring decoding prove achievability, while counting and a union bound prove the converse.
篇内目录
- The problem: bits get flipped
- Repetition codes: correction at a steep price
- Timeline
- Rate, encoding, decoding
- Shannon's noisy coding theorem
- Numbers and intuition
- Proof strategy: random codebooks
- Rings
- The key lemma
- Three tools for the lemma
- Tool 1: Stirling gives the ring size
- Tool 2: the weak law keeps us in our own ring
- Tool 3: a union bound keeps us out of other rings
- From "usually good" to "one good codebook"
- Step 1: the probabilistic method
- Step 2: Markov's bound prunes bad codewords
- Converse: why exceeding capacity must fail
- Limits of this proof
- What this lecture establishes
- Comprehension check
- Relation to neighbouring lectures
问题:比特会被翻转
前面的课都在压缩:怎样用更少的比特传同样的信息。这一讲换成相反的方向——信道本身会出错。
二元对称信道(binary symmetric channel,BSC)有一个参数 :每输入一位,以概率 翻转,以概率 原样输出,而且每一位独立。接收方不知道哪几位被翻转了。
取 作为具体例子。把消息压缩到最短之后发出去,每一位都有三分之一的概率出错,还能可靠地恢复原消息吗?
重复码:能纠错,但代价太大
最直接的办法是重复码:每个比特重复 次,解码时对每块做多数表决。
取 ( 是原消息长度)。每块有 位,被翻转的位数服从二项分布,期望是 。只有当翻转超过一半时多数表决才会错。由 Chernoff 界,这个概率随 指数下降;选足够大的常数,可以让单块出错概率低于 。再对所有 块用并集界,整条消息出错的概率不超过 。
所以错误率确实趋于 0。但看速率:
也就是说,为了把错误率压到零,每传一个信息比特要发 个信道比特,真正传过去的信息可以忽略。这不是我们想要的。
本讲的核心问题:能不能在错误率趋于 0 的同时,保持一个不随 衰减的恒定速率?
Shannon 的回答是能,而且能到多快有一个精确的界线。
时间轴
| 时间 | 内容 |
|---|---|
| 0:00 | 二元对称信道 BSC(p) 的定义 |
| 3:19 | 重复码与多数表决;Chernoff 界控制单块错误 |
| 9:29 | 速率 的定义;重复码速率趋于 0 |
| 15:31 | 编码 / 解码函数与 min-max 误差 的形式化 |
| 18:49 | Shannon 噪声编码定理: 必败, 可胜 |
| 21:39 | 容量的普适性;很多信道的容量至今没有显式表达 |
| 22:36 | 直观检查:、、 的对称性 |
| 26:57 | 证明策略:随机码本 |
| 29:51 | 环(ring)的定义:Hamming 距离落在 附近 |
| 32:53 | 关键引理:收到向量落在本码字的环内、且不落在别的环内 |
| 36:43 | Stirling 公式: 的指数增长率为 |
| 46:19 | 关键引理的证明:弱大数定律 + 并集界 |
| 53:37 | 用概率方法从「平均好」得到「存在固定码本」 |
| 59:49 | Markov 界:丢掉一半码字,仍保持速率 |
| 1:03:49 | 逆定理的计数草图 |
速率与编解码
把消息写成长度 的比特串,编码后变成长度 的串发出去。形式化地:
- 编码 ;
- 解码 ;
- 速率 。
消息 经编码得到 ,通过信道后收到 ,解码得到 。对固定的 与 ,定义最优的最坏情况错误率
两个 与 的顺序很关键:我们要求同一个编解码方案对所有消息都好,而不是平均来说好。Shannon 定理就是关于 在 时的行为。
Shannon 噪声编码定理
设二元熵 ,称
为信道的容量。定理包含两个方向。
逆定理(converse)。 若 ,则 。
也就是说,速率超过容量时,无论设计什么编解码方案,都存在一些消息,其成功解码的概率趋于 0——错误率反而趋于 1,通信彻底失败。
可达性(achievability)。 若 ,则 。
也就是说,存在一个编解码方案,使所有消息的错误率同时趋于 0,而速率保持恒定。
两个方向合起来:容量 是可靠通信的精确速率上限。
数值与直觉
取 :
容量很小,但严格为正——重复码的速率趋于 0,而最优方案能以约 0.082 比特/信道使用的速率可靠传输。
几个边界情形:
- :信道不翻转,,,可以满速传输。
- :每一位都翻转,,。接收方把每一位取反即可,容量同样是满的。
- :,。输出与输入完全独立,信道只是随机吐比特,不可能传信息。
- :,。多数表决失效,但少数表决有效:因为翻转概率大于一半,取与多数相反的那个值。
注意 ,所以容量关于 对称。
证明策略:随机码本
重复码失败的原因是码本太小、结构太规整。Shannon 证明的思路相反:让码本随机。
具体地,令
并从 中独立均匀地抽取 个向量 ,作为 条消息的码字。多出来的因子 2 是留给后面筛选的余量。
随机码本的妙处在于:分析「另一个随机码字是否落在某个区域里」时,不需要知道任何结构,只需要数区域的大小。
环
对向量 与宽度参数 ,定义环
其中 是 Hamming 距离,即两个串在多少个坐标上不同。
为什么半径取 ?因为发送 后,每一位独立地以概率 翻转,所以 的期望正是 。由弱大数定律,实际距离以极高概率落在期望附近。 是一个随 趋于 0 的宽度,用来给「附近」一个容差。
关键引理
引理。 设码本随机抽取, 是其中一条码字, 是 经过 BSC 的输出。则对适当选取的 ,当 充分大时
其中 。
为什么这条引理足够? 若事件发生,解码就有一个明确的规则:收到 后,检查它落在哪个码字的环里;引理保证恰好只有一个这样的码字,那就是 ,于是解出 。解码器只需要遍历码本、计算 Hamming 距离。
证明引理的三件工具
工具一:Stirling 公式给出环的大小
从 出发。用 :
前一个因子化简为
后一个因子是 ,取对数后只有 。于是
把 的所有距离层加起来,层数至多 ,每层不超过最大值,得到
这就是熵在信道编码里出现的位置:环的体积由熵决定。
工具二:弱大数定律保证落在自己的环里
是 个独立指示变量之和,每个以概率 取 1。由 Chebyshev 不等式(或弱大数定律),
取 适当(例如 但 ),失败概率可以压到 以下。
工具三:并集界控制「落进别人的环」
先固定 。关键一步是把事件改写:
因为环的条件只涉及 Hamming 距离,而距离是对称的。改写之后, 已经固定, 是独立均匀抽取的随机向量。于是
这一步是整个证明的技巧核心:如果不改写,就要分析「收到的东西恰好落在某个特定随机码字的环里」;改写之后,变成了「一个均匀随机的串落在固定集合里」,概率就是体积比。
对所有 用并集界:
指数部分是
只要 ,取 ,指数以线性速度趋于 ,概率趋于 0。
把工具二与工具三合起来,就得到关键引理。
从「平均好」到「存在一个好码本」
引理说的是:对随机抽取的码本、随机选中的消息,解码失败概率平均不超过 。但我们要证明的是存在一个固定的码本,对所有消息都好。这两件事不一样,需要两步收尾。
第一步:概率方法
对码本 与消息 ,令 为「第 条消息顺利解码」的事件, 是它在该码本下的失败概率。引理给出
一个非负随机变量的期望不超过 ,必然存在某个具体取值不超过 。所以存在一个码本 ,使它的平均失败概率不超过 。
第二步:Markov 界剪掉坏码字
现在有了一个「平均好」的码本,但个别码字可能很糟。设坏码字()的比例为 。平均值至少是 ,而已知平均值不超过 ,于是 :至少一半码字的失败概率不超过 。
把坏码字全部删掉,保留至少 个码字。这仍然是一个 编码:消息数正好是 。对保留下来的每个码字,失败概率都不超过 。重命名消息后,得到一个对所有消息失败概率都不超过 的编解码方案。
令 使 ,就得到 。可达性证完。
逆定理:为什么超过容量必败
逆定理的完整证明需要一些技术引理,课程只给直觉。设存在一个速率 、成功概率至少为 的方案。
考虑发送 时收到的向量。它落在 内的概率接近 1(工具二)。既然整体成功概率至少是 ,那么在环内也必须有一批被正确解码的输出,至少占环的 比例(丢掉环外的部分,比例只会略降)。
现在看不同 的这些「被解码为 的环内向量」集合。它们必须两两不交:解码函数把每个收到的向量映到唯一一条消息,不可能同时属于两条消息的解码集。
于是总体积满足
代入 :
所以速率一旦超过 ,假设的成功概率 就无法维持,矛盾。
这个证明的局限
随机码本让证明变得干净,但它在工程上同样不可行:码本有 条码字,每条长 ,存下来就是指数级空间;解码要遍历整个码本算距离,时间也是指数级。
这正是下一讲转向线性码的动机:不再逐条列出码字,而是用矩阵描述——消息是向量,编码就是矩阵乘法,码本由矩阵隐式给出。存储只需 ,解码可以用线性代数加速。
另一个隐含假设是信道随机翻转。若换成对手模型——对手有预算地挑选至多 个位置破坏——同样的定理不再成立,需要另作分析。
本节结论
- BSC(p) 以概率 独立翻转每一位;重复码能把错误率压到零,但速率趋于零。
- 速率 ; 是对所有消息取最坏、对所有编解码方案取最优的失败概率。
- 容量 : 时失败概率趋于 1, 时可以趋于 0。
- 时 (信道不看输入); 时仍可通信,改用少数表决。
- 可达性证明用随机码本:码字随机抽取,解码找「环」。
- 环的体积是 ,这是熵在信道编码中的来源。
- 关键技巧是把 改写成 ,从而利用 的均匀性。
- 概率方法 + Markov 界把「平均好」转成「存在固定码本,对所有消息都好」。
理解检验
1. 重复码为什么不可取?请给出速率与错误率的具体权衡。
参考答案:重复 次后,单块多数表决的错误概率由 Chernoff 界随 指数下降。取 可使单块错误率低于 ,再对 块用并集界,整条消息的错误率不超过 ,确实趋于 0。
但速率是
传输长度里绝大部分是冗余,每传一个信息比特要发约 个信道比特。可靠性与速率不可兼得——这正是 Shannon 定理要打破的直觉。
2. 为什么 时容量为 0? 时又为什么仍能通信?
参考答案: 时,无论发送 0 还是 1,收到 0 和 1 的概率都是 。输出分布与输入无关,信道只是随机产生比特,接收方无法从中获得任何关于消息的信息,所以 。
时,每一位有 的概率被翻转,,容量仍为 。多数表决会错,但少数表决正确:接收方取与多数相反的值,等价于把信道看成翻转概率 的情形。这说明信道模型里「翻转」与「不翻转」的角色可以互换。
3. 关键引理把 改写成 ,为什么要这样做?
参考答案:改写前, 是随机变量(依赖信道的翻转), 被视为固定的码字;要计算「随机输出落进某个固定码字的环」的概率,需要知道输出的分布,比较麻烦。
改写后, 固定下来, 是独立均匀抽取的随机向量。此时概率就是体积比:
这正好可以用工具一(环的大小)来估计。这一步依赖两个事实:Hamming 距离对称,所以「属于」关系可以互换;码字独立均匀抽取,所以 与 无关。
4. 关键引理的证明用了哪三件工具?各自负责哪一部分?
参考答案:
- Stirling 公式:估计二项式系数,得到环的体积 ;
- 弱大数定律 / Chebyshev: 是 个独立指示变量之和,期望 ,所以以概率 落在自己的环内;
- 并集界:对 个其他码字逐个估计「落进其环」的概率,再求和,得到总失败概率 ,在 时趋于 0。
三者合起来给出「落在自己环内、且不落在任何别的环内」的概率 。
5. 已经证明了「随机码本平均好」,为什么还需要概率方法与 Markov 界?
参考答案:引理给的是对随机码本取平均、对随机消息取平均后的失败概率小。但我们要的是一个固定码本,且对每条消息都成立。两个平均都不能直接去掉。
第一步用概率方法:非负随机变量的平均值 ,说明存在某个码本其平均值 ,去掉对码本的平均。
第二步用 Markov 界:在这个码本内,若超过一半的码字失败概率 ,平均值就会超过 ,矛盾。所以至少一半码字满足 。删掉其余码字,剩下 条,仍是一个 编码,且每条消息的失败率都不超过 。再去掉对消息的平均。
6. 为什么环的半径选在 附近,而不是别的值? 起什么作用?
参考答案:发送 后,每一位独立地以概率 翻转,所以 Hamming 距离 的期望是 。实际收到的向量几乎必然落在期望附近(弱大数定律),所以把解码区域设为以 为半径的壳层是自然的——大部分概率质量都在这里。
是壳层的半宽,随 趋于 0,但取得足够大以保证 Chebyshev 界有效(典型地 )。它给「附近」留出容差,同时在体积估计里只贡献 的因子;只要 小于 的一半,并集界仍然趋于 0。
7. 用计数论证说明:速率超过 时不可能可靠通信。
参考答案:假设某方案成功概率至少为 。发送 时,输出以接近 1 的概率落在 内;既然总成功概率是 ,环内至少 比例的向量被正确解码为 (丢掉环外部分只会让比例略降)。
对不同的 ,这些「解码为 」的集合必须两两不交,否则同一个输出会对应两条消息,与解码函数是函数矛盾。
于是所有集合的总体积不超过全部 个向量:
代入 ,得 ,即 。所以 会迫使 ,成功概率消失。
8. 随机码本在理论上最优,为什么实际不能用?下一讲怎么解决?
参考答案:码本包含 条码字,每条长 ,存储是指数级的;解码要遍历所有码字计算 Hamming 距离,时间也是指数级的。这与上一讲 Shannon 压缩编码的困境相同:存在性证明不给出高效实现。
下一讲用线性码:码本不再逐条列出,而由一个矩阵 定义,编码是 。存储降到 ,结构由线性代数保证,解码可以用校验矩阵与综合(syndrome)实现,复杂度是多项式级。代价是需要额外设计好的线性码(如 Hamming 码、Reed–Solomon 码),而不是「随机抽一个就好」。
与前后课的关系
上一讲解决了无噪声压缩,得到 ;本讲把问题换成有噪声传输,得到容量 与「低于容量即可靠」的定理。两讲的证明共享同一套工具:Stirling 公式把组合计数化成熵,尾界刻画典型性。
下一讲由 Peter Shor 讲线性码:用矩阵隐式描述码本,用最小距离刻画纠错能力,并给出 Hamming 码这一具体构造。再下一讲是 Reed–Solomon 码,用有限域上的多项式达到更大的最小距离。之后课程转向密码学与秘密共享。
The problem: bits get flipped
Earlier lectures compressed: how to send the same information in fewer bits. This one goes the other way — the channel itself makes mistakes.
The binary symmetric channel (BSC) has a parameter : each input bit is flipped with probability and passed through with probability , independently across positions. The receiver does not know which bits were flipped.
Take concretely. After compressing the message to its shortest form, every bit has a one-in-three chance of being wrong. Can the original message still be recovered reliably?
Repetition codes: correction at a steep price
The straightforward idea is a repetition code: send each bit times and decode each block by majority vote.
Choose , where is the message length. A block of bits has a binomial number of flips with mean , and majority vote fails only when more than half are flipped. Chernoff's bound makes that probability decay exponentially in ; a large enough constant gets it below per block. A union bound over the blocks then gives overall failure probability at most .
So the error does go to zero. But look at the rate:
To drive the error to zero we spend about channel bits per information bit, so almost no information gets through. That is not what we want.
The central question: can the error go to zero while the rate stays bounded away from zero?
Shannon's answer is yes, and there is a sharp threshold.
Timeline
| Time | Topic |
|---|---|
| 0:00 | Definition of the binary symmetric channel BSC(p) |
| 3:19 | Repetition codes and majority vote; Chernoff controls per-block error |
| 9:29 | Definition of rate ; repetition codes have rate tending to 0 |
| 15:31 | Encode/decode functions and the min-max error |
| 18:49 | Shannon's theorem: fails, succeeds |
| 21:39 | Universality of capacity; many channels have no explicit formula |
| 22:36 | Sanity checks for , , and the symmetry |
| 26:57 | Proof strategy: random codebooks |
| 29:51 | Rings: Hamming distance near |
| 32:53 | Key lemma: the received vector lies in its own ring and no other |
| 36:43 | Stirling: the exponential growth rate of is |
| 46:19 | Proof of the key lemma: weak law plus union bound |
| 53:37 | Probabilistic method: from "usually good" to "one fixed good codebook" |
| 59:49 | Markov bound: discard half the codewords and keep the rate |
| 1:03:49 | Sketch of the converse counting argument |
Rate, encoding, decoding
Write the message as bits and transmit bits. Formally:
- encoding ;
- decoding ;
- rate .
Message becomes , the channel returns , and the decoder produces . For fixed and , define the optimal worst-case error
The order of and matters: one encoder-decoder pair must work for every message, not merely on average. Shannon's theorem describes the behaviour of as .
Shannon's noisy coding theorem
Let be the binary entropy and call
the capacity of the channel. The theorem has two directions.
Converse. If , then .
Above capacity, no encoder-decoder pair can do better than fail: some messages have success probability tending to zero, so the error approaches one.
Achievability. If , then .
Below capacity, some pair drives the error of every message to zero while holding the rate constant.
Together: capacity is the exact rate at which reliable communication is possible.
Numbers and intuition
For ,
Small but strictly positive — repetition codes have rate tending to zero, while the optimum reliably sends about bits per channel use.
Boundary cases:
- : no flips, , ; transmit at full rate.
- : every bit flips, , ; the receiver complements every bit and recovers everything.
- : , . The output is independent of the input, so no information can pass.
- : , so . Majority vote fails, but minority vote works: because more than half the bits flip, take the opposite of the majority.
Note , so capacity is symmetric about .
Proof strategy: random codebooks
Repetition fails because the codebook is small and rigid. Shannon's proof does the opposite: choose the codebook at random.
Let
and draw vectors independently and uniformly from as codewords for messages. The extra factor of 2 is slack for a pruning step later.
The virtue of randomness is that questions about "does another codeword fall in this region" become pure counting: no structure to analyse.
Rings
For and a width , the ring
where is the Hamming distance, the number of coordinates on which the two strings differ.
Why radius ? After sending , each bit flips independently with probability , so has mean exactly . The weak law puts the actual distance near the mean with overwhelming probability. The parameter is a tolerance that tends to zero as .
The key lemma
Lemma. With a random codebook, if is a codeword and is its output through the BSC, then for a suitable and large ,
where .
Why this suffices. If the event holds, decoding has a simple rule: on receiving , check which codeword's ring contains it. The lemma guarantees exactly one such codeword, namely , so the message is recovered. The decoder only walks the codebook computing Hamming distances.
Three tools for the lemma
Tool 1: Stirling gives the ring size
Start from and use :
The first factor simplifies to
The second is , contributing only after taking logs. Hence
Summing over the distances with adds at most layers, so
This is where entropy enters channel coding: the volume of a ring is governed by entropy.
Tool 2: the weak law keeps us in our own ring
is a sum of independent indicators, each 1 with probability . Chebyshev gives
With a suitable (for instance but ), this failure probability drops below .
Tool 3: a union bound keeps us out of other rings
Fix . The key step is to rewrite the event:
because the ring condition only involves Hamming distance, which is symmetric. After the rewrite, is fixed and is an independent uniform vector, so
This is the technical heart of the proof. Without the rewrite we would need the distribution of the received vector; with it, the probability is a simple volume ratio.
A union bound over all gives
The exponent is
If , choose and the exponent goes to linearly. The probability vanishes.
Tools 2 and 3 together prove the key lemma.
From "usually good" to "one good codebook"
The lemma says: averaging over random codebooks and random messages, the failure probability is at most . What we need is a single fixed codebook that is good for every message. Two steps close the gap.
Step 1: the probabilistic method
For a codebook and message , let be the event that message decodes correctly and its failure probability. The lemma gives
A nonnegative random variable with mean at most must take some value at most . Hence some codebook has average failure probability at most .
Step 2: Markov's bound prunes bad codewords
Now the average is good, but individual codewords may be bad. By Markov's bound, if the average is at most , then the indices with form at most half of all indices; otherwise the average would exceed .
Delete the bad codewords. At least remain, which is exactly an code: the message count is . For every surviving codeword the failure probability is at most . Relabel the messages and we have a code correct for all messages with error at most .
Letting so that gives . Achievability is proved.
Converse: why exceeding capacity must fail
The lecture sketches the converse; a full proof needs additional technical lemmas. Suppose a scheme with rate succeeds with probability at least .
Send . The received vector lies in with probability close to 1 (Tool 2). Since the overall success probability is at least , at least an fraction of the ring must decode correctly to (discarding the part outside the ring changes the fraction only slightly).
Now consider the sets "ring vectors that decode to " for different . They must be pairwise disjoint: the decoder maps each received vector to a single message, so one vector cannot belong to two messages' decoding sets.
Therefore the total volume is at most the whole space:
Substituting ,
If , the assumed success probability cannot be maintained — a contradiction.
Limits of this proof
The random codebook makes the proof clean but is just as impractical as Shannon's compression scheme: codewords of length require exponential storage, and decoding scans the entire codebook at exponential cost.
The next lecture turns to linear codes: instead of listing codewords, describe them with a matrix. Messages are vectors, encoding is a matrix product, and the codebook is given implicitly, in space, with linear-algebraic decoding.
A second hidden assumption is that the channel flips bits randomly. Under an adversary with a budget of corruptions, the same theorem does not hold and needs separate analysis.
What this lecture establishes
- BSC(p) flips each bit independently with probability ; repetition codes drive the error to zero but the rate to zero.
- Rate ; is the worst-case-over-messages, best-over-codes failure probability.
- Capacity : above it the error tends to 1, below it the error tends to 0.
- At , (the channel ignores its input); at communication is still possible via minority vote.
- Achievability uses a random codebook with ring decoding.
- A ring has volume ; this is where entropy enters channel coding.
- The key trick rewrites as to exploit uniformity.
- The probabilistic method plus Markov's bound converts "good on average" into "a fixed codebook good for all messages".
Comprehension check
1. Why are repetition codes unsatisfactory? Give the concrete rate-error tradeoff.
Reference answer: Repeating each bit times makes the per-block majority-vote error decay exponentially in by Chernoff. With , the per-block error is below , and a union bound over blocks gives overall error at most , which does tend to zero.
But the rate is
Almost all transmitted bits are redundancy: roughly channel bits per information bit. Reliability and rate cannot both be won this way — exactly the intuition Shannon's theorem overturns.
2. Why is capacity zero at ? Why can we still communicate at ?
Reference answer: At , the received bit is 0 or 1 with equal probability regardless of what was sent. The output distribution is independent of the input, so the receiver learns nothing, and .
At , each bit flips with probability and , so the capacity is . Majority vote fails, but minority vote succeeds: take the opposite of the majority. Equivalently, view the channel as one that flips with probability and invert every received bit. Flipping and not flipping are interchangeable roles.
3. The key lemma rewrites as . Why?
Reference answer: Before the rewrite, is random (it depends on the channel flips) while is treated as fixed; computing "the random output lands in a fixed codeword's ring" requires the output distribution.
After the rewrite, is fixed and is an independent uniform vector. The probability becomes a volume ratio:
which Tool 1 can estimate. The rewrite relies on two facts: Hamming distance is symmetric, so membership can be swapped, and the codewords are drawn independently and uniformly, so is independent of .
4. Which three tools prove the key lemma, and what does each contribute?
Reference answer:
- Stirling's formula estimates the binomial coefficient, giving ring volume ;
- the weak law / Chebyshev shows , a sum of independent indicators with mean , lies in its own ring with probability at least ;
- a union bound over the other codewords bounds the probability of landing in any foreign ring by , which vanishes when .
Together they give probability at least of being in one's own ring and in no other.
5. We already showed "a random codebook is good on average". Why are the probabilistic method and Markov's bound still needed?
Reference answer: The lemma averages over random codebooks and over random messages. We need one fixed codebook good for every message, so both averages must be removed.
The probabilistic method removes the codebook average: a nonnegative random variable with mean at most attains some value at most , so some codebook has average failure at most .
Markov's bound removes the message average inside that codebook: if more than half the codewords had failure probability above , the average would exceed , a contradiction. So at least half satisfy . Deleting the rest leaves codewords — still an code — with every message's failure probability at most .
6. Why is the ring radius chosen near ? What role does play?
Reference answer: Each bit flips independently with probability , so has mean . The weak law puts the received vector near that mean with overwhelming probability, so a shell at radius captures almost all the probability mass.
is the half-width of the shell. It tends to zero as but must be large enough for Chebyshev to apply (typically ). It contributes only a factor to the volume estimate; as long as is below half of , the union bound still vanishes.
7. Use a counting argument to show that rates above cannot be reliable.
Reference answer: Suppose a scheme succeeds with probability at least . On sending , the output lands in with probability close to 1, so at least an fraction of that ring must decode correctly to .
For different , the sets of vectors decoding to must be pairwise disjoint — otherwise one received vector would map to two messages, contradicting that decoding is a function.
Hence the total volume is bounded by the whole space:
With this gives , i.e. . So forces , and success disappears.
8. The random codebook is theoretically optimal but impractical. How does the next lecture fix this?
Reference answer: The codebook holds codewords of length — exponential storage — and decoding scans all of them at exponential cost. This mirrors the earlier compression story, where the existence proof did not yield an efficient scheme.
The next lecture introduces linear codes: the codebook is described by a matrix and encoding is . Storage drops to , structure comes from linear algebra, and decoding uses a parity-check matrix and its syndrome in polynomial time. The price is that one must design good linear codes (Hamming, Reed–Solomon) rather than rely on a random draw.
Relation to neighbouring lectures
The previous lecture solved noiseless compression with ; this one switches to noisy transmission and obtains the capacity together with the threshold theorem. Both proofs share the same machinery: Stirling turns combinatorial counts into entropy, and tail bounds characterise typicality.
The next lecture, by Peter Shor, covers linear codes: a matrix describes the codebook implicitly, minimum distance measures correction capability, and Hamming codes give a concrete construction. After that, Reed–Solomon codes reach larger minimum distance using polynomials over finite fields. The course then moves on to cryptography and secret sharing.