CSCI 2670 Introduction to Theory of Computing

Slides:



Advertisements
Similar presentations
Fall 2006Costas Busch - RPI1 Non-regular languages (Pumping Lemma)
Advertisements

CSCI 2670 Introduction to Theory of Computing September 13, 2005.
CSCI 2670 Introduction to Theory of Computing September 15, 2004.
CS21 Decidability and Tractability
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
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)
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.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
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.
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.
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.
Today Chapter 1: RE = Regular Languages, nonregular languages RL pumping lemma Chapter 2: Context-Free Languages (CFLs)
1 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
CSCI 2670 Introduction to Theory of Computing September 1, 2005.
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
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
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.
CSCI 2670 Introduction to Theory of Computing September 7, 2004.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
CSE 105 theory of computation
Complexity and Computability Theory I
CSE 105 theory of computation
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
Regular Expressions Sections:1.3 page 63 September 17, 2008
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Single Final State for NFA
Intro to Theory of Computation
Lecture5 Non-regular languages
Infiniteness Test The Pumping Lemma Nonregular Languages
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
CS 154, Lecture 3: DFANFA, Regular Expressions.
CSCI 2670 Introduction to Theory of Computing
Context-Free Grammars
Elementary Questions about Regular Languages
Non-regular languages
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Pumping Lemma September 29, 2006
CS21 Decidability and Tractability
Chapter 1 Regular Language - 02
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
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

CSCI 2670 Introduction to Theory of Computing September 9, 2004

Agenda Yesterday Today Proved correspondence between DFA’s and RE’s Began an example converting a DFA to an RE Today Complete example Learn how to prove languages are not regular

Next week New method for describing languages Context-free grammars Read Section 2.1 (pages 91 – 101)

Converting a GNFA to a RE If the GNFA has two states, then the label connecting the states is the RE Otherwise, remove one state at a time without changing the language accepted by the machine until the GNFA has two states

Removing one state from a GNFA q2 q1 q3 a12a13a33*a32 q1’ q2’

Accounting for loops a22a23a33*a32 a11a13a33*a31 a12a13a33*a32 q1’

Example 1 q1 q2

Example 1 1 q1 q2 ε ε qs qt Step 1: Add two new states

Example 101*0 1 1 q1 q2 ε ε qs qt 1*0 Step 2: Remove q1

Example 101*0 q2 ε qs qt 1*0 1*0(101*0)* Step 3: Remove q2

Example So this DFA 1 q1 q2 Is equivalent to the regular expression 1*0(101*0)*

Nonregular languages So far, we have explored several ways to identify regular languages DFA’s, NFA’s, GNFA’s, RE’s There are many nonregular languages {0n1n | n  0} {101,101001,1010010001,…} {w | w has the same number of 0s and 1s} How can we tell if a language is not regular?

Property of regular languages All regular languages can be generated by finite automata States must be reused if the length of a string is greater than the number of states If states are reused, there will be repetition

The pumping lemma Theorem: If A is a regular language, then there is a number p where, if s is any string in A of length at least p, then s may be divided into three pieces, s = xyz, satisfying the following conditions for each i  0, xyiz is in A |y| > 0, and |xy|  p p is called the pumping length

Proof idea Pumping length is equal to the number of states in the DFA whose language is A p = |Q| If A accepts a word w with |w| > p, then some state must be entered twice while processing w Pigeonhole principle

Proof idea x y z for each i  0, xyiz is in A |y| > 0, and |xy|  p

Using the pumping lemma We can use the pumping lemma to prove a language B is not regular Assume B is regular Show that the pumping lemma is not satisfied Proof by contradiction

Example B={101,101001,1010010001,…} The jth and (j+1)th 1’s are separated by j 0’s Assume B is regular and let w be any string in B Let w=xyz, where |y|>0 We cannot make any assumptions on the value of p We want to show that no matter what y is, there is some i for which xyizB

Example (cont.) There are 3 possibilities for y If y=0b then xy2z  B y has no 1’s y = 0b for some b > 0 y has one 1 y = 0b10c for some b,c  0 y has two or more 1’s y = 0b10c1v for some b,c  0 and some v* If y=0b then xy2z  B The number of 1’s between the last 1 in x and the fist 1 in z has increased

Example (cont.) There are 3 possibilities for y y has no 1’s y = 0b for some b > 0 y has one 1 y = 0b10c for some b,c  0 y has two or more 1’s y = 0b10c1v for some b,c  0 and some v* If y = 0b10c then xy3z  B There are two consecutive 1’s with b+c 0’s between them

Example (cont.) There are 3 possibilities for y y has no 1’s y = 0b for some b > 0 y has one 1 y = 0b10c for some b,c  0 y has two or more 1’s y = 0b10c1v for some b,c  0 and some v* If y=0b10c1v then xy2z  B There are c 0’s between a pair of consecutive 1’s twice

Example (cont.) Therefore, the pumping lemma is not satisfied so B is not a regular language For every p and every y with |y| > 0, we can show that xyiz  B for some i

Have an excellent weekend