This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: ECS 120 Lesson 9 NonRegular Languages, the Pumping Lemma Oliver Kreylos Wednesday, April 18th, 2001 Having spent so much time on regular languages, on different ways to specify them, on operations on them and their closure under these operations, one could get the impression that all languages we are concerned about are regular. Far from the truth though regular languages are important in a plethora of applications, the really interesting languages are not regular. Here are some examples of nonregular languages: w { , 1 } * w contains an equal number of s and 1 s n 1 m { , 1 } * n = m a i b j c k { a , b , c } * i + j = k a p { a } * p 2 is a prime number w * w is a palindrome w * w = xx for some x * w ( { , , , * , ( , ) } ) * w R () From these examples, we can boldly conclude that finite state machines have trouble recognizing languages that involve counting, calculating, stor ing input strings, and languages that are defined in a recursive fashion, e. g., regular expressions or arithmetic expressions. This intuition some times leads in the wrong direction, however: The language w { , 1 } * w has an equal number of occurrences of the substrings 01 and 10 is in fact regular. 1 With intuition seemingly at a loss, how can we decide whether a given language is regular or not? We already know a way of proving that a lan guage is regular: If we are able to construct a finite state machine or regular expression that accepts/generates it, we know the language must be regular. On the other hand, if we are not able to construct a machine, we cannot conclude that the language is not regular (we might just not have found the correct one). To prove the nonregularity of a language A , we need deeper insight into the workings of automata, to show that there can be no automa ton that accepts A . This insight comes in the form of a general theorem about the languages accepted by finite automata. 1 The Pumping Lemma The pumping lemma is a theorem about regular languages. In other words, if a language is regular, it must behave according to the pumping lemma. We can use this to disprove the regularity of a language: If we can show that it violates the pumping lemma, it cannot be regular. To understand the pumping lemma, we have to have a closer look at how any finite automaton accepts a word from its language. Let M = ( Q, ,,q ,F ) be any DFA, and let A = L ( M ) be its language. Now let w = w 1 w 2 ...w n A be any word of length n 0. We know that there must be a sequence of states ( q ,q 1 ,...,q n ) Q n +1 , such that q is the start state, q n is a final state, and the labels on the transitions from q i 1 to q i spell out the word w : i { 1 ,...,n } : ( q i 1 ,w i ) = q i , see Figure 1....
View
Full
Document
This note was uploaded on 05/20/2010 for the course ECS 120 taught by Professor Filkov during the Spring '07 term at UC Davis.
 Spring '07
 Filkov

Click to edit the document details