形式语言与自动机-期末考试试卷[1]
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
7. (5 分) Prove that the following language are not regular { 1n | n
2
班
年级
学号
姓名
共 5 页 第 3 页 A
二、Context-Free Languages(30 分) 9. (5 分) Given the following CFG
4. (5 分) Convert the following NFA to an equivalent DFA (1) Please write out the formal 5-tuple definition of M1. (2) What is the language of M1, i.e., L(M1)?
班
年级
学号
姓名
共 5 页 第 4 页 A
13. (10 分) Convert the following CFG into an equivalent CFG in Chomsky normal form
12. (5 分) Give the state diagram of a PDA that recognizes the following language {w | w
0}
Give the parse tree and the leftmost derivation for the string (a+a) a
8. (5 分) Prove that the following language are not regular {wtw | w,t {0,1}+}
10. (5 分) Given the following CFG
(考试时间:2014 年 6 月 12 日)
题号 得分 一、Regular Languages(50 分) 1. (5 分) Given the following state diagram of a DFA M1 一 二 三 四 成绩 核分人签字
(Note that you cannot give a DFA.)
2. (5 分) Give the state diagram of a DFA recognizing the following language {w | w has an odd number of a’s and ends with a b}
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术
班
年级
学号
四、Proofs(10 分)
姓名
共 5 页 第 5 页 A
15. *(10 分) For any string w w1w2 reverse order wn regular, AR is also regular.
wn, the reverse of w, written wR , is the string w in
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术 班 年级 学号 姓名 共 5 页 第 1 页 A
2013~2014 学年第 2 学期期末考试试卷 《形式语言与自动机》 (A 卷 共 5 页)
3. (5 分) Give the state diagram of an NFA with five states recognizing the following language {w | w contains the substring 0101 (i.e., w = x0101y for some x and y)}
5. (10 分) Convert the following regular expression to an NFA
班
年级
学号
来自百度文库
姓名
共 5 页 第 2 页 A
6. (10 分) Convert the following DFA to a regular expression
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术
Give the language generated by the above CFG.
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术
11. (5 分) Give a CFG that generate the following language {w | the length of w is odd}
w2w1. For any language A, let AR {wR | w A} . Prove that if A is
Give a run of this machine on input string 10#10 by writing out a sequence of configurations. The first configuration in the sequence is the start configuration q110#10, and the last configuration in the sequence is the accepting configuration xx #xx qaccept. Please write out the remaining configurations in the sequence. ⑴ q110#10 ⑵ __________ ⑶ ___________ ⑷ ___________ ⑸ ___________ ⑹ ___________ ⑺ ___________ ⑻ ___________ ⑼ ___________ ⑽ ___________ ⑾ ___________ ⑿ ___________ ⒀ ___________ ⒁ ___________ ⒂ ___________ ⒃ ___________ ⒄ ___________ ⒅ ___________ ⒆ xx#xx qaccept
wR , that is, w is a palindrome}
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术
三、The Church-Turing Thesis(10 分) 14. (10 分) Given the state diagram of Turing machine that recognizes the language {w#w | w {0,1}*}
2
班
年级
学号
姓名
共 5 页 第 3 页 A
二、Context-Free Languages(30 分) 9. (5 分) Given the following CFG
4. (5 分) Convert the following NFA to an equivalent DFA (1) Please write out the formal 5-tuple definition of M1. (2) What is the language of M1, i.e., L(M1)?
班
年级
学号
姓名
共 5 页 第 4 页 A
13. (10 分) Convert the following CFG into an equivalent CFG in Chomsky normal form
12. (5 分) Give the state diagram of a PDA that recognizes the following language {w | w
0}
Give the parse tree and the leftmost derivation for the string (a+a) a
8. (5 分) Prove that the following language are not regular {wtw | w,t {0,1}+}
10. (5 分) Given the following CFG
(考试时间:2014 年 6 月 12 日)
题号 得分 一、Regular Languages(50 分) 1. (5 分) Given the following state diagram of a DFA M1 一 二 三 四 成绩 核分人签字
(Note that you cannot give a DFA.)
2. (5 分) Give the state diagram of a DFA recognizing the following language {w | w has an odd number of a’s and ends with a b}
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术
班
年级
学号
四、Proofs(10 分)
姓名
共 5 页 第 5 页 A
15. *(10 分) For any string w w1w2 reverse order wn regular, AR is also regular.
wn, the reverse of w, written wR , is the string w in
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术 班 年级 学号 姓名 共 5 页 第 1 页 A
2013~2014 学年第 2 学期期末考试试卷 《形式语言与自动机》 (A 卷 共 5 页)
3. (5 分) Give the state diagram of an NFA with five states recognizing the following language {w | w contains the substring 0101 (i.e., w = x0101y for some x and y)}
5. (10 分) Convert the following regular expression to an NFA
班
年级
学号
来自百度文库
姓名
共 5 页 第 2 页 A
6. (10 分) Convert the following DFA to a regular expression
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术
Give the language generated by the above CFG.
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术
11. (5 分) Give a CFG that generate the following language {w | the length of w is odd}
w2w1. For any language A, let AR {wR | w A} . Prove that if A is
Give a run of this machine on input string 10#10 by writing out a sequence of configurations. The first configuration in the sequence is the start configuration q110#10, and the last configuration in the sequence is the accepting configuration xx #xx qaccept. Please write out the remaining configurations in the sequence. ⑴ q110#10 ⑵ __________ ⑶ ___________ ⑷ ___________ ⑸ ___________ ⑹ ___________ ⑺ ___________ ⑻ ___________ ⑼ ___________ ⑽ ___________ ⑾ ___________ ⑿ ___________ ⒀ ___________ ⒁ ___________ ⒂ ___________ ⒃ ___________ ⒄ ___________ ⒅ ___________ ⒆ xx#xx qaccept
wR , that is, w is a palindrome}
天津大学试卷专用纸 学院计算机科学与技术专业计算机科学与技术
三、The Church-Turing Thesis(10 分) 14. (10 分) Given the state diagram of Turing machine that recognizes the language {w#w | w {0,1}*}