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:
- |y| ≥ 1;
- |xy| ≤ p
- 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 w∈L of length at least p, then L is infinite."
pumping lemma for finite regular language?的更多相关文章
- 证明与计算(7): 有限状态机(Finite State Machine)
什么是有限状态机(Finite State Machine)? 什么是确定性有限状态机(deterministic finite automaton, DFA )? 什么是非确定性有限状态机(nond ...
- 编译系统中的 NFA/DFA算法理解
1.问题概述 NFA 和 DFA浅析---要深入了解正则表达式,必须首先理解有穷自动机. 有穷自动机(Finite Automate)是用来模拟实物系统的数学模型,它包括如下五个部分: 有穷状态集St ...
- Compiler Theory(编译原理)、词法/语法/AST/中间代码优化在Webshell检测上的应用
catalog . 引论 . 构建一个编译器的相关科学 . 程序设计语言基础 . 一个简单的语法制导翻译器 . 简单表达式的翻译器(源代码示例) . 词法分析 . 生成中间代码 . 词法分析器的实现 ...
- HDU 5487 Difference of Languages
Difference of Languages Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. ...
- 4.2 Context-Free Grammars
4.2 Context-Free Grammars Grammars were introduced in Section 2.2 to systematically describe the syn ...
- Boyer-Moore algorithm
http://www-igm.univ-mlv.fr/~lecroq/string/node14.html Main features performs the comparisons from ri ...
- 软件推荐-有限元开发软件FELAC
首页:http://yuanjisuan.cn/ 有限元语言及其编译器(Finite Element Language And it’s Compiler),以下简称FELAC是中国科学院数学与系统科 ...
- CMUSphinx Learn - Basic concepts of speech
Basic concepts of speech Speech is a complex phenomenon. People rarely understand how is it produced ...
- CodeForces 1110H. Modest Substrings
题目简述:给定$1 \leq l \leq r \leq 10^{800}$,求一个长度为$n \leq 2000$的数字串$s$,其含有最多的[好]子串.一个串$s$是[好]的,如果将其看做数字时无 ...
随机推荐
- Python学习笔记——基础篇【第六周】——logging模块
常用模块之logging 用于便捷记录日志且线程安全的模块 import logging logging.basicConfig(filename='log.log', format='%(ascti ...
- Tomcat下的work目录
work目录只是tomcat的工作目录,也就是tomcat把jsp转换为class文件的工作目录,这也正是为什么它叫work目录而不是cache目录的原因. jsp,tomcat的工作原理是当浏览器访 ...
- apache 修改连接数(转)
1.先要修改最大连接数,必须了解Apache的MPM(Multi -Processing Modules,多道处理模块)Apache2.0中MPM分为3种(perfork.worker.event). ...
- WSAEventSelect IO复用模型
1 今天帮一学习WSAEventSelect的网友排查一个测试用服务器端recv返回0的问题,出现这个问题直观判断一般是客户端socket关闭了,可是他的代码很简单并且是本机测试,通过wireshar ...
- A*寻路算法 (cocos2d-js详细代码)
看了几天的A*算法,感觉要成为一个游戏开发者,有必要把这个著名的算法拿到手. 网上有此算法的代码片段,但主要还是些模板类的伪代码,所以想分享一段完整的A*算法代码供大家更好的理解!(这里使用的是js语 ...
- Spring.net 学习
最近一段时间,在学习spring.net方面的知识,spring.net是什么,spring.net是用来干什么的,我们这里就不在介绍了,spring.net有两方面的内容---IOC(DI)与AOP ...
- UITableViewCell上面添加UIWebView
首先创建一个webView对象和 private var webViewcell : UIWebView? 在viewDidLoad里面设置创建webViewcell,设置属性并用kvo监听webVi ...
- python-cmp()的使用
注意:python3中已经删除了cmp()该函数. cmp(x,y) 比较x与y,当x>y时,返回1: 当x==y时,返回0: 当x<y时,返回-1: >>>cmp(1, ...
- hexo常用命令笔记
hexo npm install -g hexo npm update -g hexo hexo init 常用 hexo n == hexo new "a new post" 新 ...
- 获取生日对应星座的PHP函数
PHP 获取指定日期对应的星座名称 /** * 获取指定日期对应星座 * * @param integer $month 月份 1-12 * @param integer $day 日期 1-31 * ...