COSC 3340 Introduction to Theory of Computation University

  • Slides: 7
Download presentation
COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 8

COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 8 1 Lecture 8 Uof. H - COSC 3340 - Dr. Verma

Pumping lemma applications. l Proving L = {anbn | n 0 } is not

Pumping lemma applications. l Proving L = {anbn | n 0 } is not regular. Proof: Assume L is regular. Certainly L is infinite and therefore the pumping lemma applies to L. Let p be the constant for L (of the pumping lemma). 2 Lecture 8 Uof. H - COSC 3340 - Dr. Verma

Pumping lemma applications (contd. ) To show there exist a string w L of

Pumping lemma applications (contd. ) To show there exist a string w L of length at least p such that Q where Q is the rest of the statement of pumping lemma. Let w = apbp write such that |w| p apbp = xyz But according to pumping lemma, 3 Lecture 8 Uof. H - COSC 3340 - Dr. Verma

Pumping lemma applications (contd. ) PL statement (i) |xy| p p Therefore, p a…aa…ab…b

Pumping lemma applications (contd. ) PL statement (i) |xy| p p Therefore, p a…aa…ab…b x y y = am z m>0 xyz = apbp 4 Lecture 8 Uof. H - COSC 3340 - Dr. Verma

Pumping lemma applications (contd. ) PL statement (ii) xyiz L i = 0, 1,

Pumping lemma applications (contd. ) PL statement (ii) xyiz L i = 0, 1, 2, 3, … Therefore, xy 2 z L xy 2 z = xyyz = ak+mbk L But, L = {anbn | n 0 } which means ap+mbp L since m > 0 CONTRADICTION !! 5 Lecture 8 Uof. H - COSC 3340 - Dr. Verma

Pumping lemma applications (contd. ) Therefore our assumption that L = {anbn | n

Pumping lemma applications (contd. ) Therefore our assumption that L = {anbn | n 0 } is a regular language cannot be true. 6 Lecture 8 Uof. H - COSC 3340 - Dr. Verma

Using Pumping Lemma -- Very Important points l l Above example is the typical

Using Pumping Lemma -- Very Important points l l Above example is the typical application of pumping lemma, to show that a language is not regular. You must choose string w so that w in L and |w| is at least the pumping length. – l l 7 Example: choosing w = aaabbb is wrong since we do not know the exact value of p. You must consider all possibilities for x, y and z such that w = xyz and |xy| p. The pumping lemma CANNOT be used to show that a language is regular, since it assumes that L is regular. Lecture 8 Uof. H - COSC 3340 - Dr. Verma