Download Homework #3

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Laws of Form wikipedia , lookup

Transcript
CSE 105: Automata and Computability Theory
Winter 2016
Homework #3
Due: Monday, February 8th, 2016, 11:59 pm
Problem 1 Regular expressions as we defined them include three operations: union (+ or
∪), concatenation, and and Kleene star. In this problem we consider whether the union
operation is superfluous. Call a regular expression that does not include any union
operations (i.e., + symbols) or-free. For example, ab∗ a is or-free, whereas (a + b)∗ is not.
a. Can the regular expression a + b be rewritten into an equivalent regular expression
that is or-free? If so, give that equivalent or-free expression.
b. Can the regular expression (a + b)∗ be rewritten into an equivalent regular expression
that is or-free? If so, give that equivalent or-free expression.
∗
c. Can the regular expression aa (a + b) c be rewritten into an equivalent regular
expression that is or-free? If so, give that equivalent or-free expression.
d. Under what conditions can a regular expression be rewritten into an equivalent one
that is or-free? (Give as succinct an explanation as you can.)
Problem 2 Let L be the language
m
0 m is a composite number
over the unary alphabet Σ = {0}. The first few strings in L (in shortlex order) are
0000, 000000, 00000000, and 000000000.
a. Prove that L is not regular without using the pumping lemma, by using closure
properties of the regular languages.
Hint: Make sure you handle ε and 0, which correspond to numbers that are
neither prime nor composite.
b. Prove that L is not regular using the pumping lemma.
Hint: You will need Dirichlet’s Theorem: if gcd(a, b) = 1 then the sequence
{a + ib}i≥0 contains infinitely many primes.
Further hint: A good starting point, given p > 0 from the adversary, is to let
2
q be the smallest prime strictly larger than p, then set w = 0q .
(Which of the two proofs was easier?)
1
Problem 3 We know that if X and Y are regular languages then X + Y is also regular.
In this problem, we show that neither the converse of this statement nor its negation
holds in general.
a. Give an example of a nonregular language A and an infinite, regular language B such
that A + B is regular. Be sure to prove any claim you make about the languages.
b. Give an example of a nonregular language C and an infinite, regular language D such
that C +D is nonregular. Be sure to prove any claim you make about the languages.
2