Consider the following identities for regular expressions: (i) (r + s)* = (s + r)*
Consider the following identities for regular expressions:
(i) (r + s)* = (s + r)*
(ii) (r*) = r*
(iii) (r* s*)* = (r + s)*
Which of the above identities are true?
Show answerHide answer
Correct answer: (D) (i), (ii) and (iii)
Explanation
(r + s)* generates any string over r and s, the same as (s + r)*. (r*)* generates any string of r's, the same as r*. (r* s*)* also generates any string over r and s, the same as (r + s)*. All the identities are true.