# courtesy costas busch - rpi1 non-regular languages

Post on 21-Dec-2015

218 views

Category:

## Documents

Tags:

• #### courtesy costas busch

Embed Size (px)

TRANSCRIPT

• Slide 1
• Courtesy Costas Busch - RPI1 Non-regular languages
• Slide 2
• Courtesy Costas Busch - RPI2 Regular languages Non-regular languages
• Slide 3
• Courtesy Costas Busch - RPI3 How can we prove that a language is not regular? Prove that there is no DFA that accepts Problem: this is not easy to prove Solution: the Pumping Lemma !!!
• Slide 4
• Courtesy Costas Busch - RPI4 The Pigeonhole Principle
• Slide 5
• Courtesy Costas Busch - RPI5 pigeons pigeonholes
• Slide 6
• Courtesy Costas Busch - RPI6 A pigeonhole must contain at least two pigeons
• Slide 7
• Courtesy Costas Busch - RPI7........... pigeons pigeonholes
• Slide 8
• Courtesy Costas Busch - RPI8 The Pigeonhole Principle........... pigeons pigeonholes There is a pigeonhole with at least 2 pigeons
• Slide 9
• Courtesy Costas Busch - RPI9 The Pigeonhole Principle and DFAs
• Slide 10
• Courtesy Costas Busch - RPI10 DFA with states
• Slide 11
• Courtesy Costas Busch - RPI11 In walks of strings:no state is repeated
• Slide 12
• Courtesy Costas Busch - RPI12 In walks of strings:a state is repeated
• Slide 13
• Courtesy Costas Busch - RPI13 If string has length : Thus, a state must be repeated Then the transitions of string are more than the states of the DFA
• Slide 14
• Courtesy Costas Busch - RPI14 In general, for any DFA: String has length number of states A state must be repeated in the walk of...... walk of Repeated state
• Slide 15
• Courtesy Costas Busch - RPI15 In other words for a string : transitions are pigeons states are pigeonholes...... walk of Repeated state
• Slide 16
• Courtesy Costas Busch - RPI16 The Pumping Lemma
• Slide 17
• Courtesy Costas Busch - RPI17 Take an infinite regular language There exists a DFA that accepts states
• Slide 18
• Courtesy Costas Busch - RPI18 Take string with There is a walk with label :......... walk
• Slide 19
• Courtesy Costas Busch - RPI19 If string has length (number of states of DFA) then, from the pigeonhole principle: a state is repeated in the walk...... walk
• Slide 20
• Courtesy Costas Busch - RPI20...... walk Let be the first state repeated in the walk of
• Slide 21
• Courtesy Costas Busch - RPI21 Write......
• Slide 22
• Courtesy Costas Busch - RPI22...... Observations:lengthnumber of states of DFA length
• Slide 23
• Courtesy Costas Busch - RPI23 The string is accepted Observation:......
• Slide 24
• Courtesy Costas Busch - RPI24 The string is accepted Observation:......
• Slide 25
• Courtesy Costas Busch - RPI25 The string is accepted Observation:......
• Slide 26
• Courtesy Costas Busch - RPI26 The string is accepted In General:......
• Slide 27
• Courtesy Costas Busch - RPI27 In General:...... Language accepted by the DFA
• Slide 28
• Courtesy Costas Busch - RPI28 In other words, we described: The Pumping Lemma !!!
• Slide 29
• Courtesy Costas Busch - RPI29 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we can write with and such that:
• Slide 30
• Courtesy Costas Busch - RPI30 Applications of the Pumping Lemma
• Slide 31
• Courtesy Costas Busch - RPI31 Theorem: The language is not regular Proof: Use the Pumping Lemma
• Slide 32
• Courtesy Costas Busch - RPI32 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma
• Slide 33
• Courtesy Costas Busch - RPI33 Let be the integer in the Pumping Lemma Pick a string such that: length We pick
• Slide 34
• Courtesy Costas Busch - RPI34 it must be that length From the Pumping Lemma Write: Thus:
• Slide 35
• Courtesy Costas Busch - RPI35 From the Pumping Lemma: Thus:
• Slide 36
• Courtesy Costas Busch - RPI36 From the Pumping Lemma: Thus:
• Slide 37
• Courtesy Costas Busch - RPI37 BUT: CONTRADICTION!!!
• Slide 38
• Courtesy Costas Busch - RPI38 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:
• Slide 39
• Courtesy Costas Busch - RPI39 Regular languages Non-regular languages
• Slide 40
• Courtesy Costas Busch - RPI40 Regular languages Non-regular languages
• Slide 41
• Courtesy Costas Busch - RPI41 Theorem: The language is not regular Proof: Use the Pumping Lemma
• Slide 42
• Courtesy Costas Busch - RPI42 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma
• Slide 43
• Courtesy Costas Busch - RPI43 We pick Let be the integer in the Pumping Lemma Pick a string such that: length and
• Slide 44
• Courtesy Costas Busch - RPI44 Write it must be that length From the Pumping Lemma Thus:
• Slide 45
• Courtesy Costas Busch - RPI45 From the Pumping Lemma: Thus:
• Slide 46
• Courtesy Costas Busch - RPI46 From the Pumping Lemma: Thus:
• Slide 47
• Courtesy Costas Busch - RPI47 BUT: CONTRADICTION!!!
• Slide 48
• Courtesy Costas Busch - RPI48 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:
• Slide 49
• Courtesy Costas Busch - RPI49 Regular languages Non-regular languages
• Slide 50
• Courtesy Costas Busch - RPI50 Theorem: The language is not regular Proof: Use the Pumping Lemma
• Slide 51
• Courtesy Costas Busch - RPI51 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma
• Slide 52
• Courtesy Costas Busch - RPI52 We pick Let be the integer in the Pumping Lemma Pick a string such that: length and
• Slide 53
• Courtesy Costas Busch - RPI53 Write it must be that length From the Pumping Lemma Thus:
• Slide 54
• Courtesy Costas Busch - RPI54 From the Pumping Lemma: Thus:
• Slide 55
• Courtesy Costas Busch - RPI55 From the Pumping Lemma: Thus:
• Slide 56
• Courtesy Costas Busch - RPI56 BUT: CONTRADICTION!!!
• Slide 57
• Courtesy Costas Busch - RPI57 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:
• Slide 58
• Courtesy Costas Busch - RPI58 Regular languages Non-regular languages
• Slide 59
• Courtesy Costas Busch - RPI59 Theorem: The language is not regular Proof: Use the Pumping Lemma
• Slide 60
• Courtesy Costas Busch - RPI60 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma
• Slide 61
• Courtesy Costas Busch - RPI61 We pick Let be the integer in the Pumping Lemma Pick a string such that: length
• Slide 62
• Courtesy Costas Busch - RPI62 Write it must be that length From the Pumping Lemma Thus:
• Slide 63
• Courtesy Costas Busch - RPI63 From the Pumping Lemma: Thus:
• Slide 64
• Courtesy Costas Busch - RPI64 From the Pumping Lemma: Thus:
• Slide 65
• Courtesy Costas Busch - RPI65 Since: There must exist such that:
• Slide 66
• Courtesy Costas Busch - RPI66 However:for for any
• Slide 67
• Courtesy Costas Busch - RPI67 BUT: CONTRADICTION!!!
• Slide 68
• Courtesy Costas Busch - RPI68 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:
• Slide 69
• 69 Summary Showing regular construct DFA, NFA construct regular expression show L is the union, concatenation, intersection (regular operations) of regular languages. Showing non-regular pumping lemma assume regular, apply closure properties of regular languages and obtain a known non-regular language.

Recommended