Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)

Slides:



Advertisements
Similar presentations
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Advertisements

Lecture 9,10 Theory of AUTOMATA
Fall 2006Costas Busch - RPI1 Non-regular languages (Pumping Lemma)
3.2 Pumping Lemma for Regular Languages Given a language L, how do we know whether it is regular or not? If we can construct an FA to accept the language.
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
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.
Courtesy Costas Busch - RPI1 More Applications of the Pumping Lemma.
Fall 2006Costas Busch - RPI1 Regular Expressions.
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
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.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Courtesy Costas Busch - RPI1 The Pumping Lemma for Context-Free Languages.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
1 The Pumping Lemma for Context-Free Languages. 2 Take an infinite context-free language Example: Generates an infinite number of different strings.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Costas Busch - RPI1 The Pumping Lemma for Context-Free Languages.
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.
Fall 2003Costas Busch1 More Applications of The Pumping Lemma.
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.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
Prof. Busch - LSU1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
Prof. Busch - LSU1 Pumping Lemma for Context-free Languages.
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 More Applications of the Pumping Lemma.
1 Non-regular languages. 2 Regular languages Non-regular languages.
Costas Busch - RPI1 More Applications of the Pumping Lemma.
Costas Busch1 More Applications of The Pumping Lemma.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
CS 203: Introduction to Formal Languages and Automata
Regular Expressions Costas Busch - LSU.
Costas Busch - LSU1 Pumping Lemma for Context-free Languages.
1 Find as many examples as you can of w, x, y, z so that w is accepted by this DFA, w = x y z, y ≠ ε, | x y | ≤ 7, and x y n z is in L for all n ≥ 0.
Costas Busch - LSU1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
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.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
A Universal Turing Machine
Complexity and Computability Theory I
Formal Language & Automata Theory
Non-regular languages
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
PROPERTIES OF REGULAR LANGUAGES
Busch Complexity Lectures: Reductions
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Regular Expressions Prof. Busch - LSU.
Infiniteness Test The Pumping Lemma Nonregular Languages
DPDA Deterministic PDA
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
Pumping Lemma for Context-free Languages
Elementary Questions about Regular Languages
Non-regular languages
Undecidable problems:
More Applications of the Pumping Lemma
DPDA Deterministic PDA
Applications of Regular Closure
CHAPTER 1 Regular Languages
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)

Prof. Busch - LSU2 Regular languages Non-regular languages

Prof. Busch - LSU3 How can we prove that a language is not regular? Prove that there is no DFA or NFA or RE that accepts Difficulty: this is not easy to prove ( since there is an infinite number of them) Solution: use the Pumping Lemma !!!

Prof. Busch - LSU4 The Pigeonhole Principle

Prof. Busch - LSU5 pigeons pigeonholes

Prof. Busch - LSU6 A pigeonhole must contain at least two pigeons

Prof. Busch - LSU pigeons pigeonholes

Prof. Busch - LSU8 The Pigeonhole Principle pigeons pigeonholes There is a pigeonhole with at least 2 pigeons

Prof. Busch - LSU9 The Pigeonhole Principle and DFAs

Prof. Busch - LSU10 Consider a DFA with states

Prof. Busch - LSU11 Consider the walk of a “long’’ string: A state is repeated in the walk of (length at least 4)

Prof. Busch - LSU12 Pigeons: Nests: (Automaton states) Are more than Walk of The state is repeated as a result of the pigeonhole principle (walk states) Repeated state Repeated state

Prof. Busch - LSU13 Consider the walk of a “long’’ string: A state is repeated in the walk of (length at least 4) Due to the pigeonhole principle:

Prof. Busch - LSU14 Automaton States Pigeons: Nests: (Automaton states) Are more than Walk of The state is repeated as a result of the pigeonhole principle: (walk states) Repeated state

Prof. Busch - LSU Repeated state Walk of.... Arbitrary DFA If, by the pigeonhole principle, a state is repeated in the walk In General:

Prof. Busch - LSU16 Walk of Pigeons: Nests: (Automaton states) Are more than (walk states).... A state is repeated Number of states in walk is at least

Prof. Busch - LSU17 The Pumping Lemma

Prof. Busch - LSU18 Take an infinite regular language There exists a DFA that accepts states (contains an infinite number of strings)

Prof. Busch - LSU19 (number of states of DFA) then, at least one state is repeated in the walk of Take string with Walk in DFA of Repeated state in DFA

Prof. Busch - LSU20 Take to be the first state repeated.... There could be many states repeated.... Second occurrence First occurrence Unique states One dimensional projection of walk :

Prof. Busch - LSU Second occurrence First occurrence One dimensional projection of walk : We can write

Prof. Busch - LSU22... In DFA:... Where corresponds to substring between first and second occurrence of

Prof. Busch - LSU23 Observation:lengthnumber of states of DFA Since, in no state is repeated (except q) unique states in... Because of

Prof. Busch - LSU24 Observation:length Since there is at least one transition in loop...

Prof. Busch - LSU25 We do not care about the form of string... may actually overlap with the paths of and

Prof. Busch - LSU26 The string is accepted Additional string:... Do not follow loop...

Prof. Busch - LSU27 The string is accepted... Follow loop 2 times Additional string:...

Prof. Busch - LSU28 The string is accepted... Follow loop 3 times Additional string:...

Prof. Busch - LSU29 The string is accepted In General:... Follow loop times...

Prof. Busch - LSU30 Therefore: Language accepted by the DFA...

Prof. Busch - LSU31 In other words, we described: The Pumping Lemma !!!

Prof. Busch - LSU32 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we can write with and such that: (critical length)

Prof. Busch - LSU33 In the book: Critical length = Pumping length

Prof. Busch - LSU34 Applications of the Pumping Lemma

Prof. Busch - LSU35 Observation: Every language of finite size has to be regular Therefore, every non-regular language has to be of infinite size (contains an infinite number of strings) (we can easily construct an NFA that accepts every string in the language)

Prof. Busch - LSU36 Suppose you want to prove that αn infinite language is not regular 1. Assume the opposite: is regular 2. The pumping lemma should hold for 3. Use the pumping lemma to obtain a contradiction 4. Therefore, is not regular

Prof. Busch - LSU37 Explanation of Step 3: How to get a contradiction 2. Choose a particular string which satisfies the length condition 3. Write 4. Show thatfor some 5. This gives a contradiction, since from pumping lemma 1. Let be the critical length for

Prof. Busch - LSU38 Note: It suffices to show that only one string gives a contradiction You don’t need to obtain contradiction for every

Prof. Busch - LSU39 Theorem: The language is not regular Proof: Use the Pumping Lemma Example of Pumping Lemma application

Prof. Busch - LSU40 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma

Prof. Busch - LSU41 Let be the critical length for Pick a string such that: and length We pick

Prof. Busch - LSU42 with lengths From the Pumping Lemma: we can write Thus:

Prof. Busch - LSU43 From the Pumping Lemma: Thus:

Prof. Busch - LSU44 From the Pumping Lemma: Thus:

Prof. Busch - LSU45 BUT: CONTRADICTION!!!

Prof. Busch - LSU46 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore: END OF PROOF

Prof. Busch - LSU47 Regular languages Non-regular language