80 likes | 223 Views
NONREGULAR LANGUAGES. To understand the power of finite automata you must also understand their limitations. Example. Consider two languages over the alphabet ∑ {0,1}: C = { ω I ω has an equal number of Os and Is}, and
E N D
NONREGULAR LANGUAGES To understand the power of finite automata you must also understand their limitations.
Example • Consider two languages over the alphabet ∑ {0,1}: • C = {ωIωhas an equal number of Os and Is}, and • D = {ωIωhas an equal number of occurrences of 01 and 10 as substrings}.
THE PUMPING LEMMA FOR REGULAR LANGUAGES • Our technique for proving nonregularity stems from a theorem about regular languages, traditionally called the pumping lemma. • This theorem states that all regularlanguages have a special property. If we can show that a language does not have this property, we are guaranteed that it is not regular. • p - pumping length
THEOREM 1.70 - Pumping lemma • If A is a regular language, then there is a number p (the pumping length) where, if s is any string in A of length at least p, then s may be dividedinto three pieces, s = xyz, satisfying the following conditions: • 1. for each i> 0, xyiz E A, • 2. |y| > 0, and • 3. |xy|< p.
EXAMPLE 1.73 Let B be the language {on1n|n > 0}. • Assume that B is regular. • Let p be the pumping length given by the pumping lemma. • Choose s to be the string 0P1P • s < p ??? If yes • the pumping lemma guarantees that s can be split into three pieces, s = xyz • Conditions???????????????????????
EXAMPLE 1.75 Let F = {ωω| ω є{0,1}*}. • Assume that F is regular. • Let p be the pumping length given by the pumping lemma. • Choose s to be the string 0P10P, OPOP , …….. • s < p ??? If yes • the pumping lemma guarantees that s can be split into three pieces, s = xyz • Conditions???????????????????????