浙江大学 2005-2006 学年 秋冬 学期期末考试
《计算理论》课程试卷
考试时间:120 分钟 开课学院: 计算机学院 专业:
任课教师: 姓名: 学号:
题序 1 2 3 4 5 6 7 总分
得分 评阅人
Zhejiang University
Theory of Computation, Fall-Winter 2005 Final Exam
1. (30%) Determine whether the following statements are true or false. If it is true write a X otherwise a × in the bracket before the statement.
(a) ( ) Language {am(bc)n : m, n ∈ N} is not regular.
(b) ( ) Language {ai
b
jc
k| i, j, k ≥ 0, i ≥ j + k} is context-free.
(c) ( ) Let F = {f : f be a primitive recursive function from N to N}, then 2F (Power set of F ) is uncountable.
(d) ( ) Let L1
, L
2, · · · , L
i, · · · be all regular languages, so is ∪
∞i=1L
i.(e) ( ) Suppose language L is context-free and L0 is a regular, then L∗
L
0∗ is context-free.(f) ( ) Every computable function is primitive recursive.
(g) ( ) The complement of every recursive enumerable language is recursive enu- merable.
(h) ( ) a∗
b
∗∩ c
∗d
∗ = ∅∗.(i) ( ) Every regular language is recursively enumerable.
(j) ( ) Let L be a language and there is a Turing machine M halts on x for every
x ∈ L, then L is decidable.
2. (14%) Decide whether the following languages are regular or not and provide a formal proof for your answer.
(a) L1 = {an
b
m : m ≡ n mod 2}Theory of Computation Final Exam(Page 2 of 4) Jan. 11, 2006 (b) L2 = {w ∈ {a, b}∗ : w 6= wR
}
3. (18%)
(a) Give a Context-Free Grammar that generates the language
L
3 = {xy | x, y ∈ {a, b}∗, |x| = |y| and x and y
R differ in one position }.For example, abbbbaba, abbbbbbb ∈ L3, but aababb 6∈ L3.
(b) Design a PDA M = (K, Σ, Γ, ∆, s, F ) accepting the language L3. Solution: (a)
(b) The PDA M = (K, Σ, Γ, ∆, s, F ) is defined below:
K =
Σ = {a, b}Γ =
s = F =
(q, σ, β) (p, γ)
Theory of Computation Final Exam(Page 3 of 4) Jan. 11, 2006 4. (16%) Let the following Turing machine M computes f (x, y), the alphabet is
{0, 1, ; }. The head of M begins from the most left blank; t is the symbol of blank;
x and y are presented by binary strings respectively and separated with ;.
(a) Describe the key configurations when M started from the configuration .t10111; 111.
(b) Try to give the function f (x, y) that M can compute.
Theory of Computation Final Exam(Page 4 of 4) Jan. 11, 2006 5. (12%) Let P (x, y) be primitive recursive predicate. Prove the following predicate
∃y
≤uP (x, y), ∀u ∈ N
is also primitive recursive.6. (10%) Show that the following language
H = {“M” | M is a Turing Machine and halts on empty string}
is recursively enumerable. An informal description suffices.