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.

Slides:



Advertisements
Similar presentations
Properties of Regular Sets
Advertisements

Regular operations Sipser 1.1 (pages 44 – 47). CS 311 Fall Building languages If L is a language, then its complement is L’ = {w | w ∉ L} Let A.
Proof of the Pumping Theorem for Regular Languages Richard Beigel CIS Temple University.
Lecture 9,10 Theory of AUTOMATA
Fall 2006Costas Busch - RPI1 Non-regular languages (Pumping Lemma)
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
CS21 Decidability and Tractability
Regular operations Sipser 1.2 (pages 47-63). First… a sample proof Latex files on ella.
Regular operations Sipser 1.1 (pages 44 – 47). CS 311 Mount Holyoke College 2 Building languages If L is a language, then its complement is L’ = {w |
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
NFAs and DFAs Sipser 1.2 (pages 47-63). Last time…
Turing machines Sipser 2.3 and 3.1 (pages )
Reducibility Sipser 5.1 (pages ).
Regular expressions Sipser 1.3 (pages 63-76). CS 311 Mount Holyoke College 2 Looks familiar…
CFG => PDA Sipser 2 (pages ).
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
NFAs Sipser 1.2 (pages 47–54). CS 311 Mount Holyoke College 2 Recall… Last time we showed that the class of regular languages is closed under: –Complement.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
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.
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.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 1 Regular Languages Contents Finite Automata (FA or DFA) definitions, examples,
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
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 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
1 Non-regular languages. 2 Regular languages Non-regular languages.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Great Theoretical Ideas in Computer Science.
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
Introduction to CS Theory
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.
Conversions & Pumping Lemma CPSC 388 Fall 2001 Ellen Walker Hiram College.
CSCI 2670 Introduction to Theory of Computing September 13.
CS 203: Introduction to Formal Languages and Automata
Deterministic Finite Automata COMPSCI 102 Lecture 2.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
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.
CSE 105 theory of computation
Foundations of Computing Science
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
CSE 3813 Introduction to Formal Languages and Automata
Properties of Regular Languages
Properties of Regular Languages
Elementary Questions about Regular Languages
Non-regular languages
CS21 Decidability and Tractability
CHAPTER 1 Regular Languages
Presentation transcript:

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 by regular expressions DFAs or NFAs What if we can’t find a regular expression or finite state automaton for a language? How do we show a language is not regular?

CS 311 Mount Holyoke College 3 Limited memory Since finite state automata cannot back up when reading an input, they are allowed only a bounded amount of memory What about the language {0 n 1 n | n ≥ 0} ?

CS 311 Mount Holyoke College 4 Hmm… how can we prove a language is not regular? What about – {w | w has an equal number of 0s and 1s} – {w | w has an equal number of occurrences of the substrings 01 and 10}

CS 311 Mount Holyoke College 5 Try a different perspective How can a regular language be infinite? Iff its regular expression must have a Kleene star Star operators correspond to cycles in the finite state automaton

CS 311 Mount Holyoke College 6 Pigeonhole principle Let M be a finite state machine with N states recognizing an infinite language Let x ∈ L(M) with |x| = N Then there exists a sequence of states s 0,s 1,s 2,…,s N So: N+1 pigeons into N holes… –Some hole must have at least 2 pigeons! –I.e., at least two of the states must be the same, so there must be a cycle

CS 311 Mount Holyoke College 7 Machine loops Let q k be the first repeated state; that is, q k = q k+p for some p, 0 ≤ k < k+p ≤ N. Where – x = a 1 a 2...a k …a k+p …a N = uvw – u = a 1 a 2...a k – v = a k+1 …a k+p – w = a k+p+1 …a N We conclude: uv i w ∈ L(M) for all i ≥ 0.

CS 311 Mount Holyoke College 8 The pumping lemma Theorem 1.70: If A is a regular language, then there is a number N where, if x is any string of length at least N, then x = uvw, such that 1.For each i ≥ 0, uv i w ∈ A, 2.|v| > 0, and 3.|uv| ≤ N.

CS 311 Mount Holyoke College 9 So now… Is L = {0 n 1 n : n≥ 0} regular? Prove it! If L is regular… we can apply the pumping lemma! …there are strings u, v, and w such that uv i w ∈ L for all i ≥ 0. –What does v look like? Entirely 0 s Entirely 1 s Both 0 s and 1 s

CS 311 Mount Holyoke College 10 Reuse! Is C = { w | w has an equal number of 0s and 1s} a regular language?

CS 311 Mount Holyoke College 11 Picking the substring to pump Is PAL = {w ∈ {0, 1}* : w is a palindrome} a regular language?