08 - 8: Proving that a language is not regular Example: L =...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
8: Proving that a language is not regular Example: ±L= { 0 n 1 n | n 0 } is not a regular language. Intuitively, this language L is not regular because any machine that can recognize L must remember how many 0’s have been seen so far (i.e. unlimited number of pos- sibilities). But, this argument is not a proof! Our intuition can sometimes lead us astray. L 1 = { w | w has an equal number of 0’s and 1’s } L 2 = { w | w has an equal number of occurences of 01 and 10 as substrings } Are they regular? 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Proving a language is not regular Pumping Theorem (or Pumping Lemma) It is a property of all (inFnite) regular languages. Informally, the P.T. says that, for any regular language L , every string in L that is longer than a certain special length can be “ pumped ” (with the resulting string always in L ). That is, for any regular language L that is inFnite, there must be some repetitive pattern(s) that correspond to a Kleene star in a regular expression or a cycle in a state diagram. b a a a q b b p s 2
Background image of page 2
Suppose there are n 1 pigeonholes and m>n pigeons. Then at least one of the pigeonhole must contain at least two pigeons. Equivalently, If A and B are nonempty Fnite sets and | A | > | B | ,then there is no one-one function from A to B . Proof :Le t f : A B . Basis step: | B | =0 . No function can be deFned. Hence no one-one function can be deFned. Induction hypothesis: Suppose f is not one-one when- ever | A | > | B | , | B |≤ n for some n 0 Inductive step: Consider the case | B | = n +1. Choose some a A . Case i) There is another a ± A s.t. f ( a )= f ( a ± ). Then f is not one-one. Case ii) a is the only element mapped to f ( a ). DeFne g : A −{ a }→ B −{ f ( a ) } as g ( x )= f ( x ) for all x A −{ a }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/22/2011 for the course COMP 272 taught by Professor Prof.tai during the Spring '10 term at HKUST.

Page1 / 12

08 - 8: Proving that a language is not regular Example: L =...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online