Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.

Slides:



Advertisements
Similar presentations
Properties of Regular Sets
Advertisements

Lecture 10: Context-Free Languages Contextually David Evans
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Theory of Computing Lecture 23 MAS 714 Hartmut Klauck.
The Pumping Lemma for CFL’s
Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 13: Turing Machines.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
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.
CS21 Decidability and Tractability
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)
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Courtesy Costas Busch - RPI1 Non-regular languages.
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Lecture 8 Sept 29, 2011 Regular expressions – examples Converting DFA to regular expression. (same works for NFA to r.e. conversion.) Converting R.E. to.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
1 Non-regular languages. 2 Regular languages Non-regular languages.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
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
Cs3102: Theory of Computation Class 6: Pushdown Automata Spring 2010 University of Virginia David Evans TexPoint fonts used in EMF. Read the TexPoint manual.
Solution Exercise 1.43 a A r r s q q > b b e b s’ q r q’ b r’ a A’
Properties of Regular Languages
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CS355 - Theory of Computation Regular Expressions.
CSCI 2670 Introduction to Theory of Computing September 13.
CS 203: Introduction to Formal Languages and Automata
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
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.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
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.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Complexity and Computability Theory I
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
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Infiniteness Test The Pumping Lemma Nonregular Languages
Non-Deterministic Finite Automata
4. Properties of Regular Languages
Elementary Questions about Regular Languages
Non-regular languages
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Pumping Lemma September 29, 2006
CSCI 2670 Introduction to Theory of Computing
CS21 Decidability and Tractability
Recap lecture 26 Example of nonregular language, pumping lemma version I, proof, examples,
Chapter 1 Regular Language - 02
CSCI 2670 Introduction to Theory of Computing
Chapter 1 Regular Language
CSCI 2670 Introduction to Theory of Computing
CHAPTER 1 Regular Languages
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer Science University of Virginia www.cs.virginia.edu/~njb2b/theory

Midterm Take home? Vote now. Date: During the week before Spring break (out March 3, due March 6)? Don’t have to worry over the break After Spring break (4 days within March 16-23)? 1 more week of content but 2 more weeks to solve problems I will hold Skype/Google Hangout office hours over the break Think about it, vote on Thursday.

Pumping Lemma Goal: Give a sufficient condition for showing non-regularity Consider that L is an infinite regular language Let M be a DFA, L(M)=L Let’s say M has p states There must be some String w in L s.t. |w|>p By the pigeon-hole principle: Some state was visited at least twice! Taking that loop another time must give another string in the language. M x2 3 8 p 12 1 20

Pumping Lemma If L is a regular language then there is some number p (called pumping length) where if w is a string in L s.t. |w|>p then w can be divided into 3 pieces: w=xyz which satisfy: For each i≥0, L |y|>0 |xy|≤p Example: Consider: By condition 3 we know: Thus for i=2 we have more a’s than b’s, so L cannot be regular x M y 3 8 p ℕ 12 1 20 z

Pumping Lemma For each i≥0, L |y|>0 |xy|≤p Show: is not regular Consider By condition 3 we know y , this leaves 4 cases: y Problem: in all of these I only change the first half! I needed to “remember” the first half of the string.

Pumping Lemma For each i≥0, L |y|>0 |xy|≤p Show: is not regular Consider where q is a prime greater than p y may have only a’s, let y= where m≤p For i=p+1 we have Clearly, p(m+1) is not prime For let then So

Pumping Lemma For each i≥0, L |y|>0 |xy|≤p Consider: This language is pumpable but not regular 3 cases: If then let x=ε, y=a If then let x=ε, y=c If then let x=ε, y=c Thus every string is pumpable Nonregular: Then use pumping Lemma!

Myhill-Nerode Theorem Gives a necessary and sufficient condition for regularity! Idea: If two strings terminate in the same state in a DFA then their membership must be equivalent for any suffix. If and meet at state q then for any string , ends in the same state as We say and have no distinguishing extensions M q

Myhill-Nerode Theorem Recall Equivalence Relation: A relation ~ is called an equivalence relation if: Reflexive: Symmetric: Transitive: The relation if and have no distinguishing extensions in language L forms an equivalence relation. Recall Equivalence Class: For equivalence relation ~, equivalence class Myhill Nerode Theorem: L is regular iff has a finite number of equivalence classes under relation

Myhill-Nerode Theorem Myhill Nerode Theorem: L is regular iff has a finite number of equivalence classes under relation Given a finite set of equivalence classes, construct a DFA: Each equivalence class becomes a state: If character takes a string from equivalence class to then add a transition from the state for to the state for . Accept states are those for equivalence classes of strings in the language.

Myhill-Nerode Theorem Extra Credit: Use the Myhill-Nerode Theorem to show the following languages are non-regular: ℕ

Language Reversal Theorem: The regular languages are closed under reversal. Proof: Construction. Given a regular language L, show that the language is also regular. Let M be a DFA for L, construct M’ to be a NFA for L: M M’ ε q0 ε

Half Let Show that HALF preserves regularity. e.g. if “RingoStarr” is in L, then “Ringo” is in HALF(L) Let M be a DFA for language L Intuition: follow the transitions of M for string v. “Check” that there is a path from v to an accept state that consumes |v| characters. How do we do this “check”? M

Half Let Show that HALF preserves regularity. Intuition: follow the transitions of M for string v. “Check” that there is a path from v to an accept state that consumes |v| characters. How do we do this “check”? Use the machine for LR M M’ Σ ε Σ Σ ε Σ F={(q,q)} Σ

Double Let Show that DOUBLE preserves regularity. e.g. if “BamBam” is in L, then “Bam” is in DOUBLE(L) Let M be a DFA for language L Intuition: Run L on w, in parallel non-deterministically “guess” the end state in machine M on w and check if starting from that guess puts the machine in an accept state M M “Guess”

Double Let Intuition: Run L on w, in parallel non-deterministically “guess” the end state in machine M on w and check if starting from that guess puts the machine in an accept state ε ε M ε M M Accept if: M ends in state M ends in an accept state M 1 M 2 M …