Which two of the following four regular expressions are equivalent? ( is the empty string).
View worked solution
Answer: C
Let us analyze the language generated by each regular expression over the alphabet :
- : The term generates all even-length strings of s: . Concatenating this with gives: Since generates all even-length strings and generates all odd-length strings, their union generates all possible strings of s: .
- : Generates only even-length strings of s: .
- : Generates all strings of s of any length: .
- : Generates only odd-length strings of s: .
Thus, expressions (i) and (iii) both represent the language and are equivalent.
Free practice · Your answers on this page are not saved.
