for run M on w for |w| steps
进行情形的翻转Operator | Regular | Context-free | recursive | recursively enumerable |
---|---|---|---|---|
√ | √ | √ | √ | |
√ | × | √ | √ | |
√ | × | √ | × | |
√ | √ | √ | √ | |
√ | √ | √ | √ |
Problem
Consider the following DFA. What sequence of configurations does the machine go through on input
Solution
Problem
将以下的 NFA 转化为 RL
Solution
Problem
Convert the following NFA to an equivalent DFA. Give only the portion of the DFA that is reachable from the initial state.
Answer
简单的 画出有限自动机即可;复杂的 构造
Problem1
The set of all binary strings that end with 00.
Solution1
Problem2
Let
Solution2
Contruct a new FA
(需要为接收到 # 的非法情况建立新的状态
Problem
Construct a NFA that accepts
Solution
Problem1
Solution1
Pumping Theorem.
假设 Pumping length 为 p,构造
因为 (2) |y|>0 (3) |xy≤p|,所以
则
Problem2
Solution2
注意
正确。
Problem1
Construct a context-free grammar that generatesthe following language.
Solution1
Problem2
令
Solution2
Problem
Construct a pushdown automaton that accepts the following language.
Solution
The list of
Problem
Consider the following context-free grammar.
Show two distinct parse trees with root
Solution
Problem
Solution
图灵机之间状态转移时可能会出现不合法的情况
p.s. You can assume the start configuration of the Turing machine is
Problem
Let
Solution
根据定义,
对于
M = on input
则
flowchart LR subgraph recursive function = μ-recursive function p[primitive recursive function] end
正确。
构造 f("
构造 f("
已知 A = { "
(1) Show that
Constrcut
for i = 1, 2, 3, ...
// 将满足 even number of b's 的字符串按字典序枚举
for s = s1, s2, s3, ..., si
run M on s for i steps
if M halts on s within i steps
halt
(2) Show that
答:使用 Rice's Theorem
构造 f("M""w") = on input
step1 run
step2 run
当
当
所以
(1) The language
首先,
Constrcut
= on input " " for i = 1, 2, 3, ... count = 0 for s = s1, s2, s3, ..., si run M on s for i steps if M halts on s within i steps count = count + 1 if count >= 2023 halts
其次,
Contruct f("M""w") = on input v
step1 runon
step2 runon which accepts everything
当
当
所以
(2) The language
Contruct f("M""w") = on input v
ifthen halt// 是事先规定好的 2018 个串
else run M on w
当
当
(3) The language
若
V = { S, S', T, A, B, a, b },
S → TS'
S' → AaS' | BbS' | e
aA → Aa
aB → Ba
bA → Ab
bB → Bb
TA → aT
TB → bT
T → e
Since
and
令
所以
所以
Problem1
Prove that every language is countable.
Solution1
Problem2
Prove that there is an undecidable subset of
Solution2
Problem3
Prove that the set of undecidable languages is uncountable.
Solution3
Problem4
Prove that countable does not imply Turing enumerable(recursively enumerable)
Solution4