Docsity

Non Regular Languages - Lecture Notes | CSCI 2400, Study notes of Computer Science

Partial preview of the text

Download Non Regular Languages - Lecture Notes | CSCI 2400 and more Study notes Computer Science in PDF only on Docsity!

Non-regular languages

Regular languages a * b b c  a etc ... b  c( a  b) * Non-regular languages {a b : n  0 } n n {vv : v {a,b }} R 

The Pigeonhole Principle

pigeons pigeonholes

........... ........... pigeons pigeonholes n m n^  m

The Pigeonhole Principle ........... pigeons pigeonholes n m n  m There is a pigeonhole with at least 2 pigeons

DFA with 4 states 1 q 2 q 3 q a b 4 q b b b b a a

1 q 2 q 3 q a b 4 q b b b a a a In walks of strings: aab aa a (^) no state is repeated

If string has length : 1 q 2 q 3 q a b 4 q b b b a a a w |^ w| ^4 Thus, a state must be repeated Then the transitions of string are more than the states of the DFA w

In general, for any DFA: String (^) w has length (^)  number of states A state q must be repeated in the walk ofw ...... (^) q ...... walk of (^) w Repeated state

The Pumping Lemma

Take an infinite regular languageL There exists a DFA that accepts L m states

If string w^ has length |^ w^ |  m (number of states of DFA) hen, from the pigeonhole principle: a state is repeated in the walkw ...... q ...... walk w

q ...... q ...... walk w Let be the first state repeated in the walk of w