This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS 503 Foundations of Computer Science 01/1803/06 2012 at Cisco Solutions for Homework 1 1. Exercise 30 on page 60. Solution: The set of strings over { a,b } that do not begin with the substring aaa is represented by ( λ ∪ a ∪ aa )( λ ∪ b + ( a ∪ b ) * ) (15 points) 2. Exercise 34 on page 61. Solution: The set of even length strings over { a,b } is represented by (( a ∪ b )( a ∪ b )) * and the set of odd length strings is represented by ( a ∪ b )(( a ∪ b )( a ∪ b )) * Therefore the set of odd length strings over { a,b } which contain bb is represented by (( a ∪ b )( a ∪ b )) * bb ( a ∪ b )(( a ∪ b )( a ∪ b )) * [ ( a ∪ b )(( a ∪ b )( a ∪ b )) * bb (( a ∪ b )( a ∪ b )) * (15 points) 3. Exercise 39.d on page 61. Solution: ( a ∪ b ) * = ( a ∪ ba * ) * = ( a * ∪ ba * ) * Here in the first equality we have used the third regular expression identity in 12. of Table 2.1, and in the second equality we have used the first identity in 12. (15 points) 1 4. Let Σ be an alphabet, and4....
View
Full Document
 Spring '12
 JOHN
 Computer Science, Formal language, Regular expression, Regular language, Pattern matching

Click to edit the document details