413 views
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.

• Regular expression for no two a's comes together is

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

Sir , use ' * ' for Second Term in 1st one and first Term in Second one.
Ok
The expression (b+ab)* + (b+ba)* + a + E is wrong because it does not generate the string "abba"

The correct answer is (a+E)(b + ba)*