Why |w|>=m in pumping lemma?

456 Views Asked by At

If L is a regular language, then there exists a constant n (which depends on L) such that for every string w in the language L, such that the length of w is greater than or equal to n, we can divide w into three strings, w = xyz.

what my question is that, why we should pick w greater than or equal to n?

w = length of string. n = Number of States.

2

There are 2 best solutions below

2
On BEST ANSWER

Have you seen the proof of the pumping lemma? The rough outline goes like this:

  1. If $L$ is a regular language, it is accepted by some finite machine $M$
  2. $M$ has some number of states, say $n$
  3. If $L$ contains a string $w$ of $n$ or more symbols, then $M$, in accepting $w$, must go through more than $n$ states, and since it has only $n$, it must go through some state more than once. Call this state $s$
  4. Because of this, the part of $w$ that takes $M$ from state $s$ back to state $s$ (call this part $v$) can be repeated as many times as you want, and $M$ must still accept the resulting long string with many copies of $v$, because it must still end in the same accepting state as $w$, having gone around the loop several times instead of only once.
  5. Therefore $M$ must also accept this long string that results from pumping up the $v$ part of $w$.

But this crucially depends on the fact that $w$ takes $M$ around a loop from state $s$ back to itself; that is the whole argument. If $w$ is short, it might not go through any state twice, and there is no loop to pump.

That's why you need $|w|\ge n$.

2
On

Informally, the pumping lemma states that "In regular languages, every word that's at least length $n$ can be split into $xyz$ where $y$ can be repeated indefinitely." (Hence the "pumping", I presume.)

The $|w| \geq n$ constraint simply takes care of the "at least length n" part. If you allowed $w$ to be any length, the pumping lemma wouldn't hold.

Consider the language $L=\{aaaab^i|i\geq 1\}$, which is regular. If you allowed $w$ to be any length, say $3$, that length would be insufficient for the pumping lemma to hold - there's no word of length $3$ we can break up there.