{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
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 ∈ { 0 , 1 } * w contains an equal number of 0 s and 1 s 0 n 1 m ∈ { 0 , 1 } * n = m 0 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 ∈ { 0 , 1 } * w has an equal number of occurrences of the substrings 01 and 10 is in fact regular. 1
Image of page 1

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

View Full Document Right Arrow Icon
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 0 , 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 0 , q 1 , . . . , q n ) Q n +1 , such that q 0 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. w 1 w 2 w 3 w n-1 w n q 0 q 1 q 2 q n-1 q n Figure 1: The chain of states ( q 0 , q 1 , . . . , q n ) that machine M follows when accepting word w = w 1 w 2 . . . w n .
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern