Transparency No. 7-1 Formal Language and Automata Theory Chapter 7 Limitations of Finite Automata (lecture 11 and 12)

Slides:



Advertisements
Similar presentations
Properties of Regular Languages
Advertisements

Chapter Eleven: Non-Regular Languages
Lecture 9,10 Theory of AUTOMATA
Lecture 10 Pumping Lemma A property of regular sets.
Fall 2006Costas Busch - RPI1 Non-regular languages (Pumping Lemma)
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
CS21 Decidability and Tractability
Nonregular languages Sipser 1.4 (pages 77-82). CS 311 Mount Holyoke College 2 Nonregular languages? We now know: –Regular languages may be specified either.
Nonregular languages Sipser 1.4 (pages 77-82). CS 311 Fall Nonregular languages? We now know: –Regular languages may be specified either by regular.
Automata and Formal Languages Tim Sheard 1 Lecture 8 Pumping Lemma & Distinguishability Jim Hook Tim Sheard Portland State University.
Transparency No. 2-1 Formal Language and Automata Theory Chapter 2 Deterministic Finite Automata (DFA) (include Lecture 3 and 4)
Courtesy Costas Busch - RPI1 More Applications of the Pumping Lemma.
Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (more on Section 1.4) David Martin This work is licensed under.
CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
Transparency No. 4-1 Formal Language and Automata Theory Chapter 4 Patterns, Regular Expressions and Finite Automata (include lecture 7,8,9) Transparency.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Transparency No. P2C5-1 Formal Language and Automata Theory Part II Chapter 5 The Pumping Lemma and Closure properties for Context-free Languages.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Limitations.
1 More Applications of the Pumping Lemma. 2 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we.
Courtesy Costas Busch - RPI1 Non-regular languages.
Homework 4 Solutions.
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Fall 2006Costas Busch - RPI1 More Applications of the Pumping Lemma.
Transparency No. ?-0 Formal Language and Automata Theory Chapter 6 Homomorphisms (lecture 10) Transparency No. 6-1.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Transparency No. P2C5-1 Formal Language and Automata Theory Part II Chapter 5 The Pumping Lemma and Closure properties for Context-free Languages.
Lecture 7UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 7.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
Prof. Busch - LSU1 More Applications of the Pumping Lemma.
Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (Section 1.4: Nonregular Languages) David Martin With some.
1 Non-regular languages. 2 Regular languages Non-regular languages.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Closure.
TK PrasadPumping Lemma1 Nonregularity Proofs. TK PrasadPumping Lemma2 Grand Unification Regular Languages: Grand Unification (Parallel Simulation) (Rabin.
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
Properties of Regular Languages
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
CS355 - Theory of Computation Regular Expressions.
CS 203: Introduction to Formal Languages and Automata
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
Transparency No. P2C5-1 Formal Language and Automata Theory Part II Chapter 5 The Pumping Lemma and Closure properties for Context-free Languages.
Cs466(Prasad)L11PLEG1 Examples Applying Pumping Lemma.
Nonregular Languages How do you prove a language to be regular? How do you prove a language to be nonregular? A Pumping Lemma.
Equivalence with FA * Any Regex can be converted to FA and vice versa, because: * Regex and FA are equivalent in their descriptive power ** Regular language.
MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping.
1 Advanced Theory of Computation Finite Automata with output Pumping Lemma Theorem.
Lecture #5 Advanced Computation Theory Finite Automata.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Complexity and Computability Theory I
Pumping Lemma.
Non-regular languages
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
PROPERTIES OF REGULAR LANGUAGES
CSE 3813 Introduction to Formal Languages and Automata
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Properties of Regular Languages
COSC 3340: Introduction to Theory of Computation
Elementary Questions about Regular Languages
Non-regular languages
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Pumping Lemma.
Non-Regular Languages
Recap lecture 26 Example of nonregular language, pumping lemma version I, proof, examples,
CHAPTER 1 Regular Languages
Presentation transcript:

Transparency No. 7-1 Formal Language and Automata Theory Chapter 7 Limitations of Finite Automata (lecture 11 and 12)

Limitations of FAs Transparency No. 7-2 Limitations of FAs Problem: Is there any set not regular ? ans: yes! example: B = {a n b n | n  0 } = { ,ab,aabb,aaabbb,…} Intuition: Any machine accepting B must be able to remember the number of a’s it has scanned before encountering the first b, but this requires infinite amount of memory (states) and is beyond the capability of any FA, which has only a finite amount of memory (states). Pf: Assume B is regular = L(M) for some DFA M. Let k = |Q|. consider the string a n b n with n >> k. Let s a s 1 a s 2 a …. s n-1 a s n b s n+1 b …. b s 2n be any path witnessing the acceptance of a n b n. now consider the sequence of states s 0,s 1,…,s n, by pigeonhole principle there are 0 < i < j < n s.t. s i = s j. =>  (s i, a n-i b n ) =  (s j, a n-j b n ) = s 2n  F, and  (s, a i ) =  (s,a j ) = s i = s j. =>  (s, a n-(j-i) b n ) =  (s, a i a n-j b n ) =  (  (s,a i ), a n-j b n ) =  (s j, a n- j b n ) = s 2n  F => a n-(j-I) b n  B, a contradiction.

Limitations of FAs Transparency No. 7-3 Another nonregular set C= {a 2 n | n > 0} = {a, aa, aaaa, aaaaaaaa, … } is nonregular pf: assume C is regular and is accepted by a DFA with k states. Let n > k and x = a 2 n  C. Now consider the sequence of states:  (s,a),  (s,aa),….,  (s,a n ), by pigeonhole principle, there are 0<i<i+j  n s.t.  (s,a i ) =  (s,a i+j ) [ = p] let 2 n = i + j + m. =>  (s, a 2 n +j ) =  (s, a i a j a j a m ) =  (s,a i a j a m ) =  (s, a 2 n )  F. But since 2 n + j  2 n + n 2 n, a 2 n +j  C => the DFA accept a string ∉ C, a contradiction! Hence C is not regular.

Limitations of FAs Transparency No. 7-4 The pumping lemma Theorem 11.1: If A is a regular set, then (P):  k  0 s.t. for any string x,y,z with xyz  A and |y|  k, there exist strings u,v,w s.t. y = uvw, v   and for all i  0, the string xuv i wz  A. pf: Similar to the previous two examples. Let k = |Q| where Q is the set of states in any FA accepting A. Theorem 11.2 (pumping lemma, the contropositive form) If A is any set of strings satisfying the property (~P):  k  0  xyz  A s.t. |y|  k and  u,v,w with uvw = y and v  , there exists an i  0 s.t. xuv i vw  A, then A is not regular. [I.e., ~P means for any k ≥ 0, there is a substring of length ≥ k [of a member] of A, a cut or a certain duplicates of the middle of any 3- segment decomposition of which will produce a string ∉ A. ]

Limitations of FAs Transparency No. 7-5 Game-theoretical proof of nonregularity of a set 1. Two players: You (want to show that A is not regular) Demon (or Opponent want to show A is regular) 2 The game proceeds as follows: 1. D picks k (if A is regular, D’s best strategy is to pick k = #states of a FA accepting A) 2. Y picks x,y,x with xyz  A and |y|  k. 3. D picks u,v,w s.t. y = uvw and v  . 4. Y picks i  0 3. Finally Y wins if xuv i wz  A and D wins if xuv i wz  A. 4. By Theorem 11.2, A is not regular if there is a winning strategy according to which Y always win. Note: P is a necessary but not a sufficient condition for the regularity of A (i.e., there is nonregular set A satisfying P).

Limitations of FAs Transparency No. 7-6 Using the pumping lemma Ex1: Show the set A = {a n b m | n  m } is not regular. the proof: 1. D gives k [for any k  0] 2. Y pick x = a k, y = b k, z =  [  xyz in A with |y|  k] ==> xyz = a k b k  A 3. D decompose y = uvw with [for all uvw with uvw=y and |u|=j, |v|=m > 0 and |w|= n v   ] 4. Y take i = 2. [  i  0 s.t. xuv i wz  A] => xuv 2 wz = a k b j b 2m b n = a k b k+m  A => Y wins. Hence A is not regular. Ex2: C = {a n! | n  0 } is not regular. pf: similar to Ex1. Left as an exercise. hint: for any k > 0 D chooses, let xyz =a kxk! a k!  and let i = 0.

Limitations of FAs Transparency No. 7-7 Other techniques: Using closure property of regular sets. Ex3: D = { x  {a,b}* | #a(x) = #b(x) } = { , ab, ba, aabb, abab. baba, bbaa, abba, baab,… } is not regular. (Why ?) if regular => D  a*b* = {a n b n | n  0 } = B is regular. But B is not regular, D thus is not regular. [H2E2:] A: any language; if A is regular, then rev(A) = def {x n x n-1 …x 1 | x 1 x 2 …x n  A} is regular. Ex4: A = {a n b m | m  n } is not regular. pf: If A is regular => rev(A) and h((rev(A)) = {a n b m | n  m} is regular, where h(a) = b and h(b) = a. => A  h(rev(A)) = {a n b n | n  0} is regular, a contradiction!