CS311 / MATH352 - AUTOMATA AND COMPLEXITY THEORY Homework # 4 Solution Max. Points: 100

Similar documents
Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Fundamentele Informatica II

Automata and Formal Languages

Regular Languages and Finite State Machines

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

CS 103X: Discrete Structures Homework Assignment 3 Solutions

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

1. Prove that the empty set is a subset of every set.

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

Reading 13 : Finite State Automata and Regular Expressions

ASSIGNMENT ONE SOLUTIONS MATH 4805 / COMP 4805 / MATH 5605

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

C H A P T E R Regular Expressions regular expression

Page 331, 38.4 Suppose a is a positive integer and p is a prime. Prove that p a if and only if the prime factorization of a contains p.

The Halting Problem is Undecidable

Full and Complete Binary Trees

TOPIC 4: DERIVATIVES

SOLUTIONS TO ASSIGNMENT 1 MATH 576

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Deterministic Finite Automata

mod 10 = mod 10 = 49 mod 10 = 9.

Mathematical Induction. Lecture 10-11

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

6.2 Permutations continued

Mathematical Induction

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

CS 3719 (Theory of Computation and Algorithms) Lecture 4

MATH10040 Chapter 2: Prime and relatively prime numbers

How To Factorize Of Finite Abelian Groups By A Cyclic Subset Of A Finite Group

Automata on Infinite Words and Trees

Regular Languages and Finite Automata

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Regular Expressions and Automata using Haskell

Automata and Computability. Solutions to Exercises

MATH 22. THE FUNDAMENTAL THEOREM of ARITHMETIC. Lecture R: 10/30/2003

Homework until Test #2

God created the integers and the rest is the work of man. (Leopold Kronecker, in an after-dinner speech at a conference, Berlin, 1886)

6.080/6.089 GITCS Feb 12, Lecture 3

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

1 if 1 x 0 1 if 0 x 1

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Sample Induction Proofs

MA651 Topology. Lecture 6. Separation Axioms.

Discrete Optimization

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

SOLUTIONS FOR PROBLEM SET 2

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Introduction to Automata Theory. Reading: Chapter 1

Quotient Rings and Field Extensions

Turing Degrees and Definability of the Jump. Theodore A. Slaman. University of California, Berkeley. CJuly, 2005

Lecture 17 : Equivalence and Order Relations DRAFT

COMMUTATIVE RINGS. Definition: A domain is a commutative ring R that satisfies the cancellation law for multiplication:

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

CHAPTER 7 GENERAL PROOF SYSTEMS

An example of a computable

Computability Theory

CS5236 Advanced Automata Theory

Notes on Complexity Theory Last updated: August, Lecture 1

k, then n = p2α 1 1 pα k

(0, 0) : order 1; (0, 1) : order 4; (0, 2) : order 2; (0, 3) : order 4; (1, 0) : order 2; (1, 1) : order 4; (1, 2) : order 2; (1, 3) : order 4.

Math 115 Spring 2011 Written Homework 5 Solutions

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 5 9/17/2008 RANDOM VARIABLES

So let us begin our quest to find the holy grail of real analysis.

1. Let X and Y be normed spaces and let T B(X, Y ).

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

FACTORING CERTAIN INFINITE ABELIAN GROUPS BY DISTORTED CYCLIC SUBSETS

THE DIMENSION OF A VECTOR SPACE

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:

SECTION 10-2 Mathematical Induction

The Goldberg Rao Algorithm for the Maximum Flow Problem

3515ICT Theory of Computation Turing Machines

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

SCORE SETS IN ORIENTED GRAPHS

n k=1 k=0 1/k! = e. Example 6.4. The series 1/k 2 converges in R. Indeed, if s n = n then k=1 1/k, then s 2n s n = 1 n

14.1 Rent-or-buy problem

Math 55: Discrete Mathematics

Lecture 1. Basic Concepts of Set Theory, Functions and Relations

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Continued Fractions and the Euclidean Algorithm

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

Regular Languages and Finite Automata

Similarity and Diagonalization. Similar Matrices

Computer Science Theory. From the course description:

Every Positive Integer is the Sum of Four Squares! (and other exciting problems)

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

Enforcing Security Policies. Rahul Gera

Lecture 5: Put - Call Parity

ALGEBRAIC APPROACH TO COMPOSITE INTEGER FACTORIZATION

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 4 Nancy Lynch

4. CLASSES OF RINGS 4.1. Classes of Rings class operator A-closed Example 1: product Example 2:

(a) Write each of p and q as a polynomial in x with coefficients in Z[y, z]. deg(p) = 7 deg(q) = 9

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

Lemma 5.2. Let S be a set. (1) Let f and g be two permutations of S. Then the composition of f and g is a permutation of S.

Single machine parallel batch scheduling with unbounded capacity

