cs373 fa10 hw1sol

# cs373 fa10 hw1sol - Solutions for Problem Set 1 CS 373:...

This preview shows pages 1–3. 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 1 CS 373: Theory of Computation Assigned: August 31, 2010 Due on: September 7, 2010 Homework Problems Problem 1 . [Category: Comprehension+Proof] Consider the following DFA M over the alphabet { , 1 } . A B C D 1 1 1 , 1 Figure 1: DFA M for Problems 1 and 2 1. Describe formally what the following are for automaton M : set of states, initial state, final states, and transition function. [2 points] 2. What are ˆ δ ( A, ), ˆ δ ( A, 1011), ˆ δ ( B, 010), and ˆ δ ( C, 100)? [2 points] 3. What is L ( M )? Prove your answer. [5 points] 4. What is the language recognized if we change the initial state to B ? What is the language recognized if we change the set of final states to be { B } (with initial state A )? [1 points] Solution: 1. States: { A,B,C,D } ; Initial state: A ; Final states: { A } ; and transitions given by the following matrix 1 A D B B A C C C C D C D 2. ˆ δ ( A, ) = A ; ˆ δ ( A, 1011) = C ; ˆ δ ( B, 010) = A ; ˆ δ ( C, 100) = C . 3. Let us call a string w ∈ { , 1 } * to be proper if in every prefix u of w has at most one more 0 than 1 and at most one more 1 than 0. Then L ( M ) = { w ∈ { , 1 } * | w is proper and has equal number of 0s and 1s } 1 We will establish by induction on | w | the following statements (a) ˆ δ ( A,w ) ∈ { A } iff w ∈ L ( M ) (b) ˆ δ ( B,w ) ∈ { A } iff w = 0 u where u ∈ L ( M ) (c) ˆ δ ( C,w ) ∈ { A } iff w ∈ ∅ (d) ˆ δ ( D,w ) ∈ { A } iff w = 1 u where u ∈ L ( M ) Base Case: Since | w | = 0, we know that w = . Observe that ∈ L ( M ) and ˆ δ ( q, ) = q for any q ∈ {...
View Full Document

## This note was uploaded on 10/04/2011 for the course CS 373 taught by Professor Viswanathan,m during the Fall '08 term at University of Illinois, Urbana Champaign.

### Page1 / 4

cs373 fa10 hw1sol - Solutions for Problem Set 1 CS 373:...

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

View Full Document
Ask a homework question - tutors are online