0

Proving that a^n b^n, n >= 0, is non-regular. Using the string a^p b^p.

Every example I've seen claims that y can either contain a's, b's, or both. But I don't see how y can contain anything other than a's, because if y contains any b's, then the length of xy must be greater than p, which makes it invalid.

Conversely, for examples such as:

www, w is {a, b}*, the string used is a^p b a^p b a^p b. In the proofs I've seen, it claims that y cannot contain anything other than a's, for the reason I stated above. Why is this different?

Also throwing in another question:

Describe the error in the following "proof" that 0* 1* is not a regular language. (An error must exist because 0* 1* is regular.) The proof is by contradiction. Assume that 0* 1* is regular. Let p be the pumping length for 0* 1* given by the pumping lemma. Choose s to be the string OP P. You know that s is a member of 0* 1*, but a^p b^p cannot be pumped. Thus you have a contradiction. So 0* 1* is not regular.

I can't find any problem with this proof. I only know that 0*1* is a regular language because I can construct a DFA.

Dave
  • 1
  • 3

1 Answers1

0

The pumping lemma states that for a regular language L:

for all strings s greater than p there exists a subdivision s=xyz such that:

  1. For all i, xyiz is in L;
  2. |y|>0; and
  3. |xy|<p.

Now the claim that y can only contain a's or b's originates from the first item. Since if it contained both a's and b's, with i=2, this would result in a string of the form aa...abb...baa...b, etc. That's what the statement wants to say.

The third part indeed, makes it obvious that y can only contain a's. In other words, what the textbooks say is a conclusion derived from the first item.

Finally if you combine 1., 2. and 3., one reaches contradiction, because we know y must contain at least one character (2.), the string can only contain a's. Say y contains k a's. If we would "pump" this with i=2, the result is that we generate a string:

s'=xy2z=ap+kbp

We know however that s' is not part of L, which it should be by 1., so we reach inconsistency.

You can thus only make the proof work by combining the three items. It's not enough to know that y consist only out of a's: that doesn't result in contradiction. It's because there is no subdivision available that satisfies all three constraints simultaneously.


About your second question. In that case, L looks different. You can't reuse the proof of a^nb^n because L is perfectly happy if the string contains more a's. In other words, you can't find a contradiction. In other words, the last item of the proof fails. As long as y contains only one type of characters - regardless of its length - it can satisfy all three constraints.

Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555