# 马尔可夫算法

**马尔可夫算法**（又称**正规算法**）是一种形式化计算模型，由一个有限字母表和一个有序的字符串重写规则列表组成；每一步在当前词中查找第一条左部出现的规则，并在最左可能的出现位置应用它，当没有规则适用或某条指定的终止规则被触发时，计算结束。<sup>[1](https://cs.uni-salzburg.at/~anas/papers/psat-course/Normal-Algorithms.pdf)</sup><sup> • </sup><sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup> 该模型由苏联数学家安德烈·安德烈耶维奇·马尔可夫（Andrei Andreevich Markov，小马尔可夫）提出，是与递归函数和图灵机并列的、对算法直觉概念的精确刻画之一。<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 一种带有序规则列表的字符串重写系统；每一步在最左可能位置应用第一条适用规则<sup>[1](https://cs.uni-salzburg.at/~anas/papers/psat-course/Normal-Algorithms.pdf)</sup> |
| 起源 | 马尔可夫于1947年在研究结合系统的恒等问题时提出这一概念<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup> |
| 发表 | 1951年首次以俄文描述；1954年专著《算法理论》中给出详细理论；英文论述见马尔可夫与纳戈尔内（Markov and Nagorny，Kluwer，1988）<sup>[3](https://www.cs.utexas.edu/~ear/cs341/automatabook/AutomataTheoryBook.pdf)</sup><sup> • </sup><sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup> |
| 终止 | 当无规则可应用（阻塞）或某条标记的终止（结论性）规则被应用时，过程停止<sup>[4](https://www.dcs.ed.ac.uk/home/tl/prop/node9.html)</sup> |
| 计算能力 | 等价于图灵机；规范化原则等价于丘奇论题<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup> |
| 不可判定性结果 | 马尔可夫证明了正规算法理论中某些批量问题不可判定，由此可推出代数中多种批量问题的不可判定性<sup>[5](https://www.mathnet.ru/php/getFT.phtml?jrnid=rm&paperid=6215&what=fullteng)</sup> |

## 定义与运作

每个正规算法都在一个固定字母表中运作，完全由它的方案决定——方案是一个有序的有限替换公式列表，每个公式是字母表中有序的词对 (U, V)。终止公式习惯上写作 U →· V，普通（非终止）公式写作 U → V。<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup>

从输入词 P 出发，算法构造一个词序列。若当前词中不出现任何公式的左部，则过程完成，当前词即为结果。否则，选取方案中左部出现在该词中的第一条公式，用其右部替换其左部的第一次（最左）出现。若该公式是终止公式，过程停止；否则以新词继续。<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup> 当过程终止时，称算法对该输入适用，最后一个词就是结果，记作 𝔄(P) = Q。<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup>

正是这两条排序约定使模型具有确定性。规则优先级解决了多条规则匹配时使用哪一条的问题，最左出现约定解决了在何处应用的问题。正如某课程讲义所概括的步骤：算法按顺序搜索规则集，应用第一条匹配的规则，每次重写后回到第一条规则重新开始。<sup>[4](https://www.dcs.ed.ac.uk/home/tl/prop/node9.html)</sup> 有些表述将阻塞（无规则可用）视为唯一的终止条件，不设显式终止规则。<sup>[4](https://www.dcs.ed.ac.uk/home/tl/prop/node9.html)</sup>

## 历史起源

马尔可夫于1947年在研究结合系统的恒等问题过程中提出了这一概念。<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup> 他在这方面的首批论文完成于1946年、发表于1947年，构造了具有不可判定字问题与不可判定单侧整除问题的结合系统实例。<sup>[5](https://www.mathnet.ru/php/getFT.phtml?jrnid=rm&paperid=6215&what=fullteng)</sup> 该模型于1951年的一篇出版物中首次以俄文描述，详细定义与一般理论见其专著《算法理论》（Trudy Mat. Inst. Steklov. 42, 1954；英译由 Israel Program for Scientific Translations 于1961年出版）。<sup>[3](https://www.cs.utexas.edu/~ear/cs341/automatabook/AutomataTheoryBook.pdf)</sup><sup> • </sup><sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup> 后来的英文论述是马尔可夫与纳戈尔内的《算法理论》（Kluwer，1988）。<sup>[3](https://www.cs.utexas.edu/~ear/cs341/automatabook/AutomataTheoryBook.pdf)</sup><sup> • </sup><sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup>

这项工作属于马尔可夫在1940年代末向构造性数学的更大转向的一部分；他摒弃纯粹的存在性定理，要求存在性断言必须有构造方法作为支撑。<sup>[5](https://www.mathnet.ru/php/getFT.phtml?jrnid=rm&paperid=6215&what=fullteng)</sup>

## 在计算模型中的地位

正规算法、递归函数和图灵机同被列为对算法一般直觉概念最合适的精确刻画。<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup> 可计算性理论的讲义将马尔可夫算法与λ演算、波斯特算法、波斯特典范系统、无限制文法、部分递归函数并列为可计算性概念，它们都通过模拟证明被证明等价于图灵机。<sup>[6](https://web.cecs.pdx.edu/~sheard/course/CS311/Spring2011/notes/OtherTuringComputAlg.pdf)</sup> 斯坦福哲学百科全书援引图灵、丘奇、波斯特、马尔可夫等人分析的趋同性——每一种都可证明刻画出同一类图灵可计算函数——作为丘奇-图灵论题的等价性论证。<sup>[7](https://seop.lovelace.illc.uva.nl/entries/church-turing/index.html)</sup>

在理论内部，这种等价性采取规范化原则的形式：对于任何字母表中的任一算法，都能构造出该字母表上的一个正规算法，把每个词变换为相同的结果。这一原则等价于丘奇论题，即部分递归函数充分形式化了可计算算术函数的直觉概念。<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup>

马尔可夫还建立了一套详尽的工具，用于从具有指定性质的给定算法构造新算法，并证明了正规算法理论中某些批量问题的不可判定性——这是通向代数中批量问题不可判定性结果的一条途径。<sup>[5](https://www.mathnet.ru/php/getFT.phtml?jrnid=rm&paperid=6215&what=fullteng)</sup>

## 应用与扩展

正规算法起源于代数问题，并在需要对天然以字母表中的词而非数表示的对象建立精确算法概念的任何场合——如构造性分析——被证明是便利的工作工具。<sup>[2](https://encyclopediaofmath.org/wiki/Normal_algorithm)</sup> 在符号计算中，它们被用于具有交换生成元和逆生成元的结构中的路径规范化：给定交换方向列表，马尔可夫规范化算法可由规范自动生成，它找出相对于字母表上某个序的最小路径，这一概念恰与测地线的概念相合。<sup>[4](https://www.dcs.ed.ac.uk/home/tl/prop/node9.html)</sup> 晚近，该模型被用于教学与实验，通过简单的重写规则生成迷宫、落沙模拟和其他元胞自动机。<sup>[8](https://wljs.io/blog/markov)</sup>

这一简单概念在描述编程语言时显得过于僵硬——在编程语言中，语法范畴和抽象语法比具体字符串更便于操作。阿方索·卡拉乔洛·迪福里诺（Alfonso Caracciolo di Forino）在与编程语言形式描述相关的工作中发展了广义马尔可夫算法以解决这一问题。<sup>[9](https://doi.org/10.1145/3770758)</sup> 马尔可夫本人后来将算法的复杂性定义为唯一确定正规算法方案的那个词中的字母数，从而开创了算法计算复杂性这一研究方向。<sup>[10](https://www.mathnet.ru/links/49a9a2f62665104df967d774337cdd97/rm4466_eng.pdf)</sup>

## References

1. [Normal Algorithms, course notes, University of Salzburg](https://cs.uni-salzburg.at/~anas/papers/psat-course/Normal-Algorithms.pdf)
2. [Normal algorithm, Encyclopedia of Mathematics (N.M. Nagornyi, originator)](https://encyclopediaofmath.org/wiki/Normal_algorithm)
3. [Automata Theory and Applications, Chapter 23 notes, University of Texas](https://www.cs.utexas.edu/~ear/cs341/automatabook/AutomataTheoryBook.pdf)
4. [Normalisation using Markov algorithms, Timothy Lewis, University of Edinburgh](https://www.dcs.ed.ac.uk/home/tl/prop/node9.html)
5. [N.M. Nagornyi and N.A. Shanin, "Andrei Andreevich Markov" (on his 60th birthday), Russian Mathematical Surveys](https://www.mathnet.ru/php/getFT.phtml?jrnid=rm&paperid=6215&what=fullteng)
6. [Other Notions of Computability, CS 311 course notes, Portland State University](https://web.cecs.pdx.edu/~sheard/course/CS311/Spring2011/notes/OtherTuringComputAlg.pdf)
7. [The Church-Turing Thesis, Stanford Encyclopedia of Philosophy](https://seop.lovelace.illc.uva.nl/entries/church-turing/index.html)
8. [Markov Algorithms, Mazes, Desert with Sand and Pattern Matching, WLJS Notebook blog](https://wljs.io/blog/markov)
9. [Alfonso Caracciolo di Forino and Generalized Markov Algorithms, Formal Aspects of Computing](https://doi.org/10.1145/3770758)
10. [N.M. Nagornyi and N.A. Shanin, "Andrei Andreevich Markov" (172), Russian Mathematical Surveys](https://www.mathnet.ru/links/49a9a2f62665104df967d774337cdd97/rm4466_eng.pdf)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Formal languages and automata theory › Grammar formalisms and generating systems

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/markov-algorithm

English original: https://www.edgepedia.org/markov-algorithm
