Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Spring, 2013 CIS 511 Introduction to the Theory of ..., Study notes of Theory of Computation

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

2022/2023

Uploaded on 05/11/2023

oliver97
oliver97 🇺🇸

4.4

(43)

324 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Spring, 2013 CIS 511
Introduction to the Theory of Computation
Jean Gallier
Final Exam
April 29, 2013
Note that this is a closed-book exam
Read all the questions before starting solving any of them!
Problem 1 (10 pts). Given an alphabet Σ, sketch an algorithm to decide whether
RS= Σ,
for any two regular expressions Rand Sover Σ.
Problem 2 (20 pts). Let Σ be an alphabet. Recall that a binary relation, , on Σ, is
left invariant iff uvimplies that wu wv for all wΣand right invariant iff uv
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
uu0and vv0, then uv u0v0(You do not have to prove this).
Given any regular language, L, over Σlet
L1/4={wΣ|wcwdwcw L},
where c, d Σ are some given letters. Prove that L1/4is also regular.
Problem 3 (25 pts).
Consider the language (over Σ = {a, b})
L1={w {a, b}|#(a) = #(b)}
consisting of all strings having an equal number of a’s and b’s and the language
L0
1={w {a, b}|#(b)>#(a)}
consisting of all strings having strictly more b’s than a’s.
(1) Prove that every nonempty string wL1is of the form
(1) w=aub, where uL1(u=is allowed);
1
pf2

Partial preview of the text

Download Spring, 2013 CIS 511 Introduction to the Theory of ... and more Study notes Theory of Computation in PDF only on Docsity!

Spring, 2013 CIS 511

Introduction to the Theory of Computation

Jean Gallier

Final Exam

April 29, 2013

Note that this is a closed-book exam

Read all the questions before starting solving any of them!

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})?