hw2-sol

# hw2-sol - ECS 120 Theory of Computation Homework 2 Due Oct...

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: ECS 120: Theory of Computation Homework 2 Due: Oct. 12, beginning of class or noon in 2131 Kemper Problem 1. Show that if M = ( Q, Σ , δ, q , F ) is a DFA accepting the language L then M = ( Q, Σ , δ, q , Q − F ) is a DFA accepting the complement of L , L . Solution: Let M and M be as stated above, and L = L ( M ). Then, by definition, L = { w 1 | ˆ δ ( q , w 1 ) ∈ F } . By definition, L , the complement of L , contains all words over Σ that are not in L , or all words not accepted by M , i.e. L = { w 2 | ˆ δ ( q , w 2 ) 6∈ F } . This is equivalent to L = { w 2 | ˆ δ ( q , w 2 ) ∈ Q \ F } , which, by definition, is accepted by M , i.e. L = L ( M ). Problem 2. (a) Show that there is an ( n + 2)-state NFA for L n = (Σ ∗ )0Σ n . (Take Σ = { , 1 } .) Just draw it! (b) Prove that any DFA for L n requires at least 2 n states. Fix n . Suppose to the contrary that there exists a DFA M = ( Q, Σ , δ, q , F ) for L n that has fewer than 2 n states. Consider all possible strings x 1 , . . . , x 2 n of Σ n (all 2 n of them). By the pigeonhole principle, some two of these strings, x i and x j , where x i 6 = x j , must “collide” when processed by M n ; that is, ˆ δ ( q , x i ) = ˆ δ ( q , x j )....
View Full Document

## This note was uploaded on 05/06/2008 for the course ECS 120 taught by Professor Filkov during the Fall '07 term at UC Davis.

### Page1 / 3

hw2-sol - ECS 120 Theory of Computation Homework 2 Due Oct...

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

View Full Document
Ask a homework question - tutors are online