简体   繁体   English

使用抽水引理表明以下语言不是正则语言 L = {anbm | n = 2m}

[英]Use the pumping lemma to show that the following languages are not regular languages L = {anbm | n = 2m}

Use the pumping lemma to show that the following languages are not regular languages L = {an bm |使用抽水引理表明以下语言不是常规语言 L = {an bm | n = 2m} n = 2m}

Choose a string a^2p b^p.选择一个字符串 a^2p b^p。 The pumping lemma says we can write this as w = uvx such that |uv|抽水引理说我们可以把它写成 w = uvx 使得 |uv| <= p, |v| <= p, |v| < 0 and for all natural numbers n, u(v^n)x is also a string in the language. < 0 并且对于所有自然数 n,u(v^n)x 也是该语言中的字符串。 Because |uv|因为|紫外线| <= p, the substring uv of w consists entirely of instances of the symbol a. <= p,w 的 substring uv 完全由符号 a 的实例组成。 Pumping up or down by choosing a value for n other than one guarantees that the number of a's in the resulting string will change, while the number of b's stays the same.通过为 n 选择一个不是 1 的值来向上或向下抽气可以保证结果字符串中 a 的数量会改变,而 b 的数量保持不变。 Since the number of a's is twice the number of b's only when n = 1, this is a contradiction.由于仅当 n = 1 时 a 的数量是 b 的数量的两倍,所以这是矛盾的。 Therefore, the language cannot be regular.因此,语言不可能是规则的。

L={anbm|n=2m} Assume that L is regular Language Let the pumping length be p L={a2mbm} Since |s|=3m > m (total string length) take a string s S= aaaaa...aabbb....bbb (a2mbm times taken) Then, u = am-1; L={anbm|n=2m} 假设 L 是正则语言 设泵送长度为 p L={a2mbm} 因为 |s|=3m > m(总字符串长度)取一个字符串 s S= aaaaa...aabbb ....bbb (a2mbm 次) 然后, u = am-1; v= a; v=一个; w= ambm. w=amm。 && |uv|<=m Now If i=2 then S= am-1 a2 ambm = a2m-1bm Since here we are getting an extra a in the string S which is no belong to the given language a2mbm our assumption is wrong Therefore it is not a regular Language && |uv|<=m 现在 If i=2 then S= am-1 a2 ambm = a2m-1bm 因为这里我们在字符串 S 中得到了一个额外的 a ,它不属于给定的语言 a2mbm 我们的假设是错误的 因此它不是常规语言

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

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