[英]Is L = {a^n b^m | n>m} a regular or irregular language?
I have troubles in solving/proving this problem. 我在解决/证明这个问题时遇到了麻烦。 Any ideas please?
有什么想法吗?
L = {a n b m |
L = {a n b m | n > m} is not regular language.
n> m} 不是常规语言。
Yes, the problem is tricky at first few try and deserve vote-up. 是的,这个问题在最初几次尝试时很棘手 ,值得投票。
Pumping Lemma a necessary property of regular language is tool for formal proof that language is not regular language. 抽取引理常规语言的必要属性是用于正式证明语言不是常规语言的工具。
Formal definition: Pumping lemma for regular languages 正式定义: 常规语言的抽取引理
Let L be a regular language.
让L成为常规语言。 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") can be written as w = xyz (ie, w can be divided into three sub-strings), satisfying the following conditions:
则存在仅在L根据一个整数p≥1,使得每个字符串 w的长度L至少P的(p被称为“泵送长度”)可以写为w = XYZ(即,W可以被分成三个子字符串),满足以下条件:
- |
| y |
y | ≥ 1
≥1
- |
| xy |
xy | ≤ p
≤p
- for all i ≥ 0, xy i z ∈ L
对于所有的i≥0,XY I Z∈ 大号
Suppose, if you choose string W = a n b m where (n + m) ≥ p
and n > m + 1
. 假设,如果选择字符串W = a n b m ,其中
(n + m) ≥ p
且n > m + 1
。 Choice of W is valid but this choice you are not able to show that language is not regular language. 选择W是有效的,但是这个选择你无法证明该语言不是常规语言。 Because with this
W
you always have at-least one choice of y=a
to pump new strings in language by repeating a
for all values of i
(for i =0 and i > 1) . 因为有了这个
W
你总是至少有一个y=a
选择,通过重复a
的所有 i
值 (对于i = 0和i> 1)来在语言中抽取新的字符串。
Before I writing my solution to proof the language is not regular. 在我编写解决方案证明之前,语言不规律。 Please understand following points and notice: I made bold
every string w
and all i
in formal definition of pumping lemma above. 请理解以下几点并注意:我在
every string w
和all i
在上面的抽取引理的正式定义中做了大胆。
read: what pumping lemma formal definition says 阅读: 什么抽样引理形式定义说
Proof: using pumping lemma 证明:使用泵浦引理
Step (1): Choose string W = a n b m where (n + m) ≥ p
and n = m + 1
. 步骤(1):选择字符串W = a n b m其中
(n + m) ≥ p
且n = m + 1
。
Is this choice of
W
is valid according to pumping lemma?
is valid according to pumping lemma?
Is this choice of
W
Is this choice of
is valid according to pumping lemma?
Yes, such W is in language because number of a
= n > number of b
=m . 是的,这样的W是语言,因为
a
= n >的数量b
= m。 W is in language and sufficiently large >= p
. W是语言并且足够大> =
p
。
Step (2): Now chose a y
to generate new string for all i >= 0
. 步骤(2):现在选择
y
为所有 i >= 0
生成新字符串。
And no choice is possible for y
this time! 而没有选择是可能的
y
这一次! Why? 为什么?
First , it is essay to understand that we can't have b
symbol in y because it will either generate new strings out of pattern or in resultant string total number of b
will be more than total number of a
symbols. 首先 ,它是作文明白,我们不能有
b
y中的符号,因为它要么产生新的字符串出的图形或在得到的线总数b
将超过总数多a
符号。
Second , we can't chose y = some a 's because with i=0
you would get a new string in which number of a
s will be less then number b
s that is not possible in language.( remember number of a
in W was just one more then b
so removing any a means in resultant string N(a)=N(b) that is not acceptable because n>m ) 其次 ,我们不能选择Y =一些一个是因为与
i=0
,你会得到一个新字符串,其中的数a
旨意是小于号b
s表示是不可能的语言。( 记住的号码a
中W只是一个b
所以在结果字符串N(a)= N(b)中删除任何不可接受的均值,因为n> m )
So in we could find some W those are sufficiently large but using that we can't generate new string in language that contradict with pumping lemma property of regular language hence then language {a n b m | 所以我们可以找到一些足够大的W,但是使用它们我们不能用与常规语言的泵浦引理属性相矛盾的语言生成新的字符串,因此语言{a n b m | n > m} is not a regular language indeed.
n> m}确实不是常规语言。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.