hmwk2

# hmwk2 - Johny Nguyen October 5, 2010 CS 473...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Johny Nguyen October 5 , 2010 CS 473 Homework 2 Downey th Problem 1 1. baa ∈ L(a*b*a*b*)? Yes. Say the first a* yields the empty string. The first b* yields one b, then we will have ‘b’. Let the second a* yield ‘aa’, and the last b* yield the empty string. We will have ‘baa’. 2. b*a* ∩ a*b* = a* ∪ b*? Yes, because both a* and b* is contained in both b*a* and a*b*. Any concatenations that have both a and b will not be included in the intersection. So only a* and b* will be the only common items in the intersection. 3. a*b* ∩ c*d* = ∅? No, because each set has the empty string. So the intersection will have the empty string in it as well. 4. abcd ∈ L( ( a( cd ) * b) * )? No, because no matter what, the letter ‘b’ will never appear before ‘c’ or ‘d’ based on the ordering of the concatenation. Problem 2 a. L = { w | each a in w is immediately preceded and immediately followed by a b} b. L = { w | w has abab as a substring} c. L = { w | w has neither aa nor bb as a substring} d. L = { w | w has an odd number of a’s an even number of b’s} e. L = { w | w has both ab and ba as substrings} Problem 3 a. L = { xy | x and y are binary strings that each contain the same substring of length 3} b. L = {w | w is a binary string containing both the substring 010 and the substring 101 Problem 4 a. Original NFA Final DFA b. Original NFA Final DFA Problem 5 a. Original NFA Regular Expression: a*(ba*)* b. Original NFA Regular Expression: [(a ∪ b) a*(ba*)*] ∪ [(a ∪ b) a*(ba*)*a] Problem 6 a. a(abb)* ∪ b ε b. a+ ∪ (ab)+ c. (a ∪ b )a b + ++ ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online