Sunday, July 12, 2009

Give a regular expression for set of strings over {a,b,c} with an even number of occurrences of substring ab?

Theory %26amp; implementation of programming languages

Give a regular expression for set of strings over {a,b,c} with an even number of occurrences of substring ab?
The answer to this question is going to depend upon the syntax with which you have to express your regular expressions.





What you need to do is draw out an NFA (Nondeterministic Finite Automata) where you have an optional block where an "a" followed by a "b" can be followed by anything but must be terminated by an "ab".
Reply:(aa+bb+cc+(ab+bc+ac)*(aa+bb+cc)*)*


No comments:

Post a Comment