Which of the following regular expression identities are true?
2012
Which of the following regular expression identities are true?
- A.
(r + s)* = r* s*
- B.
(r + s)* = r* + s*
- C.
(r + s)* = (r* s*)*
- D.
r* s* = r* + s*
Attempted by 73 students.
Show answer & explanation
Correct answer: C
Option C is correct because (r + s)* represents all strings formed by r and s. This set equals (r* s*)* as any combination can be grouped into r blocks followed by s blocks. Options A, B, and D are false because they cannot generate mixed sequences like sr or rs.
A video solution is available for this question — log in and enroll to watch it.