知识卡片

普通读书笔记卡 · 3713.a.2.b

接受与判定的停机要求不同

理解等级:中级
  • 接受语言时,只要求属于语言的输入得到“是”;非成员输入可以一直运行。
  • 判定语言则要求每个输入都停机,成员输出“是”、非成员输出“否”。

因此会在否实例上死循环的接受算法不是判定算法。

这张卡片看不懂?

已有反馈 · 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

    参考来源

    - 位置:《算法导论(第4版)》第34章《NP完全性》(OEBPS/chapter034.xhtml,文本字符[25000,30000))。 - 结论依据:原文§34.1–34.2的编码、形式语言、验证定义及证明;章末练习不作已解结论。 - 原始内容: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 ( n k ) 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 ( n k ) 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