简体   繁体   English

使用Pumping引理证明语言是否正常?

[英]Proof the language is regular or not regular using Pumping lemma?

Can any one help to figure out that L = { a m b n , m ≥ n + 2, m ≤ 3 } is regular or not using pumping lemma, It seems to be a bit difficult to prove. 谁能帮忙找出L = {a m b n ,m≥n + 2,m≤3}是规则的还是不使用抽引引理,这似乎很难证明。

I have tried to used pumping lemma and it shows that it is regular language but i am really confused that is this right or not. 我尝试过使用抽引引理,它表明它是常规语言,但是我真的很困惑这是正确的还是错误的。

I have tried to used pumping lemma and it shows that it is regular language but I am really confused that is this right or not. 我尝试过使用抽引引理,它表明这是常规语言,但我真的很困惑这是正确的还是错误的。

First note, the pumping lemma can be used to proof that "certain language is not a regular language". 首先要注意的是,抽动引理可以用来证明“某些语言不是常规语言”。 But we can not use pumping lemma to proof that "certain language is a regular". 但是,我们不能使用激进引理来证明“某些语言正常的”。

Yes, the pumping lemma for regular languages describes an essential property of all regular languages, and if a languages don't satisfy the conditions described by pumping lemma or say don't satisfy pumping lemma property then that language is actually not a regular language, But the converse of this is not true!! 是的,常规语言的泵送引语描述了所有常规语言的基本属性,如果一种语言不满足泵送引描述条件,或者说不满足泵送引理属性,则该语言实际上不是常规语言,但是相反的说法是不正确的! &mdash- there are "languages those satisfies pumping lemma's conditions and may still be non -regular", means:- &mdash-:“有满足抽引引理条件的语言,但可能仍然是非常规的”,意思是:-

Pumping lemma is 'necessary but not sufficient condition' for a language to be regular. 对于正常的语言来说,抽动引理是“必要但不是充分的条件”

This is something like: every engineer is math student - so if a student is engineer we can say that he knows math, but their are math students those don't know engineering. 就像这样:每个工程师都是数学专业的学生-因此,如果学生是工程师,我们可以说他懂数学,但是他们是不懂工程专业的数学学生。 (just giving you an example to explain) (只给你一个例子来解释)

From your question, I have impression that you don't understand basically - "what is a regular language?" 从您的问题中,我给您的印象是您基本上听不懂- “什么是普通语言?” .

Unlike pumping lemma for regular languages, we need to learn some other characteristics of regular languages - finding them in a language proofs that the language is a regular language. 与常规语言的引理不同,我们需要学习常规语言的其他一些特征-在某种语言中找到它们,以证明该语言是常规语言。 If you can represent a language using finite automata or/and regular expression that proofs that the language is a regular language. 如果您可以使用有限自动机或/和正则表达式来表示一种语言,则可以证明该语言是常规语言。

Now, come to your original question: 现在,请问您最初的问题:

How to proof that language { a m b n , m ≥ n + 2, m ≤ 3 } is regular or not? 如何证明语言{a m b n ,m≥n + 2,m≤3}是否正常?

Because neither 'm' or 'n' can be negative (a string without occurrence of any symbol is possible eg. empty string 1 , but a string with negative occurrence of language symbols is not possible) and according to condition "m ≥ n + 2", 'm' is always greater than 'n' — so minimum value of 'm' (when 'n' is 0) is 2. From second condition "m ≤ 3", maximum value of 'm' is '3', and so 'm' can be either 2 or 3. 因为'm'或'n'都不能为负(不出现任何符号的字符串是可能的,例如,空字符串1 ,但是不可能出现具有语言符号的字符串)则根据条件“ m≥n + 2”,“ m”始终大于“ n”,因此“ m”的最小值(当“ n”为0时)为2。从第二个条件“ m≤3”开始,“ m”的最大值为“ 3” ',因此'm'可以是2或3。

If you again notice fist condition: "m ≥ n + 2" for m = {2, 3} possible values for 'n' can be: 如果您再次注意到第一条件:m = {2,3}的“ m≥n + 2”,则“ n”的可能值为:

  • for m = 2, n can be 0 and that makes string 'aa'. 对于m = 2,n可以为0,这使字符串为“ aa”。
  • for m = 3, n can be 0 or 1 and that makes strings 'aaa', 'aaab'. 对于m = 3,n可以为0或1,这使得字符串为'aaa','aaab'。

So, it came that the language is a finite language e. 因此,该语言是一种有限的语言e。 only consists of three strings. 仅包含三个字符串。 Every finite language is a regular language, check venn diagram: 每种有限的语言都是常规语言,请查看维恩图:

参见维恩图

(to lean more about this read: Finiteness of Regular Language ) (以进一步了解此内容: 常规语言的有限性

Regular expression for your language L = { a m b n , m ≥ n + 2, m ≤ 3 } would be aa(a + Λ)(b + Λ) , hence it is proofed that language is a regular language. 您的语言的正则表达式L = {a m b n ,m≥n + 2,m≤3}将为aa(a +Λ)(b +Λ) ,因此证明了语言是常规语言。

1 a string without occurrence of any symbol is called empty or null string in formal languages, in most of formal language books symbol Ɛ for empty string. 1在正式语言中,没有出现任何符号的字符串称为空字符串或空字符串,在大多数正式语言书籍中,符号Ɛ表示空字符串。
Λ is empty symbol. Λ为空符号。

我们不能使用抽水引理来证明语言是常规的。要证明一种语言是常规的,我们应该为该语言设计DFA

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM