ch2 - ELEMENTS OF COMPUTATION THEORY Chapter 2...

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

View Full Document Right Arrow Icon
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 } .
Background image of page 1

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

View Full DocumentRight Arrow Icon
Solution: (c) M = ( K, Σ ,δ,sF ) , where K = { q 0 ,q 1 ,q 2 ,q 3 } , Σ = { a,b } , s
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online