Problem_Set_03

Problem_Set_03 - A R S D I G I T A V N I V E R S I T Y...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 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 3 Solutions - Mike Allen 1. NPDAs Construct non-deterministic pushdown automata to accept the following languages. a. {1 n n | n>0} b. {0 n 1 2n | n>=0} c. {1 n n | n>0} U {0 n 1 2n | n>=0} d. (0+1)* - {ww | w in {0,1}*} (complement of ww) 2. DPDAs Construct deterministic pushdown automata to accept the following languages. a. {10 n 1 n | n>0} U {110 n 1 2n | n>0} 1/6(W) w 2/19/2011 http://aduni.org/courses/theory/courseware/psets/Problem_Set_03_Solutions.html b. Binary strings tha contain an equal number of 1s and 0s. c. Binary strings with twice as many 1s as 0s. d. Binary strings that start and end with the same symbol and have the same number of 0s as 1s. 3. CFGs Construct context free grammars to accept the following languages. a. (2.4b) {w | w starts and ends with the same symbol} S -> 0A0 | 1A1 A -> 0A | 1A | e b. (2.4c) {w | |w| is odd} 2/6(W) w 2/19/2011 http://aduni.org/courses/theory/courseware/psets/Problem_Set_03_Solutions.html S -> 0A | 1 A -> 0S | 1S | e c. (2.4d) {w | |w| is odd and its middle symbol is 0} S -> 0 | 0S0 | 0S1 | 1S0 | 1S1 d. {0 n 1 n | n>0} U {0 n 1 2n | n>0} S -> 0A1 | 0B11 A -> 0A1 | e B -> 0B11 | e e. {0 i 1 j 2 k | i!=j or j!=k} S -> AC | BC | DE | DF A -> 0 | 0A | 0A1 B -> 1 | B1 | 0B1 C -> 2 | 2C...
View Full Document

Page1 / 6

Problem_Set_03 - A R S D I G I T A V N I V E R S I T Y...

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