32+Slides--The+Pumping+Lemma

32+Slides--The+Pumping+Lemma - CS103 HO#32 Slides-The...

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

View Full Document Right Arrow Icon
CS103 HO#32 Slides--The Pumping Lemma 4/27/11 1 More on Regular Expressions All strings over the alphabet {a, b} that have at least 2 a's (some beginning) (1 st impt. a) (some middle) (2 nd impt. a) (some ending) (a b)* a (a b)* a (a b)* More on Regular Expressions All strings over the alphabet {a, b} that have at least 2 a's (some beginning) (1 st impt. a) (some middle) (2 nd impt. a) (some ending) (a b)* a (a b)* a (a b)* (some b's) (1 st a) (some b's) (2 nd a) (some ending) b*ab*a (a b)* (a b)*ab*ab* b*a(a b)*ab* Kleene's Theorem Theorem 1.54 : A language is regular if and only if some regular expression describes it. Lemma 1.55 : If a language is described by a regular expression, then it is regular. Lemma 1.60 : If a language is regular, then it is described by a regular expression. Non-Regular Languages q 1 q 2 q 3 q 4 q 5 a a a a a b b b b b b b b b b a,b Suppose we want to recognize B = { a n b n | n 0 } q 0 q 12 q 13 q 14 q 15 q 9 q 10 q 11 q 7 q 8 q 6 Non-Regular Languages We will show that regular languages have a particular property. To show that a language L is not regular: Assume that L is regular. Thus it has the property. Derive a contradiction. Thus L is not regular. Note that this approach is only useful in proving that L is not regular. Having the property doesn't guarantee that a language is regular. Long Strings Force Repeated States Suppose M = (Q, , , q 1 , F). Suppose s is a string of length at least |Q| that is accepted by M. Then M must visit some state more that once when s is the input. PROOF: M starts in some state, and each time it reads a character, it visits some state. So if |s| = |Q|, M will visit |Q| + 1 states (the initial one plus one for each character in s). Since there more visits than states, the pigeonhole principle tells us that at least one state is visited more than once. This will be true for any accepted string s such that |s| |Q|.
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS103 HO#32 Slides--The Pumping Lemma 4/27/11 2 b a a c b d a (Assume transitions not shown in this DFA lead to the accepting state.) What is the longest string M can accept without repeating a state? Any accepted string of 6 or more symbols must contain cd one or more times. L(M) = ba(cd)*(ca a)b … strings for missing transitions Examples: baab bacab ba cd ab ba cdcdcd ab ba cdcdcdcd cab M The Pumping Lemma If A is a regular language, then there is a number p (the pumping length) such that, 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 three conditions: 1. for each i 0, xy i z A, 2. |y| > 0, and 3. |xy| p. Note that x or z may be , but y may not.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/01/2011 for the course EE 103 taught by Professor Plummer during the Spring '11 term at Stanford.

Page1 / 4

32+Slides--The+Pumping+Lemma - CS103 HO#32 Slides-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