3
$\begingroup$

$$L=\{a^n \mid \text{\(n\) is even}\}$$

This is regular but fails in the pumping Lemma.

Assuming $m=4$, $w=aaaaaa$, $|w|=6$ (even). Let $w=xyz$, $x=a$, $y=aaa$. We have $|y|>0$ and $|xy| \le m$.

Let $w_i=xy^iz$. For $i=2$, $w_2=xy^2z=aaaaaaaaa$. $|w_2|=9$ therefore it is not regular.

Where am I going wrong?

$\endgroup$
6
  • $\begingroup$ Now let me ask you this, why are you choosing a pumping length? In my proofs I always just chose a word at least as long as the pumping length, but represented in terms of it, for example a^2p with p being the pumping length. $\endgroup$
    – Platinum Azure
    Commented Aug 24, 2012 at 5:21
  • $\begingroup$ More relevantly, it's much easier to construct a finite automaton or regular expression to prove regularity... To prove regularity with the pumping lemma, you must show that no word fails the pumping ability and that's a lot harder than finding one that does fail for non-regular languages. $\endgroup$
    – Platinum Azure
    Commented Aug 24, 2012 at 5:24
  • $\begingroup$ thnx for help. Wat u r saying is to take p=4 and therefore w=aaaaaaaa, it will give same results. Correct me if im wrong $\endgroup$
    – Raj
    Commented Aug 24, 2012 at 5:25
  • $\begingroup$ No, I'm saying don't give p a value. The pumping lemma states that there exists a value for p, such that strings longer than it in length can be pumped. You're choosing the wrong value for p, and more importantly you can't just assign a value to it in the first place. In my answer I suggested a simpler way to prove regularity. $\endgroup$
    – Platinum Azure
    Commented Aug 24, 2012 at 5:30
  • 2
    $\begingroup$ Careful, the pumping lemma says that if the language is regular, then it can be pumped. But the converse isn't true. $\endgroup$
    – vonbrand
    Commented Jan 18, 2013 at 12:56

2 Answers 2

12
$\begingroup$

The pumping lemma states that:
there exists a pumping length $p$
such that for any word $w \in L$ of length $|w| \ge p$,
there exists a decomposition $w = xyz$
meeting certain properties.

There are two errors in your proof. The first is that the lemma states that there exists a pumping length $p$ but doesn't say how to compute it; you assume without proof that $6$ is a valid pumping length. This makes your proof incomplete, but it is not actually wrong: the pumping length can be anything larger than the number of nodes in the smallest finite automaton that recognizes the language, and this language can be recognized by an automaton with just two states, so any $p \ge 2$ is ok.

The fatal mistake is that you don't get the choice of the decomposition. There has to be some decomposition $w = xyz$ such that $\forall i, xy^iz \in L$. The one you picked doesn't work. In order to prove that the language isn't regular, you'd need to prove that no decomposition works. But there is a decomposition that works: take $x = aa$, $y = aa$, $z = aa$ (or any decomposition where $|y|$ is even).

You might have gotten confused with what happens when proving that a language is not regular. When proving the negation, the quantifiers are reversed: to prove that a language is not regular using the pumping lemma, we usually assume that the pumping lemma holds, so we assume the pumping lemma, and in particular we assume that for any sufficiently large word, there exists a decomposition meeting the properties, and we deduce a contradiction from that. Here, you're trying to deduce that the pumping lemma holds.

$\endgroup$
0
$\begingroup$

The simple answer is you're using the wrong approach. It's much easier to construct a regular expression or finite automation to prove that a language is regular.

This language is expressible using the following regular expression:

(aa)*

I think your issue is your assumption that the pumping length is 4. You can't just choose a pumping length- the lemma only says that for a regular language, there must exist one and only one pumping length, but the lemma does not help us guess what it is, nor do we need to know when disproving regularity. For proving regularity, I wouldn't use the pumping lemma at all because it is sometimes possible for a non-regular language to be pumped. Use a finite automaton or regular expression to prove regularity.

$\endgroup$
2
  • 1
    $\begingroup$ The pumping lemma is useful for proving non-regularity (though again, it's not foolproof). But it's definitely hard- I have awful memories of Theory of Computing class from those lectures! Good luck. $\endgroup$
    – Platinum Azure
    Commented Aug 24, 2012 at 5:41
  • $\begingroup$ Although Raj doesn't prove that 6 (not 4) is a valid pumping length, it is. The real problem in the proof is elsewhere: you must check all decompositions, not just one. $\endgroup$ Commented Aug 25, 2012 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.