polynomial time 图灵机 多项式时间

 

图灵的基本思想

图灵的基本思想是用机器来模拟人们用纸笔进行数学运算的过程,他把这样的过程看作下列两种简单的动作:

  • 在纸上写上或擦除某个符号;
  • 把注意力从纸的一处移动到另一处;

而在每个阶段,人要决定下一步的动作,依赖于(a)此人当前所关注的纸上某个位置的符号和(b)此人当前思维的状态。

 

可计算性理论,如果一系列操作数据的规则(如指令集编程语言细胞自动机)可以用来模拟任何图灵机,那么它是图灵完备的。这意味着这个系统也可以识别其他数据处理规则集,图灵完备性被用作表达这种数据处理规则集的一种属性。如今,几乎所有编程语言都是具有图灵完备性的。这个词以引入图灵机概念的数学家艾伦·图灵命名。

还有一个相关概念是图灵等价 – 如果P可以模拟Q并且Q可以模拟P,则两台计算机P和Q称为等效计算机。 邱奇-图灵论题认为任何可以通过算法计算其值的函数都可以由图灵机计算,因此,如果任何真实世界的计算机都可以模拟图灵机,则其对图灵机是图灵等价的。 通用图灵机可用于模拟任何图灵机,且可以扩展现实世界计算机的计算方面。[NB 1]

 

https://zh.wikipedia.org/zh-cn/Coq

Coq 是一个交互式的定理证明辅助工具。它允许用户输入包含数学断言的表达式、机械化地对这些断言执行检查、帮助构造形式化的证明、并从其形式化描述的构造性证明中提取出可验证的(certified)程序。Coq 的理论基础是归纳构造演算(calculus of inductive constructions)、一种构造演算(calculus of constructions)的衍生理论。Coq 并非一个自动化定理机器证明语言;然而,它提供了自动化定理证明的策略(tactics)和不同的决策过程。

Coq 同时还是一个依赖类型函数式编程语言[3]。它由法国PPS实验室的PI.R2团队研究开发[4],该团队由INRIA巴黎综合理工学院巴黎第十一大学巴黎第七大学法国国家科学研究中心组成。此前里昂高等师范学校亦曾参与开发。Coq 项目当前由 Gérard HuetChristine Paulin-Mohring 和 Hugo Herbelin领导。Coq 使用 OCaml 以及少部分 C 实现。

单词 coq 在法语中意为“公鸡”,此命名体现了法国在研究活动中使用动物名称命名工具的传统。[5] 最初,它被简单地称作 Coc,意即构造演算(calculus of constructions)的缩写,同时也暗含了 Thierry Coquand(与 Gérard Huet 共同提出了前述的构造演算)的姓氏。

Coq 自身提供了一套规范语言 Gallina[6] (gallina 在西班牙语中意为“母鸡”)。使用 Gallina 书写的程序具有规范化性质——它们总是会终止。此性质使之避开了停机问题 [7]。同时,这也使得 Coq 语言本身并非图灵完全

应用

 

 

 

https://en.wikipedia.org/wiki/Time_complexity#Polynomial_time

 

An algorithm is said to be of polynomial time if its running time is upper bounded by a polynomial expression in the size of the input for the algorithm, i.e., T(n) = O(nk) for some constant k.[1][8] Problems for which a deterministic polynomial time algorithm exists belong to the complexity class P, which is central in the field of computational complexity theoryCobham's thesis states that polynomial time is a synonym for "tractable", "feasible", "efficient", or "fast".[9]

Some examples of polynomial time algorithms:

  • The selection sort sorting algorithm on n integers performs {\displaystyle An^{2}}An^{2} operations for some constant A. Thus it runs in time {\displaystyle O(n^{2})}O(n^{2}) and is a polynomial time algorithm.
  • All the basic arithmetic operations (addition, subtraction, multiplication, division, and comparison) can be done in polynomial time.
  • Maximum matchings in graphs can be found in polynomial time.

 

Complexity classes[edit]

