Docsity

Turing Machine -Computability and Complexity - Exams, Exams of Advanced Algorithms

Toggle sidebar
bg1
CS 172, Fall 1999
Midterm
Professor M. Jordan
Problem #1
Closure properties of languages associated with Turing machines.
(a) Prove that the union of two Turing-recognizable languages is Turing recognizable.
(b) Prove that the union of two decidable languages is decidable.
Problem #2
Show that the class of context-free languages is closed under *. (Hint: It is probably easiest to do this with a
grammer, where a fairly simple construction suffices, but it is doable with PDA's if you prefer).
Problem #3
(a) Draw an NFA that recognizes the languages:
A = {w element of {a,b,c}* | w contains at least two b's or at least one c}.
(b) Give a regular expression that describes this language.
Problem #4
Design a PDA for
L = {(0^i)(1^j) | i does not equal j and i, j >= 0}.
A high-level English description will get yo partial credit, and a diagram will receive full credit.
Problem #5
Let sigma = {0,1,...,9}. Let
L = { | M is a DFA and M does not accept any string containing 555 as a substring}.
Show that L is decidable. (Hint: Use the fact that it is possible to contruct a DFA that recognizes the regular
language sigma*555sigma*. Also use the fact that regular languages are closed under intersection.).
Problem #6
Let A and B be Turing-reconizable languages. Let (A intersection B) and (A union B) be decidable. Show
that A and B are decidable. (Hint: Use a Venn diagram and analyze the decidability of various regions of the
diagram).
Problem #7
Consider the problem of testing whether a two-tape Turing machine ever writes a nonblank symbol on its
second tape. Formulate this problem as a language. Show that this language is undecidable. (Hint: Use a
reduction from (A)tm. The basic idea is to contruct a two-tape machine that simulates a Turing machine M on
string w.).
CS 172, Midterm, Fall 1999
CS 172, Fall 1999 Midterm Professor M. Jordan 1
pf2

Partial preview of the text

Download Turing Machine -Computability and Complexity - Exams and more Exams Advanced Algorithms in PDF only on Docsity!

CS 172, Fall 1999

Midterm

Professor M. Jordan

Problem

Closure properties of languages associated with Turing machines. (a) Prove that the union of two Turing-recognizable languages is Turing recognizable. (b) Prove that the union of two decidable languages is decidable.

Problem

Show that the class of context-free languages is closed under *. ( Hint : It is probably easiest to do this with a grammer, where a fairly simple construction suffices, but it is doable with PDA's if you prefer).

Problem

(a) Draw an NFA that recognizes the languages: A = {w element of {a,b,c}* | w contains at least two b's or at least one c}. (b) Give a regular expression that describes this language.

Problem

Design a PDA for L = {(0^i)(1^j) | i does not equal j and i, j >= 0}. A high-level English description will get yo partial credit, and a diagram will receive full credit.

Problem

Let sigma = {0,1,...,9}. Let L = { | M is a DFA and M does not accept any string containing 555 as a substring}. Show that L is decidable. ( Hint : Use the fact that it is possible to contruct a DFA that recognizes the regular language sigma555sigma. Also use the fact that regular languages are closed under intersection.).

Problem

Let A and B be Turing-reconizable languages. Let (A intersection B) and (A union B) be decidable. Show that A and B are decidable. ( Hint : Use a Venn diagram and analyze the decidability of various regions of the diagram).

Problem

Consider the problem of testing whether a two-tape Turing machine ever writes a nonblank symbol on its second tape. Formulate this problem as a language. Show that this language is undecidable. ( Hint : Use a reduction from (A)tm. The basic idea is to contruct a two-tape machine that simulates a Turing machine M on string w.).

CS 172, Midterm, Fall 1999

CS 172, Fall 1999 Midterm Professor M. Jordan 1

Posted by HKN (Electrical Engineering and Computer Science Honor Society)

University of California at Berkeley

If you have any questions about these online exams

please contact [email protected].

CS 172, Midterm, Fall 1999

Problem #7 2