{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ch1 - b then two repetitions of a and finally aero...

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

View Full Document Right Arrow Icon
Undergraduate Course ELEMENTS OF COMPUTATION THEORY College of Computer Science Chapter 1 Zhejiang University Fall-Winter, 2007 P 46 1.7.4 Show each of the following. (c) If a and b are distinct symbols, then { a, b } * = { a } * ( { b }{ a } * ) * . (d) If Σ is an alphabet, e L 1 Σ * and e L 2 Σ * , then ( L 1 Σ * L 2 ) = Σ * . Solution: (c) It is obvious that { a } * ( { b }{ a } * ) * ⊆ { a, b } * . On the other hand, suppose that w ∈ { a, b } * , then w = a * or w = a * ba * ba * · · · ba * ∈ { a } * ( { b }{ a } * ) * . (d) Suppose w ( L 1 Σ * L 2 ). Then w = xyz , where x L 1 Σ * , y Σ * , z L 2 Σ * . Thus xyz * ) * = Σ * . On the other hand, suppose w Σ * . Then because e L 1 and e L 2 , w = ewe ( L 1 Σ * L 2 ). 1.7.6 Under what circumstances is L + = L * - { e } ? Solution: L + = L * - { e } exactly when e 6∈ L . P 51 1.8.3 Let Σ = { a, b } . Write regular expressions for the following sets: (c) All strings in Σ * with exactly one occurrence of the substring aaa . Solution: (( a aa b * ) b ) * aaa ( bb * ( a aa b * )) * .
Background image of page 1

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

View Full Document Right Arrow Icon
1.8.5 Which of the following are true? Explain. (a) baa a * b * a * b * (b) b * a * a * b * = a * b * (c) a * b * b * a * = (d) abcd ( a ( cd ) * b ) * Solution: (a) true. baaa consists of zero repetitions of a , followed by one repetition of
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b , then two repetitions of a , and finally aero repetitions of b . (b) true. Any string described by a * b * consists of s string of a s followed by a string b s. If b * a * also describes this string, then there cannot be any as followed by a b in the string, so either there are zero a s or zero b s, making it into a string of any num-ber of a s or a string of any number of b s, by taking zero repetitions of b or a , res-pectively. (c) false. Any string consisting only of b s is described both by a * b * and by b * c * , so that their intersection is not the empty set, but rather b * . (d) false. If d appears in a string described by ( a ( cd ) * b ) * , it must be immediately followed by a c or a b . But this is not the case in abcd ....
View Full Document

{[ snackBarMessage ]}