0

I have come across many forums where they state that the language represented by

L={WWR|WR is the reverse of W and W belongs to (0,1)*}

is NOT REGULAR. And it has been proved by pumping lemma as well.

BUT I am able to write a REGULAR EXPRESSION FOR THIS, where I use the same logic as given in this link.
CHECK THIS:

(0+1) * 11 (0+1) * + (0+1) * 00 (0+1) *

Is there any flaw in logic? Or something that I maybe missing. Thanks in advance :)

Community
  • 1
  • 1

1 Answers1

0
(0+1) * 11 (0+1) * + (0+1) * 00 (0+1) * + (0+1) *           initial
= (0+1) * 11 (0+1) * + ((0+1) * 00 (0+1) * + (0+1) *)       union is associative
= (0+1) * 11 (0+1) * + (0+1) *                              L u U = U (U is universe)
= (0+1) *                                                   L u U = U (U is universe)

Your regular expression, which contains a union with (0+1)*, is the language which contains all strings of 0s and 1s and contains the target language as a proper subset. Your language contains, among other strings not in the target language, the string 01100.

Note that I am taking + to mean union, juxtaposition to mean concatenation, and * to mean Kleene closure.

Patrick87
  • 27,682
  • 3
  • 38
  • 73