Is L = {ww^Ru | w, u ∈ {0,1}+} regular language?

1.1k views Asked by At

let L = {wwRu | w, u ∈ {0,1}+}. Is L regular language ? Note that w, u cannot be empty.

I've tried to prove it is not regular language by the pumping lemma, but I failed when w = 0^p1^p, 01^p, (01)^p. Once I take y = 0^p or 1^p, xyyz will be 00.../11.../01^n0... etc.

And I cannot draw its DFA/NFA or write its regular expression to prove it is regular language.

So is L regular or not ? How can I prove it ?

2

There are 2 answers

1
Hassan Abbasi On

The language is REGULAR:

L = 00(0+1)+ + 11(0+1)+ + 0(11)+0(0+1)+ + 1(00)+1(0+1)+

0
Patrick87 On

The language is not regular, and we can prove it using the Myhill-Nerode theorem.

Consider the sequence of strings 01, 0101, ..., (01)^n, ...

First, notice that none of these strings are in the language. Any prefix of any of these strings which has even length is of the form (01)^2m for some m, and therefore just a shorter string in the sequence; splitting such a prefix in two either has both substrings start with 0 and end with 1, or else it has the first substring start and end with 0 and the second start and end with 1. In either case, these strings are not of the form w(w^R)u for any w or u.

Next, notice that the shortest possible string which we can append to any of these strings, to produce a string in the language, is always the reverse of itself followed by either 0 or 1. That is, to turn 01 into a string in the language, we must append 100 or 101; there are no shorter strings we can append to 01 to get a string in the language. The same holds true for 0101: 10100 and 10101 are the shortest possible strings that take 0101 to a string in L. And so on for each string of the form (01)^n.

This means that each string of the form (01)^n is distinguishable with respect to the target language w(w^R)u. The Myhill-Nerode theorem tells us that a minimal DFA for a regular language has exactly as many states as there are equivalence classes under the indistinguishability relation. Because we have infinitely many distinguishable strings with respect to our language, a minimal DFA for this language must have infinitely many states. But, a DFA cannot have infinitely many states; this is a contradiction. This means that our language cannot be regular.