It is algorithm related to subject Theory of Computing
Size: 1.3 MB
Language: en
Added: Jul 20, 2018
Slides: 33 pages
Slide Content
ACTIVE LEARNING ASSIGNMENT FOR THE SUBJECT “Theory of computation” PUMPING LEMMA Guided By : - Rimi Gupta (Assistance prof.) Prepared By :- Hemant H. Chetwani (130410107010 TY CE-II)
Non-regular languages (Pumping Lemma)
Regular languages Non-regular languages
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 !!!
The Pigeon hole Principle
pigeons pigeonholes
A pigeonhole must contain at least two pigeons
........... ........... pigeons pigeonholes
The Pigeonhole Principle ........... pigeons pigeonholes There is a pigeonhole with at least 2 pigeons
The Pigeon hole Principle and DFAs
Consider a DFA with states
Consider the walk of a “long’’ string: A state is repeated in the walk of (length at least 4)
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 Walk of .... .... .... Arbitrary DFA If , by the pigeonhole principle, a state is repeated in the walk In General:
Walk of Pigeons: Nests: (Automaton states) Are more than (walk states) .... .... .... .... ....
The Pumping Lemma
Take an infinite regular language There exists a DFA that accepts states (contains an infinite number of strings)
(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
Take to be the first state repeated .... There could be many states repeated .... .... Second occurrence First occurrence Unique states One dimensional projection of walk :
.... .... .... Second occurrence First occurrence One dimensional projection of walk : We can write
... ... In DFA: ... ... contains only first occurrence of
The string is accepted In General: ... ... ... Follow loop times ...
Therefore: Language accepted by the DFA ... ... ... ...
In other words, we described: The Pumping Lemma !!!
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)
Applications of the Pumping Lemma
Suppose you want to prove that An 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
Theorem: The language is not regular Proof: Use the Pumping Lemma Example of Pumping Lemma application Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma
with lengths From the Pumping Lemma: we can write Thus:
From the Pumping Lemma: Thus:
BUT: CONTRADICTION!!!
Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore: