# 麦克迪尔米德不等式

**麦克迪尔米德不等式**（McDiarmid's inequality），又称有界差不等式，是概率论中的一个集中不等式。它表明：对于独立随机变量的函数，只要改变任意单个输入时函数值的变化量有界，该函数就会在其期望值附近急剧集中。该不等式由牛津大学数学家科林·麦克迪尔米德（Colin McDiarmid）在其1989年的综述《论有界差方法》中发表。<sup>[1](https://www.cambridge.org/core/books/abs/surveys-in-combinatorics-1989/on-the-method-of-bounded-differences/AABA597B562BDA7D89C6077E302694FB)</sup>

| 关键事实 | 细节 |
|---|---|
| 假设 | 独立随机变量 \( X_1,\ldots,X_n \) 及函数 \( f \)，当仅改变第 \( i \) 个坐标时，函数值变化至多 \( c_i \)<sup>[2](https://androma.org/theorems/6074)</sup> |
| 单侧界 | \( \mathbf{P}[X-\mathbf{E}[X]\ge t] \le \exp\!\left(-\frac{2t^2}{\sum_i c_i^2}\right) \)，下尾同理<sup>[3](https://www.cl.cam.ac.uk/teaching/1819/Probablty/materials/Lecture7.pdf)</sup> |
| 双侧界 | \( \mathbf{P}(|X-\mathbf{E}[X]|\ge t) \le 2\exp\!\left(-\frac{2t^2}{C}\right) \)，其中 \( C=\sum_{i=1}^n c_i^2 \)<sup>[2](https://androma.org/theorems/6074)</sup> |
| 证明路径 | Doob鞅 \( Z_i=\mathbf{E}[f(X_1,\ldots,X_n)\mid X_1,\ldots,X_i] \) 的增量有界为 \( c_i \)，故可应用Azuma–Hoeffding不等式<sup>[4](https://www.kunisky.com/static/teaching/2026spring-prob2/prob2-notes-2026.pdf)</sup> |
| 特例 | 对于独立变量之和且 \( X_j\in[a_j,b_j] \)，退化为Hoeffding界 \( \exp(-2t^2/\sum_j (b_j-a_j)^2) \)<sup>[5](https://unseel.com/mathematics/mcdiarmid-inequality)</sup> |
| 典型应用 | 球与箱实验中空箱的数目、随机图的色数、统计学习理论中的泛化界<sup>[3](https://www.cl.cam.ac.uk/teaching/1819/Probablty/materials/Lecture7.pdf)</sup><sup> • </sup><sup>[6](https://arxiv.org/abs/1301.0579)</sup> |

## 陈述

设 \( X_1,\ldots,X_n \) 为独立随机变量，\( X_i \) 取值于可测空间 \( \mathcal{X}_i \)，并设 \( f:\mathcal{X}_1\times\cdots\times\mathcal{X}_n\to\mathbb{R} \) 满足有界差条件：存在非负常数 \( c_1,\ldots,c_n \)，使得当两个输入 \( x \) 与 \( x' \) 仅在第 \( i \) 个坐标上不同时，

\[ |f(x)-f(x')| \le c_i. \]

常数 \( c_i \) 是关于第 \( i \) 个坐标的离散、最坏情况下的导数概念：它衡量当输入 \( i \) 被任意改变时 \( f \) 可能变化多少。<sup>[4](https://www.kunisky.com/static/teaching/2026spring-prob2/prob2-notes-2026.pdf)</sup> 记 \( X=f(X_1,\ldots,X_n) \)，\( C=\sum_{i=1}^n c_i^2 \)，该不等式表明对任意 \( t\ge 0 \),

\[ \mathbf{P}[X-\mathbf{E}[X]\ge t]\ \le\ \exp\!\left(-\frac{2t^2}{C}\right), \qquad \mathbf{P}[X-\mathbf{E}[X]\le -t]\ \le\ \exp\!\left(-\frac{2t^2}{C}\right), \]

并且由两尾的联合界，

\[ \mathbf{P}\bigl(|X-\mathbf{E}[X]|\ge t\bigr)\ \le\ 2\exp\!\left(-\frac{2t^2}{C}\right). \]

该结果对离散随机变量成立，对连续随机变量亦可证明。<sup>[3](https://www.cl.cam.ac.uk/teaching/1819/Probablty/materials/Lecture7.pdf)</sup> 偏离尺度由 \( \sqrt{C} \) 设定：大小为 \( t \) 的偏离概率以 \( t^2/C \) 的指数速率衰减，因此一个对许多输入各自依赖都很弱的函数，即使没有任何单个变量是小的，也会紧密集中。

## 证明思路

标准证明构造逐次揭示输入的Doob鞅：

\[ Z_i = \mathbf{E}[f(X_1,\ldots,X_n)\mid X_1,\ldots,X_i], \qquad i=0,1,\ldots,n. \]

这里 \( Z_n=f(X_1,\ldots,X_n) \)，\( Z_0=\mathbf{E}[f(X_1,\ldots,X_n)] \)，因此所关心的量是总漂移 \( Z_n-Z_0 \)。<sup>[3](https://www.cl.cam.ac.uk/teaching/1819/Probablty/materials/Lecture7.pdf)</sup> 为界定增量，取输入的独立副本 \( X'_1,\ldots,X'_n \)，并记 \( X^{(i)}=(X_1,\ldots,X_{i-1},X'_i,X_{i+1},\ldots,X_n) \)，即原向量中第 \( i \) 个坐标被重新抽样。于是

\[ Z_i-Z_{i-1} = \mathbf{E}[f(X)-f(X^{(i)})\mid X_1,\ldots,X_i], \]

因此几乎必然有 \( |Z_i-Z_{i-1}|\le c_i \)。<sup>[4](https://www.kunisky.com/static/teaching/2026spring-prob2/prob2-notes-2026.pdf)</sup> 对此有界差鞅应用Azuma–Hoeffding不等式即得指数尾；上尾由马尔可夫不等式及对指数参数的优化得到，对 \( -f \) 应用相同论证即得下尾。<sup>[2](https://androma.org/theorems/6074)</sup>

## 与Hoeffding和Azuma的关系

底层的鞅不等式最早由瓦西里·霍夫丁（Wassily Hoeffding）发现，后又由吾妻一兴（Kazuoki Azuma）独立发现，二者主要关注不相关随机变量之和。20世纪80年代末，包括米歇尔·塔拉格兰（Michel Talagrand）和麦克迪尔米德在内的一批研究者意识到，Azuma–Hoeffding不等式对有界随机变量的非线性函数具有重要推论。<sup>[7](https://www.stat.uchicago.edu/~lalley/Courses/313/Concentration.pdf)</sup> 麦克迪尔米德的贡献在于将有界差假设识别为一个简明、可检验的条件，为Doob鞅提供所需的增量界。<sup>[5](https://unseel.com/mathematics/mcdiarmid-inequality)</sup> 因此，该结果在一些文献中也称为Hoeffding–Azuma不等式。<sup>[8](https://arxiv.org/abs/1212.5796)</sup>

当 \( f \) 是独立变量之和 \( f(x)=\sum_j x_j \) 且 \( X_j\in[a_j,b_j] \) 时，改变坐标 \( j \) 使 \( f \) 变化至多 \( b_j-a_j \)，故 \( c_j=b_j-a_j \)，麦克迪尔米德界恰好变为Hoeffding不等式 \( \exp(-2t^2/\sum_j (b_j-a_j)^2) \)。<sup>[5](https://unseel.com/mathematics/mcdiarmid-inequality)</sup> 因此，该不等式是Hoeffding界从线性函数到满足逐坐标Lipschitz条件的任意函数的真正推广。

## 应用

**球与箱。** 将 \( m \) 个球独立均匀随机地抛入 \( n \) 个箱子，令 \( F \) 为空箱的数目。将一个球从一个箱子移到另一个箱子至多使空箱数变化1，故每个 \( c_i=1 \)，\( C=m \)。麦克迪尔米德不等式给出

\[ \mathbf{P}[|F-\mathbf{E}[F]|>t]\ \le\ 2e^{-2t^2/m}, \]

因此空箱数以高概率为 \( n(1-1/n)^m \pm O(\sqrt{m}) \)。<sup>[3](https://www.cl.cam.ac.uk/teaching/1819/Probablty/materials/Lecture7.pdf)</sup><sup> • </sup><sup>[4](https://www.kunisky.com/static/teaching/2026spring-prob2/prob2-notes-2026.pdf)</sup> 同样的技术适用于物品大小在 \([0,1]\) 中随机的装箱问题。<sup>[3](https://www.cl.cam.ac.uk/teaching/1819/Probablty/materials/Lecture7.pdf)</sup>

**随机图。** 该方法是证明图参数（如色数）尖锐集中的标准工具，因为揭示或改变一个边指示变量至多使色数变化1。<sup>[9](https://d-nb.info/1344908020/34)</sup> 麦克迪尔米德本人的综述指出随机图和算法的概率分析是其主要应用领域。<sup>[10](https://www.math.cmu.edu/~af1p/Texfiles/monotone.pdf)</sup>

**学习理论。** 在统计学习理论中，麦克迪尔米德不等式将学习算法在改变一个训练样本下的稳定性转化为泛化误差的界；在PAC框架下，基于训练稳定性的方法通过扩展的麦克迪尔米德不等式直接界定泛化误差，无需诉诸一致收敛或VC维。<sup>[6](https://arxiv.org/abs/1301.0579)</sup>

## 扩展

独立性假设和最坏情况常数均可放宽。对于样本间存在依赖、且依赖关系由图刻画的学习问题，图依赖随机变量的Lipschitz函数的麦克迪尔米德型不等式表明，集中程度由图森林复杂度支配；对许多类型的依赖数据，该复杂度很小，从而为非独立同分布数据的学习提供了良好的集中与稳定性界。<sup>[11](https://papers.neurips.cc/paper_files/paper/2019/hash/658bbbdef9415ba5e2ff857f1146ba6e-Abstract.html)</sup> 图依赖下的一个相关扩展将 \( C \) 替换为 \( \chi_f(G)\,\|\mathbf{c}\|_2^2 \)，其中 \( \chi_f(G) \) 是依赖图 \( G \) 的分数色数。<sup>[12](https://www.sciencedirect.com/science/article/abs/pii/S0167715221002340)</sup>

第二条工作路线削弱了有界差假设本身。Boucheron、Lugosi和Massart的熵方法为自界函数给出了指数集中，其坐标变化的平方只需由函数值而非固定常数控制，这是一个温和得多的要求。<sup>[13](https://imechanica.egr.uh.edu/sites/default/files/ConcentrationOfMeasureLugosi.pdf)</sup> 其他改进包括典型有界差方法，它在 \( f \) 仅在典型意义下不过分依赖任何变量时建立尖锐集中，<sup>[8](https://arxiv.org/abs/1212.5796)</sup> 以及差仅以高概率有界的扩展，<sup>[14](https://newtraell.cs.uchicago.edu/research/publications/techreports/TR-2002-04)</sup> 和针对无界交互函数的分布依赖麦克迪尔米德型不等式。<sup>[15](https://proceedings.mlr.press/v202/li23t.html)</sup>

## References

1. [Colin McDiarmid (1989). On the method of bounded differences. Surveys in Combinatorics, 1989, London Math. Soc. Lecture Notes 141, pp. 148–188, Cambridge University Press.](https://www.cambridge.org/core/books/abs/surveys-in-combinatorics-1989/on-the-method-of-bounded-differences/AABA597B562BDA7D89C6077E302694FB)
2. [McDiarmid Bounded Differences Inequality — Statement & Proof, Androma](https://androma.org/theorems/6074)
3. [Lecture 7: Martingales and Concentration, University of Cambridge](https://www.cl.cam.ac.uk/teaching/1819/Probablty/materials/Lecture7.pdf)
4. [Lecture Notes: Probability Theory II](https://www.kunisky.com/static/teaching/2026spring-prob2/prob2-notes-2026.pdf)
5. [McDiarmid's Bounded Differences Inequality, Unseel](https://unseel.com/mathematics/mcdiarmid-inequality)
6. [Almost-everywhere algorithmic stability and generalization error, arXiv:1301.0579](https://arxiv.org/abs/1301.0579)
7. [Concentration Inequalities, University of Chicago lecture notes](https://www.stat.uchicago.edu/~lalley/Courses/313/Concentration.pdf)
8. [On the method of typical bounded differences, arXiv:1212.5796](https://arxiv.org/abs/1212.5796)
9. [Colorings of Randomly Augmented Graphs](https://d-nb.info/1344908020/34)
10. [A note citing Bollobás and McDiarmid surveys on martingale methods](https://www.math.cmu.edu/~af1p/Texfiles/monotone.pdf)
11. [McDiarmid-Type Inequalities for Graph-Dependent Variables and Stability Bounds, NeurIPS 2019](https://papers.neurips.cc/paper_files/paper/2019/hash/658bbbdef9415ba5e2ff857f1146ba6e-Abstract.html)
12. [When Janson meets McDiarmid: Bounded difference inequalities under graph-dependence, ScienceDirect](https://www.sciencedirect.com/science/article/abs/pii/S0167715221002340)
13. [Concentration-of-measure inequalities, Gábor Lugosi lecture notes](https://imechanica.egr.uh.edu/sites/default/files/ConcentrationOfMeasureLugosi.pdf)
14. [Extensions to McDiarmid's inequality when differences are bounded with high probability, University of Chicago TR-2002-04](https://newtraell.cs.uchicago.edu/research/publications/techreports/TR-2002-04)
15. [Distribution-dependent McDiarmid-type Inequalities for Functions of Unbounded Interaction, ICML 2023](https://proceedings.mlr.press/v202/li23t.html)

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

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Expectation, moments, and inequalities › Concentration inequalities

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/mcdiarmids-inequality

English original: https://www.edgepedia.org/mcdiarmids-inequality
