

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
CIS 511. Introduction to the Theory of Computation. Jean Gallier. Final Exam. April 29, 2013. Note that this is a closed-book exam.
Typology: Study notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!
Problem 1 (10 pts). Given an alphabet Σ, sketch an algorithm to decide whether
R∗S∗^ = Σ∗,
for any two regular expressions R and S over Σ. Problem 2 (20 pts). Let Σ be an alphabet. Recall that a binary relation, ∼, on Σ∗, is left invariant iff u ∼ v implies that wu ∼ wv for all w ∈ Σ∗^ and right invariant iff u ∼ v implies that uw ∼ vw for all w ∈ Σ∗. An equivalence relation on Σ∗^ that is both left and right-invariant is called a congruence. Recall that a congruence satisfies the property: If u ∼ u′^ and v ∼ v′, then uv ∼ u′v′^ (You do not have to prove this). Given any regular language, L, over Σ∗^ let L^1 /^4 = {w ∈ Σ∗^ | wcwdwcw ∈ L},
where c, d ∈ Σ are some given letters. Prove that L^1 /^4 is also regular. Problem 3 (25 pts). Consider the language (over Σ = {a, b}) L 1 = {w ∈ {a, b}∗^ | #(a) = #(b)}
consisting of all strings having an equal number of a’s and b’s and the language
L′ 1 = {w ∈ {a, b}∗^ | #(b) > #(a)}
consisting of all strings having strictly more b’s than a’s. (1) Prove that every nonempty string w ∈ L 1 is of the form (1) w = aub, where u ∈ L 1 (u = is allowed); 1
(2) w = bua, where u ∈ L 1 (u = is allowed); (3) w = uv, where u, v ∈ L 1 , with u, v 6 = .
and that every nonempty string w ∈ L′ 1 is of the form
(1) w = bu, where u ∈ L 1 ∪ L′ 1 (u = is allowed); (2) w = uv, where u ∈ L 1 and v ∈ L′ 1 , with u 6 = . (2) Using the above, give a context-free grammar for L′ 1. Problem 4 (25 pts). Prove that the following languages are not context-free:
L 1 = {u 1 #v 1 #u 2 #v 2 | |u 1 | = |u 2 |, |v 1 | = |v 2 |, u 1 , u 2 , v 1 , v 2 ∈ {a, b, c, d}+}, L 2 = {an^2 | n ≥ 1 }.
Hint. To prove L 1 non context-free, you may want to consider the intersection of L 1 with a well chosen regular language. Problem 5 (15 pts). Let {ϕi} be an acceptable indexing of the partial recursive functions (over N). (1) Prove that the following sets are not recursive: A = {i ∈ N | ϕi(0) = ϕa(0) and ϕi(0), ϕa(0) are both defined} B = {i ∈ N | ϕi(0) = ϕa(0) and ϕi(1) = ϕa(1)}, C = {〈i, j〉 ∈ N | ϕi(0) = ϕj (0) and ϕi(1) = ϕj (1)},
for some given partial recursive function, ϕa. (2) Prove that A is recursively enumerable. Problem 6 (25 pts). (i) Given any context-free language, L ⊆ {a, b}∗, is the following problem decidable: L ⊆ a∗b∗a∗b∗? (ii) If R ⊆ {a}∗^ is a regular language and L ⊆ Σ∗^ is any context-free language, with a ∈ Σ, is it decidable whether R ⊆ L? What if R is any regular language (not necessarily over the alphabet {a})?