ch1_9 - Pumping Lemma CSCE 428/828 Automata, Computation,...

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

View Full Document Right Arrow Icon
1 CSCE 428/828 Automata, Computation, and Formal Languages Chapter 1: Regular Languages 8. Pumping Lemma September 20, 2010 Pumping Lemma Review: A language is regular, if there is a DFA recognizing it, or an NFA recognizing it, or a RE describing it. The pumping lemma describes a 2 The pumping lemma describes a property of all regular languages. Why study the pumping lemma? The pumping lemma can be used to prove that some language is not regular. Pigeonhole Principle Pigeonhole principle if more than p pigeons are placed into p holes, then some hole must have more than one pigeon in it 3 4 pigeons 3 holes Basic Idea of Pumping Lemma (1) Consider a regular language A a DFA for A A string s A with n symbols s1 s2 s3 s4 sn s = s5 s6 4 DFA for A 1 Basic Idea of Pumping Lemma (2) Consider the path that the machine goes through when reading input string s. The path starts with state 1 (the start state), goes through some intermediate states (say 3, 20, 9, …), and finally ends at state 13 (which is a final state) s1 s2 s3 s4 sn s = s5 s6 5 path = 1 3 20 9 17 9 6 35 13 DFA for A 1 13 Basic Idea of Pumping Lemma (3) Since the length of string s is n, so the path consists of n+1 states. s1 s2 s3 s4 sn s = s5 s6 n+1 6 path = 1 3 20 9 17 9 6 35 13 DFA for A 1 13 n+1 states
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Basic Idea of Pumping Lemma (4) If n+1 is greater than the number of DFA states, then the path goes through some state at least twice. (here is state 9) s1 s2 s3 s4 sn s = s5 s6 n+1 7 path = 1 3 20 9 17 9 6 35 13 DFA for A 1 13 n+1 states Basic Idea of Pumping Lemma (5) Since the path goes through state 9 twice, there is a loop in the path. The loop starts from state 9 and ends at state 9 s1 s2 s3 s4 sn s = s5 s6 n+1 8 path = 1 3 20 9 17 9 6 35 13 DFA for A 1 13 9 n+1 states Basic Idea of Pumping Lemma (6) Now we divide the string s into three pieces x, y, and z. s1 s2 s3 s4 sn s = s5 s6 n+1 xy z 9 path = 1 3 20 9 17 9 6 35 13 DFA for A 1 13 9 n+1 states x y z Basic Idea of Pumping Lemma (7) Consider another string xz. x takes the machine from state 1 to state 9, and then z takes the machine from state 9 to state 13 (a final state). So, xz is also accepted by the machine s1 s2 s3 sn s6 xz 10 path = 1 3 20 9 6 35 13 DFA for A 1 13 9 x z Basic Idea of Pumping Lemma (8) s1 s2 s3 s4 sn s5 s6 z s4 s5 y String xyyz: x takes the machine from 1 to 9; first y takes the machine from 9 back to 9, as does the second y; and z takes the machine from 9 to 13 (final state). So, xyyz is also accepted by the machine 11 path = 1 3 20 9 17 9 17 9 6 35 13 DFA for A 1 13 9 x y z y Basic Idea of Pumping Lemma (9) So, for any integer i 0, we have xy i z is accepted by the machine s1 s2 s3 s4 sn s = s5 s6 z 12 path = 1 3 20 9 17 9 6 35 13 DFA for A 1 13 9 x y z
Background image of page 2
3 Pumping Lemma If A is a regular language, then there is a number p (called the pumping length) where, if s is any string in A with |s| p, then s may be divided into three pieces The pumping lemma describes a property of all regular languages.
Background image of page 3

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

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

Page1 / 7

ch1_9 - Pumping Lemma CSCE 428/828 Automata, Computation,...

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

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