{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Problem_Set_02

# Problem_Set_02 - w 1/4(W ARSDIGITA VNIVERSITY Month 8...

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

A R S D I G I T A V N I V E R S I T Y Month 8: Theory of Computation Problem Set 2 Solutions - Mike Allen and Dimitri Kountourogiannis 1. Minimizing DFAs 2. Regular or Not? a. NOT. (1.17b) {www | w is {a,b}*} Assume that the language is regular. Let p be the pumping length, and choose s to be the string 0 p 10 p 10 p 1. Now we try to break it up into s=xyz. Since |xy| <= p and |y|>0, y can only contain 0's. When we pump the string even just once we get xy 2 z = 0 p+|y| 10 p 10 p 1, and this is not of the form www, since |y| > 0. This contradicts the pumping lemma, so the language is not regular. b. NOT. (1.23c) {0 m 1 n | m is not equal to n} We know that {0 n 1 n | n >= 0} = {0 m 1 n | m,n >= 0}^{0*1*} c , where we are using ^ to denote intersection and c to denote complement. The proof is by contradiction. If {0 m 1 n | m is not equal to n} really were regular then {0 n 1 n | n >= 0} would also be regular because 0*1* is regular and because of the closure properties of regular sets. Therefore it can't be regular There is a direct way to prove it as well: If p is the pumping length and we take the string s = 0 p 1 p+p! , then no matter what the decomposition s = xyz is the string xy 1+p!/|y| z will equal 0 p+p! 1 p+p! which is not in the language. c. NOT. (1.23a) {0 m 1 n 0 m | m,n >= 0} Assume that the language is regular. Let p be the pumping length, and choose s to be the string 0 p 10 p . Now we try to break it up into s=xyz. Since |xy| <= p, y can only have zeros in it. Now xy j z = 0 p+ (j-1) |y| 10 p , and since |y|>0 the number of 0's on the left and right sides of xy j z will not be the same for any j>1 so xy j z will not be in the language, a. Convert to a DFA b. Convert to a minimal DFA c. Conver to a regular expression: 0 + (00 + 1 + 11)00* d. Convert to a regular grammar using the NFA: A -> 0 | 0B | 1C | 1D B -> 0D C -> 1D D -> 0 | 0D Using the DFA: S -> 0A | 1B A -> 0C | e B -> 0D | 1C C -> 0D Using the regular expression: S -> 0 | 110A | 000A | 10A A -> 0 | 0A | e 页码， 1/4(W) w 2/19/2011 http://aduni.org/courses/theory/courseware/psets/Problem_Set_02_Solutions.html

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

View Full Document
contradicting the pumping lemma. Therefore {0
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

Problem_Set_02 - w 1/4(W ARSDIGITA VNIVERSITY Month 8...

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

View Full Document
Ask a homework question - tutors are online