Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.

Similar presentations


Presentation on theme: "COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University."— Presentation transcript:

1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University pursuant to Part VB of the Copyright Act 1968 (the Act). The material in this communication may be subject to copyright under the Act. Any further reproduction or communication of this material by you may be the subject of copyright protection under the Act. Do not remove this notice.

2 Pumping Lemma for Regular Languages CSE2303 Formal Methods I Lecture 9

3 Overview Circuits Pumping Lemma Non-regular Languages Intersection of Regular Languages

4 A Circuit - + a a a a a a a b b b b b b b … abbab...

5 Definitions A circuit is a path which starts and ends at the same state. The length of a circuit is the number of edges in the path.

6 Observation Take any Finite Automaton. Take any string with has more letters than there are states in that Finite Automaton. Then the path taken when this string is used as input must contain a circuit.

7 - + a a a a a a a b b b b b b b babaaabbab

8 - + a a a a a a a b b b b b b b x y z

9 - + a a a a a a a b b b b b b b ba baaab baaab bab x y y z

10 - + a a a a a a a b b b b b b b babbabbabaaba

11 - + a a a a a a a b b b b b b b x y z

12 - + a a a a a a a b b b b b b b ba bbabba bbabba baaba x y y z

13 Pumping Lemma Let L be a regular language with an infinite number of words. Then there exists strings x, y, and z. Where –y   –xyz, xyyz,.., xy n z are words in L

14 Proof By Kleene’s theorem there is a Finite Automaton which defines L. Take a word in L with more letters than states in the finite automaton. Let –x be the letters up to the first circuit. –y be the letters corresponding to the circuit. –z be the remaining letters.

15 Consequence Using the Pumping Lemma we can show there are non-regular languages. Method –Assume L is regular –Then there exists x, y  , and z s.t. xy n z are words in L. –Show for some n > 1, xy n z is not a word in L. –Contradiction.

16 L = {a n b n } L = {  ab aabb aaabbb … } Assume L is regular Then there exists x, y  , and z s.t. xyz, xyyz,.., xy n z are words in L. Case 1 : y is all a ’s Case 2: y is all b ’s Case 3: y contains an ab Now consider xyyz

17 Intersection The intersection of the languages L 1 and L 2 is the set of words which belong to both L 1 and L 2. We denote the intersection of L 1 and L 2 by: L 1  L 2 E.g. L 1 = { abb baa} L 2 = { ab aa abb} L 1  L 2 ={ abb}

18 Intersection of Regular Languages Suppose L 1 and L 2 are regular languages. Then L 1  L 2 = ( L 1 ’ + L 2 ’)’ So L 1  L 2 is regular

19 EQUAL All words which have an equal number of a ’s as b ’s. {  ab ba aabb abab abba baba … } {a n b n } = EQUAL  a*b* EQUAL is non-regular

20 Theorem Let L be a regular language with an infinite number of words accepted by a FA with N states. Then for all words w in L with more than N letters. There exists strings x, y  , and z. Where –w = xyz –length(x) + length(y)  N –xyz, xyyz,.., xy n z are words in L

21 Proof Take any word w in L with more letters than N. Let –x be the letters up to the first circuit. –y be the letters corresponding to the circuit. –z be the remaining letters.

22 PALINDROME All the strings which are the same if they are spelt backwards E.g.  a b aa bb aaa aba bab bbb

23 PALINDROME is non-regular Assume PALINDROME is regular. Then exists a FA with N states which accepts PALINDROME. Let w = a N ba N There exists strings x, y  , and z s.t. –w = xyz –length(x) + length(y)  N –xyz, xyyz,.., xy n z are words in PALINDROME Consider xyyz.

24 Preparation Read –Chapters 12 of the Text Book Revision Know what the Pumping Lemma is used to show. Know some examples of non-regular languages.


Download ppt "COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University."

Similar presentations


Ads by Google