# 指示函数

**指示函数**（也称集合的**特征函数**）是定义在集合 X 上的函数，用来报告元素是否属于 X 的子集 A：它在 A 的每个元素上取值 1，在 A 之外的每个 X 元素上取值 0<sup>[1](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)</sup>。同一个对象有两个名称和若干种记号，它是测度论的基石、计数与概率之间的桥梁，也是组合学中的一种证明工具。

| 关键事实 | 详情 |
|---|---|
| 定义 | 对 A ⊆ X，指示函数 χ_A(x) = 1（若 x ∈ A），否则为 0<sup>[1](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)</sup> |
| 记号 | χ_A（χ 来自希腊语 χαρακτήρ）、1_A 或 I_A；有时用艾弗森括号书写<sup>[2](https://encyclopediaofmath.org/wiki/Indicator_function)</sup><sup> • </sup><sup>[3](https://mathworld.wolfram.com/CharacteristicFunction.html)</sup> |
| 集合代数 | χ_{E∩F} = χ_E χ_F，χ_{E^c} = 1 − χ_E，以及 1_{E∨F} = 1_E + 1_F − 1_{E∧F}<sup>[4](https://terrytao.wordpress.com/2015/09/29/275a-notes-0-foundations-of-probability-theory/comment-page-1/)</sup> |
| 对应关系 | 映射 A ↦ 1_A 是从 X 的幂集到函数 X → {0,1} 的双射<sup>[5](https://www.sciencedirect.com/topics/mathematics/indicator-function)</sup> |
| 期望 | 对事件 A，指示随机变量满足 E[1_A] = P(A)<sup>[6](https://www2.hawaii.edu/~berneyk/ics311/Notes/Topic-05A.html)</sup> |
| 在积分中的作用 | 简单函数——指示函数的有限线性组合——是勒贝格积分的构件<sup>[1](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)</sup> |
| 术语警示 | 在概率论中，“特征函数”指分布的傅里叶变换，是一个无关的对象<sup>[7](https://sites.math.duke.edu/~rtd/PTE/PTE5_011119.pdf)</sup> |

## 定义与记号

对于较大集合 X 的子集 A，指示函数是函数 χ_A : X → ℝ，定义为：若 x ∈ A 则 χ_A(x) = 1，否则 χ_A(x) = 0<sup>[1](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)</sup>。《数学百科全书》在 χ_E 之外还列出了替代记号 1_E 和 ξ_E，并指出 χ 是希腊语词 χαρακτήρ 的首字母，而后者正是“characteristic”一词的来源<sup>[2](https://encyclopediaofmath.org/wiki/Indicator_function)</sup>。Wolfram MathWorld 补充说，特征函数有时用艾弗森括号表示，这种记号把真假条件直接转化为 1 或 0<sup>[3](https://mathworld.wolfram.com/CharacteristicFunction.html)</sup>。

这个定义在两个方向上都是完美对应：X 上只取 0 和 1 的每个函数都是某个集合的指示函数，即它等于 1 的那个集合；而把每个子集 A 映到其指示函数 1_A 的映射，是从 X 的幂集到所有从 X 到 {0,1} 的函数所成集合的双射<sup>[2](https://encyclopediaofmath.org/wiki/Indicator_function)</sup><sup> • </sup><sup>[5](https://www.sciencedirect.com/topics/mathematics/indicator-function)</sup>。这使得集合运算可以被替换为函数上等价的算术运算<sup>[5](https://www.sciencedirect.com/topics/mathematics/indicator-function)</sup>。

## 指示函数的代数

事件的布尔运算对应于其指示函数上的算术操作<sup>[4](https://terrytao.wordpress.com/2015/09/29/275a-notes-0-foundations-of-probability-theory/comment-page-1/)</sup>。对事件 E 和 F：

- \( 1_{E \wedge F} = 1_E \cdot 1_F \)，且 n 个指示函数之积是 n 重交集的指示函数<sup>[4](https://terrytao.wordpress.com/2015/09/29/275a-notes-0-foundations-of-probability-theory/comment-page-1/)</sup><sup> • </sup><sup>[8](https://people.math.sc.edu/laszlo/indicator1.pdf)</sup>。
- \( 1_{\overline{E}} = 1 - 1_E \)<sup>[4](https://terrytao.wordpress.com/2015/09/29/275a-notes-0-foundations-of-probability-theory/comment-page-1/)</sup>。
- \( 1_{E \vee F} = 1_E + 1_F - 1_{E \wedge F} \)，即容斥恒等式；若 E 与 F 不交，则化为 \( 1_{E \vee F} = 1_E + 1_F \)<sup>[4](https://terrytao.wordpress.com/2015/09/29/275a-notes-0-foundations-of-probability-theory/comment-page-1/)</sup>。
- \( E \subseteq F \) 当且仅当 \( 1_E \leq 1_F \)<sup>[4](https://terrytao.wordpress.com/2015/09/29/275a-notes-0-foundations-of-probability-theory/comment-page-1/)</sup>。

LibreTexts 的概率教材用指示变量的语言记录了同样的恒等式，并补充了 \( \bs{1}_{A \cap B} = \min\{\bs{1}_A, \bs{1}_B\} \) 和 \( \bs{1}_{A \cup B} = \max\{\bs{1}_A, \bs{1}_B\} \)<sup>[9](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.02%3A_Events_and_Random_Variables)</sup>。

**容斥原理。** 这些恒等式给出了容斥公式的简短证明。展开乘积 \( (1 - \chi_1)(1 - \chi_2) \cdots (1 - \chi_n) \)，并把指示函数之积转化为交集的指示函数，就得到并集之补的函数恒等式；在全集 U 上求和（其中 \( \sum_{x \in U} \chi_A(x) = |A| \)），便得到 \( |A_1 \cup A_2 \cup \cdots \cup A_n| \) 的通常计数公式，即各交集基数之交错求和<sup>[8](https://people.math.sc.edu/laszlo/indicator1.pdf)</sup>。同一份讲义还从相应的指示恒等式推导出查尔斯·乔丹（Charles Jordan）的公式，用于计算恰好属于 q 个集合的元素个数<sup>[8](https://people.math.sc.edu/laszlo/indicator1.pdf)</sup>。

## 在测度论与积分中的作用

简单函数是勒贝格积分中对应于黎曼积分之阶梯函数的类比物。函数 φ : ℝ → ℝ 称为简单函数，若它是特征函数的有限线性组合，\( \varphi = \sum_{i=1}^{n} a_i \chi_{S_i} \)<sup>[1](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)</sup>。这种表示中的系数和集合不必唯一，但若要求系数互不相同并取 \( S_i = \varphi^{-1}(a_i) \)，则分解唯一且各集合不交；这就是标准表示<sup>[1](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)</sup>。

指示函数的可测性归结为其集合的可测性：χ_S 是勒贝格（分别地，博雷尔）可测的，当且仅当 S 属于勒贝格（分别地，博雷尔）σ-代数<sup>[1](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)</sup>。在一般测度空间中，A 可测当且仅当 χ_A 可测<sup>[10](https://citeseerx.ist.psu.edu/document?doi=923f077aea09184e9cef5d60d06630a55db98966&repid=rep1&type=pdf)</sup>。

指示函数的积分就是其集合的测度。对标准表示下的简单函数，勒贝格积分为 \( \int \varphi \, dm = \sum_{i=1}^{n} a_i \, m(S_i) \)，因此对指示函数就是 \( m(S) \)<sup>[1](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)</sup>。每个非负可测函数都可逐点由递增的简单函数序列逼近，勒贝格积分正是由此从简单函数推广到一般可测函数<sup>[10](https://citeseerx.ist.psu.edu/document?doi=923f077aea09184e9cef5d60d06630a55db98966&repid=rep1&type=pdf)</sup>。

[0, 1] 上有理数集的指示函数展示了这一理论的力量。函数 χ_{Q∩[0,1]} 不是黎曼可积的，但由于有理数的勒贝格测度为零，其勒贝格积分为 \( m(\mathbb{Q} \cap [0,1]) = 0 \)<sup>[1](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)</sup>。

## 指示随机变量

在概率论中，事件 A 的指示函数称为 A 的指示变量；它的值表明 A 是否发生，发生为 1，不发生为 0<sup>[9](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.02%3A_Events_and_Random_Variables)</sup>。任何只取 0 和 1 的随机变量都是事件 {X = 1} 的指示变量<sup>[9](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.02%3A_Events_and_Random_Variables)</sup>。

核心事实是：指示函数的期望等于其事件的概率：对 \( X_A = I\{A\} \)，\( E[X_A] = 1 \cdot P\{A\} + 0 \cdot P\{\lnot A\} = P\{A\} \)<sup>[6](https://www2.hawaii.edu/~berneyk/ics311/Notes/Topic-05A.html)</sup>。结合期望的线性性，这把困难的计数问题转化为一系列容易的概率问题之和。即使指示变量相关，该方法仍然有效：指示函数之和的期望等于各自期望之和，与相关性无关<sup>[11](https://web.stanford.edu/class/archive/cs/cs109/cs109.1256/lectures/20_conditional_expectation.pdf)</sup>。

**应用实例。** n 次公平掷硬币中正面的期望次数，可把计数写成 \( X = \sum_{i=1}^{n} X_i \)，其中 \( X_i = I\{\text{第 } i \text{ 次掷出正面}\} \)；每个 \( E[X_i] = 1/2 \)，故 \( E[X] = n/2 \)，无需枚举二项分布<sup>[6](https://www2.hawaii.edu/~berneyk/ics311/Notes/Topic-05A.html)</sup>。在招聘问题中，候选人以随机顺序到达，候选人 i 被录用当且仅当他优于此前所有候选人，\( P\{\text{候选人 } i \text{ 是目前最佳}\} = 1/i \)，故期望录用人数为调和数 \( \sum_{i=1}^{n} 1/i \)，期望招聘成本为 \( O(c_h \ln n) \)，而最坏情况为 \( O(c_h n) \)<sup>[6](https://www2.hawaii.edu/~berneyk/ics311/Notes/Topic-05A.html)</sup>。对于随机排列中逆序数的期望，对 i < j 的数对 (i, j) 的指示函数有 \( P\{A[i] > A[j]\} = 1/2 \)，对所有数对求和即得期望，无需考察整个排列<sup>[6](https://www2.hawaii.edu/~berneyk/ics311/Notes/Topic-05A.html)</sup>。同样的技巧可计算成功次数、哈希冲突次数或指令数的期望<sup>[11](https://web.stanford.edu/class/archive/cs/cs109/cs109.1256/lectures/20_conditional_expectation.pdf)</sup>，而随机算法分析中几乎每一个计数论证都是指示函数之和<sup>[12](https://www.kevos.com/engineering/random-variables)</sup>。

## 术语与相关用法

“特征”一词承载两个无关的含义。分析学家把 1_A 称为 A 的特征函数，但在概率论中该术语专指分布的傅里叶变换 \( \varphi(t) = \int e^{itx} P(x)\,dx \)，因此杜雷特（Durrett）所著的概率教材等避免用这个名称指指示函数<sup>[7](https://sites.math.duke.edu/~rtd/PTE/PTE5_011119.pdf)</sup><sup> • </sup><sup>[3](https://mathworld.wolfram.com/CharacteristicFunction.html)</sup>。

凸分析中有一种不同的约定：集合 C 的指示函数记为 ι_C，在 C 上取值 0，在 C 外取值 +∞；它用于在优化中编码约束<sup>[13](https://www.ci2ma.udec.cl/pdf/pre-publicaciones2/2026/pp26-06.pdf)</sup>。指示变量之和也出现在集中不等式里：对于可表示为独立或负相关指示变量之和的随机变量，其尾部概率有切尔诺夫型界<sup>[14](https://arxiv.org/abs/1609.00533)</sup>。

## References

1. [Brent Nelson, The Lebesgue Integral, lecture notes, Michigan State University](https://users.math.msu.edu/users/banelson/files/lebesgue_integral.pdf)
2. [Characteristic function of a set, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Indicator_function)
3. [Characteristic Function, Wolfram MathWorld](https://mathworld.wolfram.com/CharacteristicFunction.html)
4. [Terry Tao, 275A, Notes 0: Foundations of probability theory](https://terrytao.wordpress.com/2015/09/29/275a-notes-0-foundations-of-probability-theory/comment-page-1/)
5. [Indicator Function, ScienceDirect Topics](https://www.sciencedirect.com/topics/mathematics/indicator-function)
6. [ICS 311 #5A: Probabilistic Analysis, University of Hawaii](https://www2.hawaii.edu/~berneyk/ics311/Notes/Topic-05A.html)
7. [Rick Durrett, Probability: Theory and Examples, Chapter 1](https://sites.math.duke.edu/~rtd/PTE/PTE5_011119.pdf)
8. [Notes on Inclusion-Exclusion and Indicator Functions, University of South Carolina](https://people.math.sc.edu/laszlo/indicator1.pdf)
9. [Events and Random Variables, Statistics LibreTexts (Siegrist)](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.02%3A_Events_and_Random_Variables)
10. [Lebesgue integral theory, CiteSeerX](https://citeseerx.ist.psu.edu/document?doi=923f077aea09184e9cef5d60d06630a55db98966&repid=rep1&type=pdf)
11. [CS109 Lecture 20: Conditional Expectation, Stanford University](https://web.stanford.edu/class/archive/cs/cs109/cs109.1256/lectures/20_conditional_expectation.pdf)
12. [Random Variables, KEVOS](https://www.kevos.com/engineering/random-variables)
13. [Universidad de Concepción preprint pp26-06, CI²MA](https://www.ci2ma.udec.cl/pdf/pre-publicaciones2/2026/pp26-06.pdf)
14. [Large deviation inequalities for sums of indicator variables, arXiv:1609.00533](https://arxiv.org/abs/1609.00533)

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

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › Formal logic and foundations › Set theory › Elementary set theory

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/indicator-function

English original: https://www.edgepedia.org/indicator-function
