-1

As we know, using pumping lemma, we can easily prove the language L = {WW|W ∈ {a,b}*} is not a regular language.

However, The language, L1 = {W1W2| |W1| = |W2|} is a regular language. Because we can get the DFA like below, enter image description here

My question is, L = {WW|W ∈ {a,b}*} also has the even length of strings (|w|=|w|, definitely), L still can have some dfa like above. How come it not a regular language?

Thanks.

henry
  • 185
  • 2
  • 2
  • 13

2 Answers2

1

You are misinterpreting languages ww and language of DFA that is L1:

[Question]:

  • L ={ ww| w = w} is a Regular Language(RL). Because we can get the DFA like below is possible.

    DFA:  L1 ={ w1w2| |w1| = |w2|, where w1 , w2 ∈ {a, b}* } 
    
    --►((even))------a,b---------►(odd)  
          ▲                         |  
          |--------a,b--------------| 
    

[DOUBT]

What is L ={ ww | where w ∈ {a, b}* } is ?

L is even length string consist of a and b that is has some prefix sub string equal to suffix sub string. some example of L are { aa, bb, abab, aaaa, bbbb, abaaba, abbabb, .....}

Whats language of DFA or L1 ={ w1w2| |w1| = |w2|, where w1 , w2 ∈ {a, b}* } ?

All even length strings consist of a and b say L1 for example {ab, ba, aabb, baab, ab, aa, bb, ababa, baba, abbba, ...}

Note: all even length strings consist of a and b are not in L for example {ab, ba, aabb, baab, ab} but this string in DFA's language = L1.

so, L(DFA)=L1 != L

[DOUBT-1]

Relation between L and L(DFA)=L1 ?

As I wrote in note, L ⊆ L(DFA) so every string that belongs to L also element of language of DFA and accepted you DFA. (this is you confusion)

Also, language L ={ ww| |w| = |w| } is not Regular Language.And we can't draw DFA for this language. BOTH LANGUAGES ARE NOT SAME! (L != L1)

L is much restricted then L(DFA)

L= { WW|W } is not regular can be proof using pumping lemma.

L also not even context free language, but context sensitive language

Grijesh Chauhan
  • 57,103
  • 20
  • 141
  • 208
  • Hi, Grijesh, I really appreciate you for putting so much effort on this thread!! :-) As you mention, "Note: all even length strings consist of a and b are not in L1 for example {ab, ba, aabb, baab, ab} but this string in DFA's language." I don't know why L1 can not contain these strings, since W1 maybe not equal to W2, ONLY the length of W1 and W2 are the same. That means, if W1=a, W2=b, then the string is ab ∈ L1. Form "even" state ---> a ---> "odd" state ---> b ---> "even" state. Accept. – henry Jan 26 '13 at 16:31
0

I post this thead in cs.stackexchange, and Ran provide me the answer. https://cs.stackexchange.com/questions/9175/how-come-ww-isnt-regular-when-uv-u-v-is

The key difference between the two language is the first one doesn't need to remember its contents just to calculate the length is enough, while the second language need to analyse whether w and w are identical.

Thanks @Ran, @Grijesh and @dema80 :-)

Community
  • 1
  • 1
henry
  • 185
  • 2
  • 2
  • 13