views:

60

answers:

1

Give an FA for the set of the strings with alphabet {a,b} that contain both or neither aa and bb as substrings. It means FA accept all strings without aa and bb as substrings. correct me if I wrong and give me some hint. Thanks all. :D

+1  A: 

Wait, does it accept "aaabababbb" or not? You said neither or both, and later said only neither.

It's homework so we're not going to draw the machine for you, but here are a few tips:

First, once you have seen both aa or bb, you need to head into an accepting sink state and never leave.

Second, until you see "aa" or "bb", you need to be in an accepting state so you also start in an accepting state since up to now it is neither.

Any state after you have seen "aa" or "bb" (but not both) is not an accepting state but is not a sink since you could always see the other type in the future.

Start thinking in these terms and build a high-level schema. then figure out the details as you only have two letters in your alphabet.

Uri