Hint 1. Answer (b) first. Make the set as simple as possible and try to generalize the phenomena it exhibits. [Caution: the next hint is an answer to

Transcription:

CS311 / MATH352 - AUTOMATA AND COMPLEXITY THEORY Homework # 4 Solution Max. Points: 100 Q. No. 1 [(2+8)*4 = 40 points] Clearly mention, whether following languages are regular or non-regular? If regular, then draw a fully specified DFA. If non-regular, then prove using pumping lemma. a) L1 = {ww w {a, b} * }. This language is non-regular. We use pumping lemma to prove that L1 is not regular. The proof is by contradiction. Assume to the contrary that L1 is regular. Let m be the pumping length given by pumping lemma. We choose w, such that w > = m. w can be partitioned into three pieces: w = xyz, such that xy <=m, y > = 1 If L is regular and xyz L1, then xy k z L1 where k>=0. We choose following w: w = vv L1, v is a string over {a,b} of length m. So, w = 2m >m w is partitioned as follows: m m a b a b a b... a b a b a b... x y z Here, length of y is greater that or equal to 1 and length of xy is less or equal to m. According to claim of pumping lemma for regular languages, xy 0 z L1. As y contains only more than one letters. So, by pumping it for k=0, number of letters in first v will decrease at least by 1. Now, number of letters in first v will be m-1 or less, whereas number of letters in second v remain m. Such string can t be part of L1. So, contradiction!!! Hence, our assumption was false, and L1 is non-regular. n b) L2 = {a 2 n>=0} This language is non-regular. We use pumping lemma to prove that L2 is not regular. The proof is by contradiction. Assume to the contrary that L2 is regular. Let m be the pumping length given by pumping lemma. We choose w, such that w > = m. w can be partitioned into three pieces: w = xyz, such that xy <=m, y > = 1 If L is regular and xyz L2, then xy k z L2 where k>=0. We choose following w:

m w = a 2 L So, w = 2 m >m w is partitioned as follows: m 2 m -m aaa aaaaaaaa aaaaa x y z Here, length of y is greater that or equal to 1 and length of xy is less or equal to m. According to claim of pumping lemma for regular languages, xy 2 z L. As y contains only a s. So, by pumping it for k=2, number of a s in xy 2 z will increase and become 2 m +p, where p is length of y and 1<=p<=m. So, 2 m +p<=2 m +m <2 m +2 m =2.2 m = 2 m+1 So, 2 m +p < 2 m+1 So, 2 m +p can t be power of 2 and hence string of this length can t be part of this language. Thus, contradiction!!! Hence, our assumption was false, and L2 is non-regular. c) L3 = The complement of {0 n 1 n n>=0} This language is not regular. {0 n 1 n n>=0} is a non-regular language. Prove it after referring textbook or lecture slides. Complement of an non-regular language can t be regular. Suppose that complement of a non-regular language is regular. But we know that complement of regular language is regular. So, complement of complement will also be regular. Hence, our assumption is incorrect, and complement of non-regular language is non-regular. So, L3 is non-regular.

d) L4 = {w w {0, 1} * and when w is interpreted in reverse as a binary integer, is a multiple of 5} This language is regular. Following is the DFA.

Q. No. 2 [10 points] Here is a proof, using the pumping lemma, that the language L of all strings of 0 s and 1 s of length 100 is not regular. Since the result being proved is false (all finite languages are regular), the proof cannot be correct. What is the flaw in the proof? After removing flaw, can you prove using pumping lemma, that L is regular? If yes, then please give modified correct proof? Assume for the sake of contradiction that L is regular. By the pumping lemma, if we choose an element of L, say w = 0100, there are strings x, y and z, with y >0, so that every string of the form xy k z (where k 0)is in L. Since there are infinitely many different strings of this form, this contradicts the fact that L is finite. Therefore, L is not regular. Flaws: No consideration of an arbitrary integer m, which is provided by pumping lemma Invalid selection of w Pumping lemma can t be applied to finite languages Q. No. 3 [10 points] Find two regular languages L 1 and L 2 over {a,b}, where L 1 and L 2 are not equals and neither is a subset of the other, and (L 1 UL 2 ) * = L 1 * UL 2 *. L1 = {lambda} L2 = {a} Or there may be many more Q. No. 4 [20+10+10=40 points] a) Suppose that p and q are distinguishable states of a given DFA A with n states. As a function of n, what is the tightest upper bound on how long the shortest string that distinguishes p from q can be? Tightest upper bound is n-2. It is length of the distinguishing string when first two states are p and q and nth state is final state. In all other possibilities, this length is less or equal to n-2. b) Draw the table of distinguishabilities for the following automaton? Also construct the minimum-state equivalent DFA? (Arrow represents start state and * represents final state) 0 1 A B E B C F *C D H D E H E F I *F G B G H B H I C *I A E

Table of Distinguishabilities B x C x x D x x E x x x F x x x x G x x x x H x x x x x I x x x x x x A B C D E F G H Equivalence classes: {{A,D,G}, {B,E,H}, {C,F,I}} Minimized DFA: {A,D,G} 0,1 {B,E,H} 0 1 0,1 {C,F,I}