1,078 views
0 votes
0 votes

S -> AaB

A -> aC | $\epsilon$

B -> aB | bB | $\epsilon$

C -> aCb | $\epsilon$

Is the regular expression for the above is this:

a(a + b)* a ( a* + b* )*  ?

1 Answer

0 votes
0 votes
It should be (a(a+b)*)+a(a^nb^n)

because here minimum one "a" is must and by the production B we will get all string of "a and b"

But at the same time by the production C we will get string in a and b will be equal.