知识卡片
接受与判定的停机要求不同
- 接受语言时,只要求属于语言的输入得到“是”;非成员输入可以一直运行。
- 判定语言则要求每个输入都停机,成员输出“是”、非成员输出“否”。
因此会在否实例上死循环的接受算法不是判定算法。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第34章 NP完全性 · 查看原书依据
Even if language L is accepted by an algorithm A, the algorithm does not necessarily reject a string x ∉ L provided as input to it. For example, the algorithm might loop forever. A language L is decided by an algorithm A if every binary string in L is accepted by A and every binary string not in L is rejected by A. A language L is accepted in polynomial time by an algorithm A if it is accepted by A and if in addition there exists a constant k such that for any length-n string x ∈ L, algorithm A accepts x in O(nk) time. A language L is decided in polynomial time by an algorithm A if there exists a constant k such that for any length-n string x ∈ {0, 1}*, the algorithm correctly decides whether x ∈ L in O(nk) time. Thus, to accept a language, an algorithm need only produce an answer when provided a string in L, but to decide a language, it must correctly accept or reject every string in {0, 1}*. As an example, the language