505 views
0 votes
0 votes
Which of the following regular expression generates the set of all strings not containing ‘baa’ as a substring over input alphabet {a, b}?
(a) a*(b*a)* (b) a*b*ab
(c) a*baba* (d) a*(ba+b)*

1 Answer

2 votes
2 votes

Set of all strings that do not contain 'baa' as substring.

Option b) and c) eliminated as they are not generating $\epsilon$ hence not all strings

Option a) clearly generates 'baa' as (b*a)(b*a) = baa 

Option d) remaining and is  not generating baa.

Hence option d) is correct answer

Related questions

3 votes
3 votes
1 answer
3