# 条件熵

**条件熵**是信息论中的一个量，用于衡量当另一个随机变量X的值已知时，随机变量Y中剩余的平均不确定性。记作H(Y|X)，当对数底数为2时以比特为单位表示。克劳德·E·香农（Claude E. Shannon）在1948年的著作《通信的数学理论》（*A Mathematical Theory of Communication*）中首次提出了这一概念，他将其描述为：对所有x值，以概率加权平均的、在特定x发生时y所具有的熵<sup>[1](https://academicweb.nd.edu/~powers/ame.20231/shannon1948a.pdf)</sup>。该论文发表于《贝尔系统技术杂志》（Bell System Technical Journal），第27卷，第379–423页（1948年7月）及第623–656页（1948年10月）<sup>[2](https://spinchange.github.io/the-mathematical-theory-of-communication/)</sup>。

| 关键事实 | 详情 |
|---|---|
| 定义 | H(Y\|X)是在给定X各值的条件下，Y的条件分布下计算的Y的熵的期望值<sup>[1](https://academicweb.nd.edu/~powers/ame.20231/shannon1948a.pdf)</sup><sup> • </sup><sup>[3](https://opencw.aprende.org/courses/electrical-engineering-and-computer-science/6-441-information-theory-spring-2010/lecture-notes/MIT6_441S10_lec01.pdf)</sup> |
| 链式法则 | H(X, Y) = H(X) + H(Y\|X)：联合事件的不确定性等于X的不确定性加上X已知时Y的不确定性<sup>[1](https://academicweb.nd.edu/~powers/ame.20231/shannon1948a.pdf)</sup> |
| 条件作用降低熵 | H(Y\|X) ≤ H(Y)，当且仅当X与Y独立时取等号<sup>[1](https://academicweb.nd.edu/~powers/ame.20231/shannon1948a.pdf)</sup><sup> • </sup><sup>[4](https://stanforddatacompressionclass.github.io/Fall23/static_files/L8.pdf)</sup> |
| 非负性 | 对于离散变量，条件熵非负，当Y是X的确定性函数时为零<sup>[5](https://www.sciencedirect.com/topics/computer-science/thermodynamic-entropy)</sup><sup> • </sup><sup>[6](https://www.cl.cam.ac.uk/teaching/2021/InfoTheory/InfoTheoryNotes2020.pdf)</sup> |
| 在信道容量中的作用 | 香农将条件熵H_y(x)称为疑义度，并将传输速率定义为R = H(x) − H_y(x)<sup>[7](https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf)</sup> |
| 法诺不等式 | 将从Y猜测X的错误概率P_e与H(X\|Y)联系起来：对于\|A\|个结果的字母表，P_e ≥ (H(X\|Y) − 1)/log \|A\|<sup>[6](https://www.cl.cam.ac.uk/teaching/2021/InfoTheory/InfoTheoryNotes2020.pdf)</sup> |
| 量子情形 | 对于纠缠量子态，条件冯·诺依曼熵可以为负；其相反数称为相干信息<sup>[8](https://www.cambridge.org/core/books/abs/quantum-information-theory/quantum-information-and-entropy/3D0DD775515E9C4A9B81A5602420F8AA)</sup> |

## 定义

对于结果分别属于\( \mathcal{X} \)和\( \mathcal{Y} \)的离散随机变量X和Y，给定X时Y的条件熵是：在X的分布上，给定X = x时Y的条件分布的熵的期望<sup>[9](https://statproofbook.github.io/D/ent-cond.html)</sup>。求和形式为，

\[ H(Y|X) = -\sum_{x \in \mathcal{X}} \sum_{y \in \mathcal{Y}} p(x, y) \log p(y|x), \]

其中p(x, y)是联合概率质量函数，p(y\|x) = p(x, y)/p(x)是条件概率<sup>[1](https://academicweb.nd.edu/~powers/ame.20231/shannon1948a.pdf)</sup>。麻省理工学院的讲义将同一思想表述为\( H(Y|X) = E_Z[H(Y|X=Z)] \)，即给定X时Y的熵在X所有可能值上的平均<sup>[3](https://opencw.aprende.org/courses/electrical-engineering-and-computer-science/6-441-information-theory-spring-2010/lecture-notes/MIT6_441S10_lec01.pdf)</sup>。

香农最初的记号是H_x(y)，他推导出了恒等式

\[ H(x, y) = H(x) + H_x(y), \]

意即：在已知x的条件下，联合事件x, y的不确定性等于x的不确定性加上y的不确定性<sup>[1](https://academicweb.nd.edu/~powers/ame.20231/shannon1948a.pdf)</sup>。该链式法则可推广到n个变量：\( H(X_1, \ldots, X_n) = \sum_{i=1}^{n} H(X_i | X_1, \ldots, X_{i-1}) \)<sup>[3](https://opencw.aprende.org/courses/electrical-engineering-and-computer-science/6-441-information-theory-spring-2010/lecture-notes/MIT6_441S10_lec01.pdf)</sup>。

## 性质

**条件作用降低熵。** 由链式法则和离散熵的非负性，香农证明了H(y) ≥ H_x(y)：y的不确定性不会因已知x而增加，并且除非x和y是独立事件（此时不变），否则会减少<sup>[1](https://academicweb.nd.edu/~powers/ame.20231/shannon1948a.pdf)</sup>。斯坦福数据压缩课程给出了相同的界\( H(U|V) \le H(U) \)，当且仅当U和V独立时取等号<sup>[4](https://stanforddatacompressionclass.github.io/Fall23/static_files/L8.pdf)</sup>。

**零与非负性。** 对于离散变量，条件熵非负，仅当Y是X的确定性函数（或X是Y的确定性函数）时取等号<sup>[5](https://www.sciencedirect.com/topics/computer-science/thermodynamic-entropy)</sup>。如果X和Y完全相关，或X是Y的任意确定性函数，则H(X\|Y) = 0，因为一旦Y已知，关于X就不存在任何不确定性<sup>[6](https://www.cl.cam.ac.uk/teaching/2021/InfoTheory/InfoTheoryNotes2020.pdf)</sup>。

**与互信息的关系。** 互信息是衡量两个随机变量依赖程度的量，可以用条件熵表示为I(X; Y) = H(X) − H(X\|Y) = H(Y) − H(Y\|X)<sup>[3](https://opencw.aprende.org/courses/electrical-engineering-and-computer-science/6-441-information-theory-spring-2010/lecture-notes/MIT6_441S10_lec01.pdf)</sup>。它表示知道一个变量后另一个变量不确定性减少的量。

## 在通信中的作用

香农用条件熵来定义有噪信道实际传输了多少信息。在他关于二进制信源的例子中，信源每秒产生1000比特，约每100个符号中有1个被错误接收，他认为恰当的修正量是：给定接收信号后对发送内容的不确定性。他将传输速率定义为

\[ R = H(x) - H_y(x), \]

其中条件熵H_y(x)被他命名为疑义度，衡量接收信号的平均模糊度<sup>[7](https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf)</sup>。对于有噪信道，输入和输出的联合熵满足H(x, y) = H(x) + H_x(y) = H(y) + H_y(x)，两个条件熵H_x(y)和H_y(x)分别是输入已知时输出的熵及其反向情形<sup>[7](https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf)</sup>。

条件熵也出现在猜测的界中。法诺不等式将从Y推断X时产生的错误概率P_e与条件熵H(X\|Y)联系起来，假设有\|A\|个可能结果。<sup>[6](https://www.cl.cam.ac.uk/teaching/2021/InfoTheory/InfoTheoryNotes2020.pdf)</sup>

\[ P_e \ge \frac{H(X|Y) - 1}{\log |\mathcal{A}|}. \]

在统计估计中，法诺不等式通过沿马尔可夫链V → X → V̂的条件熵H(V\|V̂)来界定任意估计量的误差<sup>[10](https://web.stanford.edu/class/stats311/lecture-notes.pdf)</sup>。

## 推广

**连续变量。** 对于具有概率密度函数的随机变量，条件微分熵定义为h(X\|Y) = −E[log f(X\|Y)]，互信息变为I(X; Y) = h(X) − h(X\|Y)<sup>[11](https://www.sciencedirect.com/topics/computer-science/differential-entropy)</sup>。链式法则对微分熵仍然成立，条件作用仍然降低熵，因为微分熵在输入分布上是凹的<sup>[12](https://ocw.mit.edu/courses/6-441-information-theory-spring-2010/c98ee16aa0e4e01fb6719e7064af8042_MIT6_441S10_lec16.pdf)</sup>。与离散熵不同，微分熵可以为正也可以为负<sup>[13](https://web.stanford.edu/class/ee376a/files/scribes/lecture10.pdf)</sup>。

**量子系统。** 量子情形下的对应概念使用冯·诺依曼熵。那里出现了与经典情形的根本性偏离：对于某些量子态，条件量子熵可以为负，而条件量子熵的相反数在量子信息论中足够重要，以至于有一个专门的名称——相干信息<sup>[8](https://www.cambridge.org/core/books/abs/quantum-information-theory/quantum-information-and-entropy/3D0DD775515E9C4A9B81A5602420F8AA)</sup>。对于纠缠系统（如爱因斯坦-波多尔斯基-罗森对），条件熵可以为负，这违反了经典信息论的界<sup>[14](https://arxiv.org/abs/quant-ph/9610005)</sup>。在量子系统中，熵和信息取决于对系统所进行测量的选择，这是与经典情形的根本区别<sup>[15](https://www.sciencedirect.com/science/article/pii/S0960077998002252)</sup>。

**从数据估计。** 当联合分布未知时，条件熵必须从样本中估计。布林斯基和科热温引入了离散响应变量依赖于d维因子向量时的条件香农熵估计，通过空间次序统计量或k近邻统计量（其中k = k_n取决于观测数n）构造，并在简单条件下建立了渐近无偏性和L²一致性<sup>[16](https://arxiv.org/abs/1804.08741)</sup>。对于有限支撑的离散变量，联合熵、条件熵和互信息的代入估计量带有有限样本偏差，已有研究通过偏差校正构造来处理<sup>[17](https://arxiv.org/abs/2610.02558)</sup>。

## 解释

条件熵回答了一个实际问题：一旦X已知，描述Y每符号还需要多少比特。在信源建模中，当前面N − 1个符号已知时下一符号的条件熵是信源的第N阶近似熵，当统计影响不超过N个符号时它等于信源熵<sup>[7](https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf)</sup>。在动力系统中，概率空间的一个有限划分在给定另一个划分时的条件熵，被解释为在第二个划分已知时引入第一个划分所增加的信息量<sup>[18](https://www.scholarpedia.org/article/Entropy)</sup>。

## References

1. [Shannon, C. E. (1948). A Mathematical Theory of Communication, Bell System Technical Journal (part I transcription)](https://academicweb.nd.edu/~powers/ame.20231/shannon1948a.pdf)
2. [A Mathematical Theory of Communication — Claude E. Shannon (1948), publication details](https://spinchange.github.io/the-mathematical-theory-of-communication/)
3. [MIT 6.441 Information Theory, Lecture 1 notes](https://opencw.aprende.org/courses/electrical-engineering-and-computer-science/6-441-information-theory-spring-2010/lecture-notes/MIT6_441S10_lec01.pdf)
4. [Properties of conditional entropy, Stanford Data Compression course, Lecture 8](https://stanforddatacompressionclass.github.io/Fall23/static_files/L8.pdf)
5. [Thermodynamic Entropy — ScienceDirect Topics](https://www.sciencedirect.com/topics/computer-science/thermodynamic-entropy)
6. [Information Theory lecture notes, University of Cambridge (2021)](https://www.cl.cam.ac.uk/teaching/2021/InfoTheory/InfoTheoryNotes2020.pdf)
7. [Shannon, C. E. (1948). A Mathematical Theory of Communication, full text](https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf)
8. [Quantum Information and Entropy, in Quantum Information Theory, Cambridge University Press](https://www.cambridge.org/core/books/abs/quantum-information-theory/quantum-information-and-entropy/3D0DD775515E9C4A9B81A5602420F8AA)
9. [Definition: Conditional entropy, The Book of Statistical Proofs](https://statproofbook.github.io/D/ent-cond.html)
10. [Duchi, J. Lecture Notes on Statistics and Information Theory, Stanford Statistics 311](https://web.stanford.edu/class/stats311/lecture-notes.pdf)
11. [Differential Entropy — ScienceDirect Topics](https://www.sciencedirect.com/topics/computer-science/differential-entropy)
12. [MIT 6.441 Information Theory, Lecture 16: Differential entropy](https://ocw.mit.edu/courses/6-441-information-theory-spring-2010/c98ee16aa0e4e01fb6719e7064af8042_MIT6_441S10_lec16.pdf)
13. [EE376A Information Theory, Stanford, Lecture 10: Conditional differential entropy](https://web.stanford.edu/class/ee376a/files/scribes/lecture10.pdf)
14. [Negative entropy in quantum information theory, arXiv:quant-ph/9610005](https://arxiv.org/abs/quant-ph/9610005)
15. [Conditional Entropy and Information in Quantum Systems, ScienceDirect](https://www.sciencedirect.com/science/article/pii/S0960077998002252)
16. [Bulinski, A., Kozhevin, A. (2018). Statistical Estimation of Conditional Shannon Entropy, arXiv:1804.08741](https://arxiv.org/abs/1804.08741)
17. [Bias-Corrected Estimators for Joint Entropy, Conditional Entropy, and Mutual Information in the Discrete Bivariate Case, arXiv:2610.02558](https://arxiv.org/abs/2610.02558)
18. [Entropy, Scholarpedia](https://www.scholarpedia.org/article/Entropy)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Conditional probability and independence › Conditional probability

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/conditional-entropy

English original: https://www.edgepedia.org/conditional-entropy
