cs373 fa10 hw10sol

# cs373 fa10 hw10sol - Solutions for Problem Set 9 CS 373...

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

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.

Unformatted text preview: Solutions for Problem Set 9 CS 373: Theory of Computation Assigned: November 30, 2010 Due on: December 7, 2010 at 10am Homework Problems Problem 1 . [Category: Design] Design a pushdown automaton to recognize the language in problem 2.23. You need not formally prove the correctness of your construction, but your construction should be clear and understandable, giving the intuition behind the states and the stack symbols and how the PDA works. Solution: Consider two n length strings x = x 1 ··· x n and y = y 1 ··· y n . If x 6 = y then there is a position i such that x i 6 = y i . Let us assume without loss of generality, x i = 0 and y i = 1. Then the string w = xy is going to be of the form w = x 1 ··· x i- 1 | {z } i- 1 chars n- i chars z }| { x i +1 ··· x n y 1 ··· y i- 1 | {z } i- 1 chars 1 n- i chars z }| { y i +1 ··· y n = x 1 ··· x i- 1 | {z } i- 1 chars x i +1 ··· x 2 i- 1 | {z } i- 1 chars n- i chars z }| { x 2 i ··· x n y 1 ··· y i- 1 1 n- i chars z }| { y i +1 ··· y n Thus, any string language D is the concatenation of two strings of odd length whose “centers” are different. So on a given input, the PDA will try to check if it has this property. It will read a string of odd length (deciding non-deterministically about when it ends), remember the center in its finite control, and then read...
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

cs373 fa10 hw10sol - Solutions for Problem Set 9 CS 373...

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

View Full Document
Ask a homework question - tutors are online