{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ch2 - ELEMENTS OF COMPUTATION THEORY Chapter 2...

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

Undergraduate Course ELEMENTS OF COMPUTATION THEORY College of Computer Science Chapter 2 Zhejiang University Fall-Winter, 2007 P 60 2.1.1 Let M be a deterministic finite automaton. Under exactly what cir- cumstances is e L ( M ) ? Prove your answer. Solution: e L ( M ) if and only if s F . / Suppose e L ( M ) . Then, by definition of L ( M ) , ( s, e ) * M ( q, e ) , where q F . Because it is not the case that ( s, e ) M ( q, w ) for any configuration ( q, w ) ( w 6 = e ). ( s, e ) * M ( q, e ) must be in the reflexive transitive closure of M by virtue of reflexivity - that is, ( s, e ) = ( q, e ) . Therefore, s = q and thus s F . / Suppose s F . Because * M is reflexive, ( s, e ) * M ( s, e ) . Because s F , we have e L ( M ) by definition of L ( M ) . 2.1.2 Describe informally the languages accepted by the following DFA. Solution: (c) All strings with the same number of a s and b s and in which no prefix has more than two b s than a s, or a s than b s. (d)All strings with the same number of a s and b s and in which no prefix has more than one more a than b , or vice-versa. 2.1.3 Construct DFA accepting each of the following languages. (c) { w ∈ { a, b } * : w has neither aa nor bb as a substring } . (e) { w ∈ { a, b } * : w has both ab and ba as a substring } .

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

View Full Document
Solution: (c) M = ( K, Σ , δ, sF ) , where K = { q 0 , q 1 , q 2 , q 3 } , Σ = { a, b } , s = q 0 , F = { q 0 , q 1 , q 2 } q a δ ( q, a ) q 0 a q 1 q 0 b q 2 q 1 a q 3 q 1 b q 2 q 2 a q 1 q 2 b q 3 q 3 a q 3 q 3 b q 3 (e) M = ( K, Σ
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

ch2 - ELEMENTS OF COMPUTATION THEORY Chapter 2...

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

View Full Document
Ask a homework question - tutors are online