Professional Documents
Culture Documents
Assignment 1
Assignment 1
Assignment 1
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 .
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 .