edited by
631 views
0 votes
0 votes
Design regular expression for no $2$  $a's$ should come together  ...... (Standard question in many text books)

 I came to know the answer is .... $(a + E) (b + ba)$ or $(b + ab) (a + E)$ ...... this I have understood Logically ....

but when I tried it on my own for the first time ... I came up with $(b + ab)^* + (b + ba)^{*} + a + E $....... please help me with any case or scenario where my expression fails.

This community is always helpful to me. Thanks in advance ...
edited by

2 Answers

1 votes
1 votes
  • Regular expression for no two a's comes together is 
  1. (a+$\epsilon$)(b+ba)*

  2. (b+ab)*(a+$\epsilon$)

  • Your regular expression (b+ab)*+(b+ab)* +a+ E  is not gives string like 'aba'.so it is wrong.

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
3