[英]Pumping lemma to show that `{a^n b^m | n=km for k in N}` is not regular
How am I supposed to prove that L={a^nb^m | n=km for k in N}
我应该如何证明
L={a^nb^m | n=km for k in N}
L={a^nb^m | n=km for k in N}
is not a regular language using the pumping lemma? L={a^nb^m | n=km for k in N}
不是使用抽水引理的常规语言?
I started with taking a word w
in L
, w=a^nb^m
with n=km
for some k
in N
. 我首先在
L
取一个词w
,对于N
一些k
, w=a^nb^m
, n=km
。 There are three possible decompositions for w
: w
有三种可能的分解:
a^i * a^j * a^(nij) b^m
a^i * a^(ni) b^j * b^(mj)
a^nb^i * b^j * b^(mij)
Pumping the middle part in point 2) will result in a mixed up word, which is clearly not in L
, but I can't figure out why 1) can't give you a good decomposition: 在点2)中抽取中间部分将导致单词混淆,这显然不在
L
,但我不知道为什么1)无法给您带来良好的分解:
Let's say you pump a^j
x
times. 假设您将
a^j
抽a^j
x
次。 Then the amount of a's in the new word will be i+xj+nij = n+(x-1)j
. 那么新单词中a的数量将为
i+xj+nij = n+(x-1)j
。 We know n=km
for some m
. 我们知道
n=km
大约m
。 We have to show that there exists an x
such that the new word is not in L
. 我们必须证明存在
x
使得新单词不在L
。 But let's assume j=m
(This is certainly possible, since n=km
there is always a sufficient amount of a's, except when k=0
, but then we get a trivial case). 但是让我们假设
j=m
(这当然是可能的,因为n=km
总是有足够数量的a,除了k=0
,但是得到的情况很简单)。 Then n+(x-1)j = km+(x-1)m = m(n+x-1)
which is of the form {a^nb^m | n=km for k in N}
则
n+(x-1)j = km+(x-1)m = m(n+x-1)
,形式为{a^nb^m | n=km for k in N}
{a^nb^m | n=km for k in N}
for all x
. 对于所有
x
{a^nb^m | n=km for k in N}
。 So for each w
we have a decomposition uvz
such that uv^iz
is in L
for all i
. 因此,对于每个
w
我们都有一个分解uvz
,使得uv^iz
对于所有i
都在L
中。 Thus, by the pumping lemma, L
is regular. 因此,通过抽运引理,
L
是规则的。
What am I missing? 我想念什么?
EDIT: The formulation of the Pumping lemma given: 编辑:给出抽水引理的公式:
Let
L
be a regular language accepted by a DFA withk
states.令
L
为DFA接受k
个状态的常规语言。 Letw
be any word inL
with length>= k
.令
w
为L
中长度>= k
任何单词。 Thenw
can be written asuvz
with|uv| <=k
然后可以用
|uv| <=k
将w
编写为uvz
|uv| <=k
|uv| <=k
,v>0
anduv^iz
inL
for alli>=0
所有
i>=0
|uv| <=k
,v>0
和L
uv^iz
A perhaps easier way to proof this is first modifying the language. 一种可能更简单的证明方法是首先修改语言。
Since regular languages are closed under complement and the intersection with another regular expression. 由于正则语言在补码和与另一个正则表达式的交集下是封闭的 。
This means that you can proof L
is not a regular language by proving complement(L)
is not a regular language, because if L'
is a regular language, L
is and vice versa. 这意味着,你可以证明
L
是不是证明一个正规语言complement(L)
是不是一个正规的语言,因为如果L'
是一个普通的语言, L
的,反之亦然。 The same holds for the intersection. 交叉口也是如此。
It is sufficient to proof that L' is not regular as well: 足以证明L'也不规则:
L' = intersection(complement(L),a*b*})
Thus 从而
L'={a^nb^m|n != k*m, for any k in N}
Then the proof becomes way easier because you can show for whatever part you use as the pumping lemma, if it has length l
, you can pump it enough times to reach a multiple. 然后,证明就变得更加容易了,因为您可以显示用作抽出引理的任何部分,如果长度为
l
,则可以抽出足够的次数以达到倍数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.