Similar questions 2 more →
Regular Expressions & Languages

Answer & solution
Answer: C (no official key was published)
1. Approach. The existential decomposition matters: for option C, w can always be chosen to have length one. This removes the apparent need to remember an arbitrarily long prefix. A direct regular expression is 0(0|1)+0 | 1(0|1)+1.
2. Derivation and interpretation. In C, every string wxwR has the same first and last symbol and length at least 3. Conversely any binary string of length≥3 with equal endpoints has such a representation by choosing w to be its first single symbol and x its nonempty middle. Thus C equals 0(0+1)+0 ∪1(0+1)+1 and is regular. A is the nonempty even-palindrome language and nonregular. For B, intersect with the regular language 0(11)*1 00 (11)*1 01. The result is{0 1k 00 1k 01:k positive odd}: the only possible even-palindrome prefix must match the two odd-length 1 blocks. This equality language is nonregular by pumping the first block. Hence B is nonregular. D is the reversal of B and is likewise nonregular.