Assignment 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

CSO 322 Theory of Computation Even Semester 2021

Assignment 1
Due: Saturday 06 February.
When answering questions on this assignment (or any other assignment or exam in this course),
you are free to make use of facts that were stated in the lecture.
1. [6 points] The following problems each have a short answer, perhaps just a few sentences and
maybe an equation or two. Try to make your answers clear and to the point—and choose the
simplest answer whenever possible.

(a) Prove that there are countably many finite languages over any alphabet Σ.
(b) Let M = ( Q, Σ, δ, q0 , F ) be a DFA and let q ∈ Q be a state of M. Give a precise, formal
description of a DFA K that recognizes the language
{w ∈ Σ∗ : when M is run on input w, the state q is never visited}.
(c) For any alphabet Σ and any language A ⊆ Σ∗ , define the language Prefix( A) ⊆ Σ∗ as
follows:
Prefix( A) = x ∈ Σ∗ : there exists v ∈ Σ∗ such that xv ∈ A .


Give an example of a nonregular language A for which Prefix( A) is regular.

2. [6 points] Let Σ and Γ be disjoint alphabets. For every string w ∈ (Σ ∪ Γ)∗ , define π (w) ∈ Σ∗
to be the string obtained by removing from w every symbol in the alphabet Γ.

(a) Suppose that A ⊆ (Σ ∪ Γ)∗ is a regular language. Prove that the language
B = {π (w) : w ∈ A}
is regular.
(b) Suppose that C ⊆ Σ∗ is a regular language. Prove that the language
D = {w ∈ (Σ ∪ Γ)∗ : π (w) ∈ C }
is regular.

3. [6 points] Assume that Σ is an alphabet and A ⊆ Σ∗ is a regular language. Prove that the
language
B = {uvR : u, v ∈ Σ∗ and uv ∈ A}
is regular. (Here, vR denotes the reverse of the string v, as defined in Lecture 5.)
4. [6 points] Define a language A ⊆ {0}∗ as follows:
A = 0rs : r, s ∈ N, r, s ≥ 3 .


Prove that A is nonregular.


Hint: try using a combination of the pumping lemma and closure properties of the regular
languages. It may also be helpful to use the fact that there exist infinitely many prime numbers,
which you do not need to prove as part of your solution.
5. [1 point] For each of the questions above, list the full name of each of your 120 classmates with
whom you worked on that question. (If you didn’t work with anyone, that is fine: just indicate
that you worked alone.)

You might also like