Nathan Brunelle
CS3102, Theory of Computation, Midterm Key
1) PS2 number 2
Can a countable set of parabolas completely cover the unit square?
Consider just one side of the unit square. If one cannot cover a side of the
unit square using a countable number of parabolas then certainly the entire
unit square cannot be covered as the side is a subset of the whole square. Now
consider a particular parabola. A parabola can cover no more than 2 points
on a given line segment, so the cardinality of the set of points which cover
the line segment is finite. We know that the countable union of countable
sets is countable (PS1). There are an uncountable number of points on a
side of the unit square, thus a countable set of parabolas is unable to cover
one side of the perimeter square and therefore cannot cover the entire unit
square.
2) PS2 number 8
a
Are the regular languages closed under countable union?
No
Consider the union of singleton languages {ε} ∪ {01} ∪ {0011} ∪ ... =
n n
{0 1 |n ∈ N}. Each of the languages on the left hand side are finite and
therefore regular. The language on the right hand side is known to be nonregular.
b
Are the regular languages closed under countable intersection?
No
Consider {ε} ∩ {01} ∩ {0011} ∩ ... = {0n 1n |n ∈ N}. Each of the languages
on the left hand side are co-finite and therefore regular. The language on the
right hand side is the complement of a non-regular language and therefore is
non-regular.
3) PS2 number 27 ♣
No
(this actually shows non-closure under non-finite describability)
Consider some language L ⊆ a(aa)∗ such that L is non-finitely describable (and therefore certainly non-regular). We know that such a language
must exists since a(aa)∗ is countably infinite, and thus the set of subsets
of this language is uncountable. Now let L0 = L ∪ b∗ . Since ♣ only takes
representatives from even length strings in its input language we have that
♣(L0 ) = b∗ because all strings in L are of odd length. Since b∗ is regular (and
1
therefore finitely describable) ♣ preserves neither non-finite describability
nor regularity.
4) PS2 number 29
Is the language L = {0i 1j |i 6= j} regular?
Not Regular
Assume toward a contradiction that L is regular. if L is regular then
∗ ∗
0 1 − L must also be regular, since regularity is closed under set minus.
However, 0∗ 1∗ − L = {0n 1n |n ∈ N} which we know to be non-regular.
5) PS2 number 16
a
Are the non-finitely describable languages closed under concatenation?
False
Let L be a non-finitely describable language. (L) must also be nonfinitely describable (see part c). Also, if we have some non-finitely describable
language L we know that L ∪ F is also non-finitely describable for finite
language F , as otherwise we could describe L as (L ∪ F ) − ε. If we have some
language L1 such that ε ∈ L1 then we know that L2 ⊆ L1 L2 since ε·w ∈ L1 L2
for any w ∈ L2 . Thus L · (L ∪ {ε}) = Σ∗ is finitely describable. Therefore
the non-finitely describable languages are not closed under concatenation.
b
Are the non-finitely describable languages closed under Kleene closure?
False
Let L be a non-finitely describable language. observe that if L1 ⊆ L2
then L∗1 ⊆ L∗2 . Now consider (L ∪ Σ)∗ which is non-finitely describable (proof
in part a). Since Σ ⊆ L ∪ Σ we know that (L ∪ Σ)∗ = Σ∗ which is finitely
describable. Thus the non-finitely describable languages are not closed under
Kleene closure.
c
Are the non-finitely describable languages closed under complementation?
True
Let L be a non-finitely describable language. Assume toward contradiction that L is finitely describable. We could describe L then as L, which is
a contradiction. Therefore the non-finitely describable languages are closed
under complementation.
d
Are the non-finitely describable languages closed under union?
False
2
Let L be a non-finitely describable language. We know by part c that L
is also non-finitely describable. However L ∪ L = Σ∗ is finitely describable,
thus the non-finitely describable languages are not closed under union.
6) PS2 number 33
The class of languages accepted by Deterministic infinite state automata
∗
is 2Σ . Non-deterministic infinite state automata give the same class.
I can construct a IA for an arbitrary language L as follows: for each
string in Σ∗ I will have a unique state (call qw the state associated with
string w), with qε as the start state. I define δ(qw , σ) = qw·σ . I can then
define the machine for arbitrary language L by defining the set of accept
states F = {qw |w ∈ L}.
Note that the above machine is deterministic. A deterministic machine
is a special case of a non-deterministic machine, therefore the class of languages accepted by non-deterministic infinite state automata is no smaller
than that of deterministic infinite state automata. However there is no class
∗
of languages larger than 2Σ , meaning the class of languages accepted by
∗
non-deterministic infinite state automata is also 2Σ .
7) Sipser 1.41
Yes, perfect shuffle preserves regularity.
Given machines for L1 , L2 we will construct a machine for perf ectshuf f le(L1 , L2 )
by doing a cross product construction on 3 machines:
M1 = (Q1 , q1 , Σ, δ1 , F1 ) which is the machine for L1
M2 = (Q2 , q2 , Σ, δ2 , F2 ) which is the machine for L2
and S = ({1, 2}, 1, Σ, δS , {2}) where δS (q1 , σ) = q2 and δS (q2 , σ) = q1
We define the cross product machine
Mps = (Q1 × Q2 × {1, 2}, (q1 , q2 , 1), Σ, δps , F1 × F2 × {1})
where δps ((qi , qj , 1), σ) = (δ1 (qi , σ), qj , 2) and δps ((qi , qj , 2), σ) = (qi , δ2 (qj , σ), 2)
3
© Copyright 2026 Paperzz