码迷,mamicode.com
首页 > 其他好文 > 详细

pumping lemma for finite regular language?

时间:2015-02-28 06:41:44      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

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."

pumping lemma for finite regular language?

标签:

原文地址:http://www.cnblogs.com/miaoz/p/4304630.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!