The concept of polynomial time leads to several complexity classes in computational complexity theory. Some important classes defined using polynomial time are the following.

  • P: The complexity class of decision problems that can be solved on a deterministic Turing machine in polynomial time.
  • NP: The complexity class of decision problems that can be solved on a non-deterministic Turing machine in polynomial time.
  • ZPP: The complexity class of decision problems that can be solved with zero error on a probabilistic Turing machine in polynomial time.
  • RP: The complexity class of decision problems that can be solved with 1-sided error on a probabilistic Turing machine in polynomial time.
  • BPP: The complexity class of decision problems that can be solved with 2-sided error on a probabilistic Turing machine in polynomial time.
  • BQP: The complexity class of decision problems that can be solved with 2-sided error on a quantum Turing machine in polynomial time.

P is the smallest time-complexity class on a deterministic machine which is robust in terms of machine model changes. (For example, a change from a single-tape Turing machine to a multi-tape machine can lead to a quadratic speedup, but any algorithm that runs in polynomial time under one model also does so on the other.) Any given abstract machinewill have a complexity class corresponding to the problems which can be solved in polynomial time on that machine.

 

 

复杂度类[编辑]

多项式时间的概念出发,在计算复杂度理论中可以得到一些复杂度类。以下是一些重要的例子。

  • P:包含可以使用确定型图灵机在多项式时间内解决的决定性问题
  • NP:包含可以使用非确定型图灵机在多项式时间内解决的决定性问题。
  • ZPP:包含可以使用概率图灵机在多项式时间内零错误解决的决定性问题。
  • RP:包含可以使用概率图灵机在多项式时间内解决的决定性问题,但它给出的两种答案中(是或否)只有一种答案是一定正确的,另一种则有几率不正确。
  • BPP:包含可以使用概率图灵机在多项式时间内解决的决定性问题,它给出的答案有错误的概率在某个小于0.5的常数之内。
  • BQP:包含可以使用量子图灵机在多项式时间内解决的决定性问题,它给出的答案有错误的概率在某个小于0.5的常数之内。

在机器模型可变的情况下,P在确定性机器上是最小的时间复杂度类。例如,将单带图灵机换成多带图灵机可以使算法运行速度以二次阶提升,但所有具有多项式时间的算法依然会以多项式时间运行。一种特定的抽象机器会有自己特定的复杂度类分类。

 

 

图灵机英语:Turing machine),又称确定型图灵机,是英国数学家艾伦·图灵于1936年提出的一种抽象计算模型,其更抽象的意义为一种数学逻辑机,可以看作等价于任何有限逻辑数学过程的终极强大逻辑机器。

非确定型图灵机确定型图灵机的不同之处在于,在计算的每一时刻,根据当前状态和读写头所读的符号,机器存在多种状态转移方案,机器将任意地选择其中一种方案继续运作,直到最后停机为止。具体而言,其状态转移函数为 

 

计算复杂性理论内,概率图灵机是一个非决定型图灵机,在每个转折点根据某种概率分布随机选择某种可行的转变(transition)。

 

 

要理解这几个概念,首先要明白几件事:

  1. 对于NP问题是否存在确定的多项式时间的解,目前还不清楚(即有可能有一天可以证明NP问题=P问题,但目前还证明不出来、也不能证明NP问题≠P问题,目前的结论只是NP问题集P问题集
  2. 问题之间可以规约,即如果某个NP问题存在确定的多项式时间解,那么另一个NP问题也存在确定的多项式时间解。这个过程是可以证明的、并且已经被证明。
  • NP困难问题(NP-hard problems)
是指这样的一类问题,它们本身的复杂度是多少无所谓(但由后面的论述可知至少是NP),但是只要这个问题找到确定的多项式时间的解,那么我们可以证明出所有的NP问题都一定存在确定的多项式时间的解。(简单叙述一下就是,只要有一个NP困难问题找到P解,那么所有NP问题都是P问题)
  • NP完全问题(NP-complete problems)
如果一个问题既是NP困难问题又是NP问题,我们称之为NP完全问题。
posted @ 2017-09-26 14:04  papering  阅读(717)  评论(0编辑  收藏  举报