in Theory of Computation
245 views
0 votes
0 votes
Regular expression for having atleast 2 a's

(1).  (a + b)* a (a + b)* a (a + b)*

(2). (a + b)* a  b* a (a + b)*

(3). b* a (a + b)* a (a + b)*

(4). (a + b) * a (a + b) * a b*

(5). b* a (a + b)* a b*

I know 1-4 are correct and just want help with 5th one . Please tell me is it correct or not with reason.

Thanks in advance....
in Theory of Computation
245 views

2 Comments

yes, option 5 is also correct, you can check by creating NFA.
1
1

@parth023 Thanks for confirmation 🙂

0
0

1 Answer

1 vote
1 vote

According to me not only 1 and 4 but all the 5 regular expressions can represent the language having atleast 2 a’s . For all the examples minimum string generated is “aa” if we put the * value as 0. None of the expressions accept epsilon and single a. 

Note:- I am also a learner and I might be wrong. But I have written the above answer by taking many examples.