# 递推关系

递推关系是一种数学关系，它将序列中的某一项 f_n 表示为前面若干项 f_i（i < n）的某种组合；当它被表述为一个待求解的方程时，便称为递推方程，有时也叫差分方程。<sup>[1](https://mathworld.wolfram.com/RecurrenceRelation.html)</sup> 初始项被明确给定，后续项则由其前项计算得出，因此一个递推关系加上它的初始值就定义了一个唯一的序列。<sup>[2](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)</sup> 递推关系是分析递归算法的标准工具，也用于计数组合结构以及对随机过程建模。<sup>[2](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 将 f_n 用 f_i（i < n）表示的方程；作为待求解的方程，它称为递推方程或差分方程<sup>[1](https://mathworld.wolfram.com/RecurrenceRelation.html)</sup> |
| 初始值 | 必须给定若干初始值，递推关系才能定义唯一的序列<sup>[2](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)</sup> |
| 线性递推 | 常系数关系 a_{n+p}+c_1a_{n+p-1}+...+c_p a_n = 0，只要已知前 p 项，便可逐项计算后续各项<sup>[3](https://encyclopediaofmath.org/wiki/Recursive_sequence)</sup> |
| 斐波那契示例 | a_{n+2} = a_{n+1} + a_n，取 a_0 = 0、a_1 = 1，得到 1, 1, 2, 3, 5, 8<sup>[3](https://encyclopediaofmath.org/wiki/Recursive_sequence)</sup> |
| 主定理形式 | T(n) = aT(n/b) + f(n)，通过比较 f(n) 与 n^{log_b a} 分三种情形求解<sup>[4](https://users.cs.fiu.edu/~giri/teach/5407/F07/3Notex.pdf)</sup> |
| 主定理的局限 | T(n) = 2T(n/2) + n/(log n) 符合所需形式，却不属于三种情形中的任何一种；可间接证明其界为 O(n log n)<sup>[5](https://www.cs.cornell.edu/courses/cs3110/2011sp/Recitations/rec19.htm)</sup> |
| 动态规划 | 当子问题依赖关系构成有向无环图而非树时，对分治递推的推广<sup>[6](https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/6022dc36557c5e5df2ad0a77e9463855_MIT6_006S20_r15.pdf)</sup> |

## 定义与基本示例

递推关系通过直接给出前几项、并将之后每一项定义为前面若干项的函数，来描述一个序列。最简单的例子是 T_1 = 1，且对 n ≥ 2 有 T_n = T_{n-1} + 1，它描述的序列是 1, 2, 3，依此类推。<sup>[2](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)</sup> 改变初始值会改变整个序列，这正是初始条件属于定义的一部分、而非事后补充的原因。<sup>[7](https://www.monash.edu/student-academic-success/mathematics/sequences-and-recursion/recurrence-relations)</sup>

最著名的例子是斐波那契（Fibonacci）递推 a_{n+2} = a_{n+1} + a_n，取 a_0 = 0、a_1 = 1，得到 1, 1, 2, 3, 5, 8。<sup>[3](https://encyclopediaofmath.org/wiki/Recursive_sequence)</sup> 这个序列经由比萨的列奥纳多（Leonardo of Pisa，即斐波那契）传入欧洲数学，他在 1202 年的著作《计算之书》（*Liber abaci*）中提出了兔子问题：若每个月每对兔子都产下一对新兔，而新兔从出生第二个月起开始繁殖，那么一对兔子在一年内能繁殖出多少对兔子。由此得到的序列 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...，其中每个数都是前两个数之和。<sup>[8](https://mathshistory.st-andrews.ac.uk/Biographies/Fibonacci/)</sup>

## 求解递推关系

孤立的递推关系并不是对序列很有用的描述：人们无法轻易回答诸如“第一百项是多少？”或“渐近增长率是多少？”这类问题。求解递推关系，就是找到第 n 项的闭式表达式。<sup>[2](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)</sup>

**常系数线性递推。** 域上的一个序列若满足 a_{n+p}+c_1a_{n+p-1}+...+c_p a_n = 0，其中 c_1, ..., c_p 为常数，那么只要已知前 p 项，便可逐项计算。满足此类关系的序列构成一个 p 维向量空间。相应的特征多项式为 F(X) = X^p + c_1X^{p-1} + ... + c_{p-1}X + c_p，若 α 是 F 的一个根，则序列 (α^n) 满足该递推关系。<sup>[3](https://encyclopediaofmath.org/wiki/Recursive_sequence)</sup> 生成函数为某些递推关系提供了另一种求解方法。<sup>[9](https://www.whitman.edu/mathematics/cgt_online/book/section03.04.html)</sup>

**分治递推。** 由递归算法产生的递推关系构成第二大类。归并排序的递推关系若不作简化假设，可表述为 T(n) = T(⌊n/2⌋) + T(⌈n/2⌉) + c_1 n + c_2，直接为其求出闭式解并不讨喜。<sup>[10](https://www.cs.cornell.edu/courses/cs3110/2008fa/lectures/lec19.html)</sup> 有三种标准技术适用于这一类：代入法、递归树法和主方法。<sup>[5](https://www.cs.cornell.edu/courses/cs3110/2011sp/Recitations/rec19.htm)</sup>

## 算法递推关系的求解方法

**代入法。** 代入法通过归纳法证明递推关系的渐近界，而非求出精确的闭式解。先猜出一个界，再验证递推关系被该界所约束；在处理常数时拥有更大的回旋余地，这使得它往往比完整求解容易得多。这是一种强大的方法，几乎能为所有递推关系证明上界，但并非总需要用到它的全部威力。<sup>[5](https://www.cs.cornell.edu/courses/cs3110/2011sp/Recitations/rec19.htm)</sup> 一种常见的改进是加强归纳假设，例如证明 T(n) ≤ kn − b 而非 T(n) ≤ kn，从而使归纳得以闭合。<sup>[10](https://www.cs.cornell.edu/courses/cs3110/2008fa/lectures/lec19.html)</sup>

**递归树法。** 递归树法构造递归调用的树，估算每一层的代价，再将所有层的代价相加得到总代价。<sup>[11](https://gucdoe.in/sites/default/files/INF2026_0.pdf)</sup> 在主方法的图景中，一个进行 a 次递归调用、且每次调用将问题规模缩小为原来的 1/b 的递归函数，产生的树的分支因子为 a、层数为 log_b n，因此叶子数为 a^{log_b n} = n^{log_b a}。<sup>[10](https://www.cs.cornell.edu/courses/cs3110/2008fa/lectures/lec19.html)</sup>

**主方法。** 主方法是针对 T(n) = aT(n/b) + f(n) 形式的递推关系的一种“照方抓药”式方法。它的三种情形比较 f(n) 与 n^{log_b a}：若 f(n) = Θ(n^{log_b a})，则 T(n) = Θ(n^{log_b a} log n)；若对某个 ε > 0 有 f(n) = O(n^{log_b a − ε})，则 T(n) = Θ(n^{log_b a})；若对某个 ε > 0 有 f(n) = Ω(n^{log_b a + ε})，则 T(n) = Θ(f(n))。<sup>[4](https://users.cs.fiu.edu/~giri/teach/5407/F07/3Notex.pdf)</sup> 实践中，先尝试主定理，再尝试递归树法，当需要精确常数时则使用代入法。<sup>[4](https://users.cs.fiu.edu/~giri/teach/5407/F07/3Notex.pdf)</sup>

主方法并不能求解每一个表面上符合其形式的递推关系。递推关系 T(n) = 2T(n/2) + n/(log n) 有 a = 2、b = 2、h(n) = n/(log n)，却不属于三种情形中的任何一种：n/(log n) 对任何 ε > 0 都不是 O(n^{1−ε})，不是 Θ(n)，对任何 ε > 0 也不是 Ω(n^{1+ε})。它仍可被间接地界定：由于 T(n) = 2T(n/2) + n/(log n) ≤ 2T(n/2) + n，而更大的递推关系 R(n) = 2T(n/2) + n 由主方法可知为 Θ(n log n)，故 T(n) 为 O(n log n)。由于主方法只是被间接地使用，所得结果是一个 O 界而非紧致的 Θ 界。<sup>[5](https://www.cs.cornell.edu/courses/cs3110/2011sp/Recitations/rec19.htm)</sup>

## 算法设计中的递推关系

递推关系用递归算法在较小输入上的取值来表达其运行时间，而“将大问题化为逐步变小的问题、直至到达容易处理的基准情形”这一同样的思想，既是归纳证明的基础，也是递归算法的基础；人们可以用递推关系描述算法的运行时间，再用归纳法验证其解。<sup>[2](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)</sup> 汉诺塔（Towers of Hanoi）谜题展示了这一模式：设 T_n 为求解 n 盘问题所需的最少步数，实验可得 T_1 = 1、T_2 = 3，而递归过程表明 T_3 至多为 7。<sup>[2](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)</sup>

动态规划扩展了同一框架。它将分治递推推广到子问题依赖关系构成有向无环图而非树的情形，并且常常适用于优化问题——即最大化或最小化某个标量值——或计数问题。一个递归的问题求解框架要指明：子问题的定义、用更小子问题的解表达每个子问题解的关系式、确立该关系无环的拓扑序、基准情形，以及将所有子问题上非递归工作求和的时间分析。<sup>[6](https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/6022dc36557c5e5df2ad0a77e9463855_MIT6_006S20_r15.pdf)</sup>

## 数学与计算中的递推关系

除算法分析之外，递推关系还构成了数学中很大一部分内容的结构。经典正交多项式满足形如 p_{n+1}(x) = (A_n x + B_n) p_n(x) − C_n p_{n-1}(x) 的三项递推，其中系数 A_n、B_n、C_n 因族而异。<sup>[12](https://dlmf.nist.gov/18.9)</sup> 递推关系还为特殊函数提供了一种实用的计算方法：贝塞尔函数（Bessel function）J_n(x) 与 Y_n(x) 在整数间隔阶上的值可以通过递推生成，但稳定性取决于递推方向。当 n > x 时，J_n(x) 必须对 n 作反向递推才能保持稳定，而 Y_n(x) 则必须作正向递推。<sup>[13](https://dlmf.nist.gov/10.74)</sup>

由递推关系定义的整数序列收录于整数序列在线百科全书（On-Line Encyclopedia of Integer Sequences，OEIS），截至其最近一次修改，共收录 400,158 个序列。<sup>[14](https://oeis.org/)</sup> 关于递推关系自动化处理的研究仍在继续：近期工作提出了将多项式系数线性递推方程转换为拟线性方程的算法，以及识别给定三项递推方程的经典正交多项式解的算法。<sup>[15](https://arxiv.org/abs/2404.19136)</sup><sup> • </sup><sup>[16](https://link.springer.com/article/10.1007/s40314-026-03760-y)</sup>

## References

1. [Recurrence Relation, Wolfram MathWorld](https://mathworld.wolfram.com/RecurrenceRelation.html)
2. [Mathematics for Computer Science (6.042J), course notes, MIT OpenCourseWare](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)
3. [Recursive sequence, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Recursive_sequence)
4. [The master theorem method, lecture notes, Florida International University](https://users.cs.fiu.edu/~giri/teach/5407/F07/3Notex.pdf)
5. [Using the substitution and master methods, CS 3110 recitation, Cornell University](https://www.cs.cornell.edu/courses/cs3110/2011sp/Recitations/rec19.htm)
6. [Introduction to Algorithms 6.006, Recitation 15: Dynamic Programming, MIT OpenCourseWare](https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/6022dc36557c5e5df2ad0a77e9463855_MIT6_006S20_r15.pdf)
7. [Recurrence Relations, Student Academic Success, Monash University](https://www.monash.edu/student-academic-success/mathematics/sequences-and-recursion/recurrence-relations)
8. [Leonardo Pisano Fibonacci, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Biographies/Fibonacci/)
9. [Recurrence Relations, Concrete Mathematics online text, Whitman College](https://www.whitman.edu/mathematics/cgt_online/book/section03.04.html)
10. [Lecture 19: Substitution and master methods, CS 3110, Cornell University](https://www.cs.cornell.edu/courses/cs3110/2008fa/lectures/lec19.html)
11. [Design and analysis of algorithms course material, Gautam Buddha University CDOE](https://gucdoe.in/sites/default/files/INF2026_0.pdf)
12. [DLMF §18.9: Recurrence Relations and Derivatives, NIST Digital Library of Mathematical Functions](https://dlmf.nist.gov/18.9)
13. [DLMF §10.74: Methods of Computation, NIST Digital Library of Mathematical Functions](https://dlmf.nist.gov/10.74)
14. [The On-Line Encyclopedia of Integer Sequences (OEIS)](https://oeis.org/)
15. [On Rational Recursion for Holonomic Sequences, arXiv](https://arxiv.org/abs/2404.19136)
16. [Recurrence equations and their classical continuous, discrete, and q-discrete orthogonal polynomial solutions, Computational and Applied Mathematics](https://link.springer.com/article/10.1007/s40314-026-03760-y)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; 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 › Enumerative combinatorics › Counting techniques and recurrences › Recurrence relations

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/recurrence-relation

English original: https://www.edgepedia.org/recurrence-relation
