LectureNotes9

LectureNotes9 - ECS 120 Lesson 9 Non-Regular Languages, the...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECS 120 Lesson 9 Non-Regular 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 non-regular 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 non-regularity 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.

Page1 / 7

LectureNotes9 - ECS 120 Lesson 9 Non-Regular Languages, the...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online