作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在检查给定语言是否正常时,我有点困惑。
假设我们必须检查是否:
L. The language accepting even number of
0
's in regular or not?
w= "0000"
:
x = 0
,
y = 0
和
z = 00
。现在,在为
i = 2
应用泵送引理时,我将获得字符串
"00000"
,该字符串在我的语言中不存在,因此通过泵送引理可以证明该语言不规则。但这是DFA接受的吗?
最佳答案
您对抽引引理还不是很清楚。
抽引引理说:
正式定义:Pumping lemma for regular languages
Let
L
be a regular language. Then there exists an integerp
≥ 1
depending only onL
such that every stringw
inL
of length at leastp
(p
is called the"pumping length"
) can be written asw
=xyz
(i.e.,w
can be divided into three substrings), satisfying the following conditions:
|
y
| ≥ 1
|
xy
| ≤
p
- for all
i
≥ 0
,xy
i
z
∈
L
w
的选择是正确的。然后,至少应该有一种方法可以将w
分为三部分xyz
,以便通过重复(抽取)y
任意次数,我们可以生成该语言的新字符串。w
的意思是:语言中的w
且足够大≥P w
正确地分割为
xyz
,也有可能会出现一些新生成的字符串不在语言中的情况。和你一样
y
其他可能的选择。
w
=“
0000 ”中,您可以将
w
破坏为
y = 00
。通过选择
y
,您将始终在Language中找到一个新生成的字符串,该字符串为“偶数个零”
w
≥P。
因此,您的证明仍然是不完整的
w
分解为
xyz
并抽取
y
意味着找到循环部分并重复循环部分以生成新的语言字符串。
y
不能为空)。上述正式定义中的-1)。
x
和
z
可以为空字符串。
To proof using Pumping Lemma:
+-------------------------+--------------------------+----------------+--------------+
| | Sufficient large W in L | y | i >=0 |
+-------------------------+--------------------------+----------------+--------------+
| language is regular | For all W (all W can use | At-least one | For all i>=0 |
| | to generate new W' in L) | | |
+-------------------------+--------------------------+----------------+--------------+
| language is NOT regular | Find Any W (at-least 1 | With all (Show | At-least one |
| | W that can't generates | no possible Y | i |
| | new W' in L | exists) | |
+-------------------------+--------------------------+----------------+--------------+
Pumping Lemma necessary but not sufficient condition for a language to be regular. A language possible that satisfies these conditions may still be non-regular.
Reference
关于regular-language - 常规语言的抽动引理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14705091/
我是一名优秀的程序员,十分优秀!