# 符号方法（组合数学）

符号方法是枚举组合学中的一种技术，用于将组合对象的形式定义翻译为生成函数上的函数方程，使得用少量构造写成的规范能机械地导出计数生成函数。<sup>[1](https://aofa.cs.princeton.edu/30gf/)</sup> 该方法由INRIA罗克库尔算法项目研究主任菲利普·弗拉若莱（Philippe Flajolet）与普林斯顿大学计算机科学教授罗伯特·塞奇威克（Robert Sedgewick）在其教科书《解析组合学》中系统化，并且是该领域从规范到渐近分析这一流程的基础。<sup>[2](https://ac.cs.princeton.edu/home/)</sup>

| 关键事实 | 详情 |
|---|---|
| 作用 | 将组合类的形式定义翻译为生成函数上的函数方程<sup>[1](https://aofa.cs.princeton.edu/30gf/)</sup> |
| 核心构造 | 并、笛卡尔积、序列、集合、多重集和循环，每种都有固定的生成函数运算翻译<sup>[3](https://ac.cs.princeton.edu/home/AC.pdf)</sup> |
| 两种情形 | 无标号类由普通生成函数（OGF）计数；由可区分原子构成的标号类由指数生成函数（EGF）计数<sup>[1](https://aofa.cs.princeton.edu/30gf/)</sup><sup> • </sup><sup>[4](https://sedgewick.io/courses/analytic-combinatorics/?_wpnonce=7eb7c80c40&pdfjs_id=1324)</sup> |
| 定义性文本 | 弗拉若莱与塞奇威克的《解析组合学》，其第一章介绍无标号结构的符号方法，第二章介绍标号结构的对应方法<sup>[2](https://ac.cs.princeton.edu/home/)</sup> |
| 软件 | Maple的combstruct包，首次在计算机代数系统中完整实现了符号方法<sup>[5](https://www.mapleprimes.com/posts/200626-Combstruct-Package)</sup> |
| 下游应用 | 所得生成函数用于驱动随机生成的玻尔兹曼采样器，其算法通常在线性时间内运行<sup>[6](https://www.cambridge.org/core/journals/combinatorics-probability-and-computing/article/abs/boltzmann-samplers-for-the-random-generation-of-combinatorial-structures/3CD609732340F8B5EEFF0767CC624F39)</sup> |

## 组合类与生成函数

组合类是一个有限或可数的对象集合，配有非负整数大小函数；大小为\( n \)的对象构成一个有限子集，\( a_n \)表示其个数。<sup>[7](https://upcommons.upc.edu/server/api/core/bitstreams/b1d37a24-8fc4-41d6-98c6-1f8cc5eb11fc/content)</sup> 对于无标号类\( \mathcal{A} \)，其普通生成函数为

\[ A(z) = \sum_{n \ge 0} a_n z^n = \sum_{a \in \mathcal{A}} z^{|a|}, \]

这是一个形式幂级数，其中\( z^n \)的系数恰好是大小为\( n \)的对象的计数。<sup>[1](https://aofa.cs.princeton.edu/30gf/)</sup> 该方法的前提是，许多一般的集合论构造都可以直接翻译为生成函数上的运算，因此一旦指定了一个类，翻译为生成函数就成为纯机械的符号过程。<sup>[3](https://ac.cs.princeton.edu/home/AC.pdf)</sup>

**基本类。** 规范由基本类递归构建：中性类\( \mathcal{E} \)，对大小没有贡献；原子类\( \mathcal{Z} \)，是大小为1的单个对象。<sup>[7](https://upcommons.upc.edu/server/api/core/bitstreams/b1d37a24-8fc4-41d6-98c6-1f8cc5eb11fc/content)</sup> 由此出发，给定两个类\( \mathcal{A} \)和\( \mathcal{B} \)，可以构造其成员的不相交副本的不相交并\( \mathcal{A} + \mathcal{B} \)、有序对的笛卡尔积\( \mathcal{A} \times \mathcal{B} \)，以及由\( \mathcal{A} \)中对象构成的有序列表的序列构造。<sup>[1](https://aofa.cs.princeton.edu/30gf/)</sup> 该方法的完整词典还加入集合、多重集和循环构造，以及指向和替换等补充运算。<sup>[3](https://ac.cs.princeton.edu/home/AC.pdf)</sup>

每种构造在生成函数上都有固定的对应物：并对应级数的加法，积对应乘法，序列对应几何级数\( 1/(1-A(z)) \)。由于这些对应关系只需证明一次便永久成立，用这些算子写成语法的规范会自动转换为生成函数的方程组。<sup>[3](https://ac.cs.princeton.edu/home/AC.pdf)</sup> 用书中的话说，规范就是用基本构造表达的该类的一种计算机程序。<sup>[3](https://ac.cs.princeton.edu/home/AC.pdf)</sup>

## 标号结构与EGF

有一套平行理论处理标号对象，其中构成对象的\( N \)个原子是可区分的，按惯例标为1到\( N \)。<sup>[4](https://sedgewick.io/courses/analytic-combinatorics/?_wpnonce=7eb7c80c40&pdfjs_id=1324)</sup> 标号类的指数生成函数是形式幂级数

\[ A(z) = \sum_{a} \frac{z^{|a|}}{|a|!}, \]

标号类的符号方法在指定类的同时刻画其EGF。<sup>[4](https://sedgewick.io/courses/analytic-combinatorics/?_wpnonce=7eb7c80c40&pdfjs_id=1324)</sup> 标号构造在标号起作用之处与无标号构造不同：例如，标号集合（如同将对象不计次序地装在瓮中）要除以阶乘以计入\( N! \)种重新标号，这正是EGF中\( 1/n! \)所编码的内容。<sup>[4](https://sedgewick.io/courses/analytic-combinatorics/?_wpnonce=7eb7c80c40&pdfjs_id=1324)</sup> 许多经典对象，包括排列、映射和标号树，都自然地表现为标号结构，其原子（如图或树的节点）带有独特的整数标号。<sup>[8](https://algo.inria.fr/seminars/sem00-01/flajolet.html)</sup>

## 递归规范

该方法可推广到递归定义的结构。递归定义，例如二叉树要么为空、要么是一个根带两棵子树，会翻译为一个隐式确定生成函数的函数方程。<sup>[9](https://algo.inria.fr/flajolet/Publications/FlSe02.pdf)</sup> 在较简单的情形，如二叉树或一般树，方程可以求解，从而得到显式计数结果；在其他情形，如非平面树，则直接从函数方程出发进行复渐近分析，获得精确的渐近估计。<sup>[9](https://algo.inria.fr/flajolet/Publications/FlSe02.pdf)</sup> 这就是通往解析组合学中解析那一半的桥梁：弗拉若莱–奥德利兹科奇点分析定理将生成函数在其主奇点附近的解析性质逐项转化为系数渐近，从而为用序列、集合、多重集和递归构造建立的大类族给出普遍规律。<sup>[2](https://ac.cs.princeton.edu/home/)</sup>

该方法还揭示了一族问题所属的函数类。有限面额硬币集合的找零数总是导致极点位于单位圆上的有理生成函数，而正则语言的生成函数按乔姆斯基–许岑贝格尔定理必为有理函数，因此共同的系数提取策略适用于每一族。<sup>[9](https://algo.inria.fr/flajolet/Publications/FlSe02.pdf)</sup> 应用本身可能需要组合洞察：例如，计数集合划分需要找到待计数结构的适当表示，因此双射组合学以非平凡的方式进入这一过程。<sup>[9](https://algo.inria.fr/flajolet/Publications/FlSe02.pdf)</sup>

## 与组合物种的关系

这些思想的范畴论基础是组合物种理论，由魁北克大学蒙特利尔分校范畴论学家安德烈·茹瓦亚尔（André Joyal）在1981年发表于《数学进展》的论文《形式级数的组合理论》中引入。<sup>[10](https://www.sciencedirect.com/science/article/pii/0001870881900529)</sup> 物种为每个有限集赋予其上某一类结构的集合，并沿双射进行结构迁移；形式幂级数的组合解释建立在这一概念之上。<sup>[10](https://www.sciencedirect.com/science/article/pii/0001870881900529)</sup> 该理论为标号结构和无标号结构的生成函数提供了统一理解，其循环指数级数编码两类枚举数据，而类型（无标号）级数可由伯恩赛德引理从中恢复。<sup>[11](https://www.cambridge.org/core/books/combinatorial-species-and-tree-like-structures/D994A1F2877BDE63FF0C9EDE2F9788A8)</sup><sup> • </sup><sup>[12](https://arxiv.org/abs/1312.0542)</sup> 物种的加法、乘法、替换和微分运算是形式幂级数上相应运算的提升，简化了规范、分类和枚举。<sup>[13](https://www.cambridge.org/core/books/abs/combinatorial-species-and-treelike-structures/introduction-to-species-of-structures/74E711E8D84F7BDC6D5BDFCC64B63053)</sup> 茹瓦亚尔最早的应用之一是对标号树数目的凯莱公式的证明。<sup>[10](https://www.sciencedirect.com/science/article/pii/0001870881900529)</sup>

## 软件实现

该方法非常适合自动化，若干计算机代数系统实现了它。Maple的combstruct包使用语法指定结构，并提供随机生成、计数和列出给定大小对象的函数，适用于正则语法和无上下文语法，以及二叉树、项链和函数图等类。<sup>[14](https://www.cs.drexel.edu/~johnsojr/2006-07/fall/cs300/lectures/lec11.html)</sup><sup> • </sup><sup>[15](https://www.maplesoft.com/support/help/maple/view.aspx?L=E&path=combstruct)</sup> 它从语法导出函数方程，并为标号枚举和无标号枚举生成指数生成函数和普通生成函数；它问世时，首次在计算机代数系统中完整实现了符号方法（有时称为组合枚举的民间定理）。<sup>[5](https://www.mapleprimes.com/posts/200626-Combstruct-Package)</sup> 从3.0版起，它可以生成并部分求解生成函数方程，后续版本加入的属性语法允许通过多元生成函数分析路径长度或树中叶数等参数。<sup>[16](https://algo.inria.fr/libraries/autocomb/)</sup> 一个Python包combstruct现在解析同样的规范风格，并使用标号结构的EGF语义和无标号结构的OGF语义从规范计算精确整数项。<sup>[17](https://pypi.org/project/combstruct/)</sup>

## 随机生成

符号方法产生的规范也驱动随机采样。玻尔兹曼采样器由菲利普·迪雄（Philippe Duchon）、菲利普·弗拉若莱、居伊·卢沙尔（Guy Louchard）和吉勒·舍费尔（Gilles Schaeffer）引入，它在整个组合类上放置一种测度，其中对象获得的概率本质上与以其大小为自变量的某个指数函数值成正比；在放宽精确大小采样要求的同时，保持每个大小内对象之间的均匀性。<sup>[6](https://www.cambridge.org/core/journals/combinatorics-probability-and-computing/article/abs/boltzmann-samplers-for-the-random-generation-of-combinatorial-structures/3CD609732340F8B5EEFF0767CC624F39)</sup><sup> • </sup><sup>[18](https://arxiv.org/abs/1112.5071)</sup> 由此得到的算法基于实数算术运算，通常在线性时间内运行，并且可以从组合规范自动编译。<sup>[6](https://www.cambridge.org/core/journals/combinatorics-probability-and-computing/article/abs/boltzmann-samplers-for-the-random-generation-of-combinatorial-structures/3CD609732340F8B5EEFF0767CC624F39)</sup><sup> • </sup><sup>[19](https://repositum.tuwien.at/handle/20.500.12708/4716)</sup> 生成函数，而非其所依据的枚举序列，才是该方法的关键要素。<sup>[18](https://arxiv.org/abs/1112.5071)</sup>

## References

1. [The Symbolic Method, Analytic Combinatorics booksite, Princeton University](https://aofa.cs.princeton.edu/30gf/)
2. [Analytic Combinatorics, Philippe Flajolet and Robert Sedgewick, Princeton booksite](https://ac.cs.princeton.edu/home/)
3. [Flajolet, P. and Sedgewick, R., Analytic Combinatorics, full text (Chapter I)](https://ac.cs.princeton.edu/home/AC.pdf)
4. [Analytic Combinatorics lecture slides, Chapter 2: Labelled Structures and EGFs](https://sedgewick.io/courses/analytic-combinatorics/?_wpnonce=7eb7c80c40&pdfjs_id=1324)
5. [Combstruct Package, MaplePrimes](https://www.mapleprimes.com/posts/200626-Combstruct-Package)
6. [Duchon, Flajolet, Louchard, Schaeffer (2004). Boltzmann Samplers for the Random Generation of Combinatorial Structures. Combinatorics, Probability and Computing 13(4-5): 577–625](https://www.cambridge.org/core/journals/combinatorics-probability-and-computing/article/abs/boltzmann-samplers-for-the-random-generation-of-combinatorial-structures/3CD609732340F8B5EEFF0767CC624F39)
7. [Master's thesis introducing the symbolic method after Flajolet and Sedgewick, Universitat Politècnica de Catalunya](https://upcommons.upc.edu/server/api/core/bitstreams/b1d37a24-8fc4-41d6-98c6-1f8cc5eb11fc/content)
8. [Flajolet, P. Symbolic Enumerative Combinatorics and Complex Asymptotic Analysis, INRIA seminar](https://algo.inria.fr/seminars/sem00-01/flajolet.html)
9. [Flajolet, P. and Sedgewick, R., Analytic Combinatorics, Chapter I.7 Notes (PDF)](https://algo.inria.fr/flajolet/Publications/FlSe02.pdf)
10. [Joyal, A. (1981). Une théorie combinatoire des séries formelles. Advances in Mathematics 42(1): 1–82](https://www.sciencedirect.com/science/article/pii/0001870881900529)
11. [Bergeron, Labelle, Leroux. Combinatorial Species and Tree-like Structures, Cambridge University Press](https://www.cambridge.org/core/books/combinatorial-species-and-tree-like-structures/D994A1F2877BDE63FF0C9EDE2F9788A8)
12. [Hardt, McNeely, Phan, Troyka (2013). Combinatorial species and graph enumeration. arXiv:1312.0542](https://arxiv.org/abs/1312.0542)
13. [Introduction to Species of Structures, Chapter 1 of Combinatorial Species and Tree-like Structures, Cambridge Core](https://www.cambridge.org/core/books/abs/combinatorial-species-and-treelike-structures/introduction-to-species-of-structures/74E711E8D84F7BDC6D5BDFCC64B63053)
14. [Lecture 11: The Symbolic Method and the Combstruct Package, Drexel University](https://www.cs.drexel.edu/~johnsojr/2006-07/fall/cs300/lectures/lec11.html)
15. [Overview of the combstruct Package, Maple Help](https://www.maplesoft.com/support/help/maple/view.aspx?L=E&path=combstruct)
16. [Studies in Automatic Combinatorics, INRIA (Chyzak, Flajolet, Salvy)](https://algo.inria.fr/libraries/autocomb/)
17. [combstruct, Python package on PyPI](https://pypi.org/project/combstruct/)
18. [Duchon, P. (2011). Random generation of combinatorial structures: Boltzmann samplers and beyond. arXiv:1112.5071](https://arxiv.org/abs/1112.5071)
19. [Boltzmann Sampling: algorithms for generating random combinatorial objects, TU Wien repository](https://repositum.tuwien.at/handle/20.500.12708/4716)

---
*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: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Combinatorics › Algebraic and analytic combinatorics › Combinatorial classes, species, and decomposable structures

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/symbolic-method-combinatorics

English original: https://www.edgepedia.org/symbolic-method-combinatorics
