Consider the following identities for regular expressions; some are false and some are true. Decide which and in case it is false to provide the correct counterexample.
(a) R(S+T)=RS+RT
(b) (R*)*=R*
(c) (R*S*)*=(R+S)*
(d) (R+S)*=R*+S*
(e) S(RS+S)*R=RR*S(RR*S)*
(f) (RS+R)*R=R(SR+R)*
a) (d) is false and a counterexample is:
R={ab},T={a}, S={b}
b) (c) is false and a counterexample is:
R={ab},T={b}, S={b}
c) (e) is true
d) (e) is false and a counterexample is:
R={a,ε},T={b}, S={a,ε}
What is the answer? Explain please
Expert Answer
Consider the following S(RS+S)*R=RR*S(RR*S)*
Let us convert this into a regular expression i.e b(ab+b)*a=aa*b(aa*b)*
In general our left hand side equation should always end with ‘a’ but our right side contains a string that is not ending with a i.e. ε
Hope you will understand this, for any further doubt do comment !