Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.

Similar presentations


Presentation on theme: "CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006."— Presentation transcript:

1 CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006

2 CS 310 – Fall 2006 Pacific University Quick Review DFA to Regular Expression DFA -> GNFA -> Reduce to 2 state GNFA –Regular Expression R4 R2 R1 R3 Rip this out! (R1(R2)*R3) U R4

3 CS 310 – Fall 2006 Pacific University Non-Regular Languages Languages that cannot be represented by a finite automaton B = { 0 n 1 n | n >= 0 } What makes this hard (impossible) for an NFA to represent? ► hint: What does the F stand for in NFA? How do we prove a language is not regular? Intuition may be wrong; which is not regular? C = { w | w has an equal number of 0s and 1s} D = { w | w has an equal number of occurrences of 01 and 10 as substrings }

4 CS 310 – Fall 2006 Pacific University Pumping Lemma We can use the Pumping Lemma to show that a language is not regular All regular languages have a particular property –For strings over a certain length (the pumping length, p) there must be some repetition within the string F stands for Finite number of states –If a language does not have this property: not regular Not represented by a FA

5 CS 310 – Fall 2006 Pacific University Pumping Lemma (Informal) All regular languages are represented by an FA The result of pushing a string of length n through a FA is a sequence of (n+1) states If (n+1) > number of states in FA, there must be some repetition: must visit the same state twice p = number of states in FA repetition Pumping: The length of the string could be ‘pumped’ up by repeating the cycle, and the string would still be accepted.

6 CS 310 – Fall 2006 Pacific University Pumping Lemma (Formally) DFA: M= ( Q, ∑, δ, q 0, F) If |Q| = p and s є L(M) and |s| >= p then there exists at least one state that was visited twice within the first p input symbols (p input symbols takes you through p+1 states) x y z s = xyz

7 CS 310 – Fall 2006 Pacific University Pumping Lemma (Formally) 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: x y z s = xyz 1. i >= 0, xy i z є L(M) 2. |y| > 0 3. |xy| <= p (x, z may be ε)

8 CS 310 – Fall 2006 Pacific University Pumping Lemma In Action Find a string, s є L, |s| >= p, that cannot be pumped to show language L is not regular. –Proof by contradiction –Find a string that exhibits the “essence” of nonregularity L = { w | w contains equal number of 0s and 1s } let s = 0 p 1 p where p is the pumping length s є L, |s| >= p, so we can write s = xyz What does this imply about y? Is xy 2 z є L? Is xy 0 z є L?

9 CS 310 – Fall 2006 Pacific University Pumping Lemma in Action L = { w | w contains equal number of 0s and 1s } What if we chose the string (01) p ? Can that be pumped? x = y = z =

10 CS 310 – Fall 2006 Pacific University Practice L = { ww | w є {0, 1}* } What string should we chose? what does ww mean? Can that be pumped?


Download ppt "CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006."

Similar presentations


Ads by Google