Download presentation
Presentation is loading. Please wait.
Published byBridget Glenn Modified over 9 years ago
1
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
2
Prof. Busch - LSU2 Regular languages Non-regular languages
3
Prof. Busch - LSU3 How can we prove that a language is not regular? Prove that there is no DFA or NFA or RE that accepts Difficulty: this is not easy to prove ( since there is an infinite number of them) Solution: use the Pumping Lemma !!!
4
Prof. Busch - LSU4 The Pigeonhole Principle
5
Prof. Busch - LSU5 pigeons pigeonholes
6
Prof. Busch - LSU6 A pigeonhole must contain at least two pigeons
7
Prof. Busch - LSU7........... pigeons pigeonholes
8
Prof. Busch - LSU8 The Pigeonhole Principle........... pigeons pigeonholes There is a pigeonhole with at least 2 pigeons
9
Prof. Busch - LSU9 The Pigeonhole Principle and DFAs
10
Prof. Busch - LSU10 Consider a DFA with states
11
Prof. Busch - LSU11 Consider the walk of a “long’’ string: A state is repeated in the walk of (length at least 4)
12
Prof. Busch - LSU12 Pigeons: Nests: (Automaton states) Are more than Walk of The state is repeated as a result of the pigeonhole principle (walk states) Repeated state Repeated state
13
Prof. Busch - LSU13 Consider the walk of a “long’’ string: A state is repeated in the walk of (length at least 4) Due to the pigeonhole principle:
14
Prof. Busch - LSU14 Automaton States Pigeons: Nests: (Automaton states) Are more than Walk of The state is repeated as a result of the pigeonhole principle: (walk states) Repeated state
15
Prof. Busch - LSU15...... Repeated state Walk of.... Arbitrary DFA If, by the pigeonhole principle, a state is repeated in the walk In General:
16
Prof. Busch - LSU16 Walk of Pigeons: Nests: (Automaton states) Are more than (walk states).... A state is repeated Number of states in walk is at least
17
Prof. Busch - LSU17 The Pumping Lemma
18
Prof. Busch - LSU18 Take an infinite regular language There exists a DFA that accepts states (contains an infinite number of strings)
19
Prof. Busch - LSU19 (number of states of DFA) then, at least one state is repeated in the walk of...... Take string with Walk in DFA of Repeated state in DFA
20
Prof. Busch - LSU20 Take to be the first state repeated.... There could be many states repeated.... Second occurrence First occurrence Unique states One dimensional projection of walk :
21
Prof. Busch - LSU21.... Second occurrence First occurrence One dimensional projection of walk : We can write
22
Prof. Busch - LSU22... In DFA:... Where corresponds to substring between first and second occurrence of
23
Prof. Busch - LSU23 Observation:lengthnumber of states of DFA Since, in no state is repeated (except q) unique states in... Because of
24
Prof. Busch - LSU24 Observation:length Since there is at least one transition in loop...
25
Prof. Busch - LSU25 We do not care about the form of string... may actually overlap with the paths of and
26
Prof. Busch - LSU26 The string is accepted Additional string:... Do not follow loop...
27
Prof. Busch - LSU27 The string is accepted... Follow loop 2 times Additional string:...
28
Prof. Busch - LSU28 The string is accepted... Follow loop 3 times Additional string:...
29
Prof. Busch - LSU29 The string is accepted In General:... Follow loop times...
30
Prof. Busch - LSU30 Therefore: Language accepted by the DFA...
31
Prof. Busch - LSU31 In other words, we described: The Pumping Lemma !!!
32
Prof. Busch - LSU32 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we can write with and such that: (critical length)
33
Prof. Busch - LSU33 In the book: Critical length = Pumping length
34
Prof. Busch - LSU34 Applications of the Pumping Lemma
35
Prof. Busch - LSU35 Observation: Every language of finite size has to be regular Therefore, every non-regular language has to be of infinite size (contains an infinite number of strings) (we can easily construct an NFA that accepts every string in the language)
36
Prof. Busch - LSU36 Suppose you want to prove that αn infinite language is not regular 1. Assume the opposite: is regular 2. The pumping lemma should hold for 3. Use the pumping lemma to obtain a contradiction 4. Therefore, is not regular
37
Prof. Busch - LSU37 Explanation of Step 3: How to get a contradiction 2. Choose a particular string which satisfies the length condition 3. Write 4. Show thatfor some 5. This gives a contradiction, since from pumping lemma 1. Let be the critical length for
38
Prof. Busch - LSU38 Note: It suffices to show that only one string gives a contradiction You don’t need to obtain contradiction for every
39
Prof. Busch - LSU39 Theorem: The language is not regular Proof: Use the Pumping Lemma Example of Pumping Lemma application
40
Prof. Busch - LSU40 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma
41
Prof. Busch - LSU41 Let be the critical length for Pick a string such that: and length We pick
42
Prof. Busch - LSU42 with lengths From the Pumping Lemma: we can write Thus:
43
Prof. Busch - LSU43 From the Pumping Lemma: Thus:
44
Prof. Busch - LSU44 From the Pumping Lemma: Thus:
45
Prof. Busch - LSU45 BUT: CONTRADICTION!!!
46
Prof. Busch - LSU46 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore: END OF PROOF
47
Prof. Busch - LSU47 Regular languages Non-regular language
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.