pumping lemma for finite regular language?

some books describe pumping lemma as this:

Let L be a regular language. Then there exists an integer p ≥ 1 depending only on L such that every string w in L of length at least p (p is called the "pumping length"[4]) can be written as w = xyz (i.e., w can be divided into three substrings), satisfying the following conditions:

  1. |y| ≥ 1;
  2. |xy| ≤ p
  3. for all i ≥ 0, xyiz ∈ L

Copied from Wikipedia.

However, please note that actually pumping lemma can only be used for infinite regular language.

Some people on stackoverflow also answers this problem:

"You are right - we cannot allow "pumping" words of a finite L. The thing you are missing is that the lemma says there exists a number p, but does not tell us the number.

All words longer than p can be pumped, by the lemma. For a finite L, it happens so that p is larger than the length of the longest word in L. Thus, the lemma only holds vacuously, and cannot be applied to any word in L, i.e., any word in L does not satisfy the condition of "having length at least p" as the lemma requires.


A corollary: if L has pumping length p, and there exists some word wL of length at least p, then L is infinite."

posted @ 2015-02-28 05:32  zmiao  阅读(229)  评论(0编辑  收藏  举报