{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Chapter1Section4_F11

# Chapter1Section4_F11 - 91.304 Foundations of(Theoretical...

This preview shows pages 1–8. Sign up to view the full content.

91.304 Foundations of (Th ti l) C t S i (Theoretical) Computer Science Chapter 1 Lecture Notes (Section 1.4: Nonregular Languages) David Martin d @ l d [email protected] With some modifications by Prof. Karen Daniels, Fall 2011 This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by- 1 sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

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

View Full Document
§ 1.4 Nonregular languages F h ibl l L For each possible language L, L. So is the smallest language. And is regular L Σ * . So Σ * is the largest language. And Σ * is regular Yet there are languages in between these two extremes that are not regular 2
A nonregular language B = { 0 n 1 n | n 0 } B { 0 = { ε , 01, 0011, 000111, L } is not regular Why? f Q: how many bits of memory would a DFA need in order to recognize B? A: there appears to be no single number of bits h ' b h k f l f that's big enough to work for every element of B Remember, the DFA needs to reject all strings that are not in B 3

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

View Full Document
Other examples C = { w {0 1} * | n 0 (w) = n 1 (w) } {0,1} Needs to count a potentially unbounded number of '0's... so nonregular D = { w {0,1} * | n 01 (w) = n 10 (w) } Needs to count a potentially unbounded number of '01' substrings... so ?? Need a technique for establishing l it th t i f l nonregularity that is more formal and... less intuitive? 4
Proving nonregularity To prove that a language is nonregular you that a language is nonregular, you have to show that no DFA whatsoever recognizes the language Not just the DFA that is your best effort at recognizing the language The pumping lemma can be used to do that The pumping lemma says that every regular language satisfies the "regular pumping property " ( RPP ) Gi thi if h th t l lik B Given this, if we can show that a language like B doesn't satisfy the RPP, then it's not regular B = { 0 n 1 n | n 0 } 5

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

View Full Document
Pumping lemma, informally Roughly: "if a regular Roughly: if a regular language contains any 'long' strings, then it contains i fi it l t i " infinitely many strings" Start with a regular language and suppose that some DFA M=(Q, Σ , δ ,q 0 ,F) for it has |Q|=10 states. Wh t if M t q 0 What if M accepts some particular string s where s=c 1 c 2 L c 15 so that |s|=15? 6 1 2
Pigeonhole principle With 15 input characters the machine will visit at With 15 input characters, the machine will visit most 16 states But there are only 10 states in this machine So clearly it will visit at least one of its states more th than once Let rpt

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 24

Chapter1Section4_F11 - 91.304 Foundations of(Theoretical...

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

View Full Document
Ask a homework question - tutors are online