是字母表“a,b,c”上所有字符串的语言吗?具有相同数量的子串“ab” & “吧”常规的?
是字母表“a,b,c”上具有相同数量的子串“ab”和“a,b,c”的所有字符串的语言“ba”常规吗?
我相信答案是否定的,但是很难对其进行正式的演示,甚至是非正式的演示。
关于如何解决这个问题有什么想法吗?
Is the language of all strings over the alphabet "a,b,c" with the same number of substrings "ab" & "ba" regular?
I believe the answer is NO, but it is hard to make a formal demonstration of it, even a NON formal demonstration.
Any ideas on how to approach this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这显然不正常。 FA 如何识别 (abc)^nc (cba)^n。像这样的字符串是用你的语言写的,对吗?该论证是一个简单的论证,基于不可区分关系 I_l 下存在无限多个等价类这一事实。
It's clearly not regular. How is an FA going to recognize (abc)^n c (cba)^n. Strings like this are in your language, right? The argument is a simple one based on the fact that there are infinitely many equivalence classes under the indistinguishability relation I_l.
证明语言不规则的最常见方法是使用抽引理。
使用引理有点棘手,因为它具有所有这些“存在”等等。要使用泵引理证明语言 L 不是正则语言,您必须证明
哇!
我将展示证明如何寻找“相同数量的 as 和 bs”语言。转换为您的情况应该是直接的:
如果您需要直观地了解为什么会这样,那么您需要如何计数到任意大的数字来验证一个单词是否属于这些语言之一。然而,正则语言是由有限自动机描述的,并且没有有限自动机可以表示表示所有数字所需的无限数量的状态。 (维基百科文章应该有正式的证明)。
编辑:看起来你不能直接在这种特殊情况下直接使用泵引理:如果你总是让
y
成为一个字符长,你永远无法让一个单词停止被接受(aba 变成 abbbba没有区别等等)。只需采用 Patrick87 建议的等价类方法即可 - 它可能会比您为使泵送引理适用于此处而需要执行的任何肮脏技巧更干净。
The most common way to prove a language is NOT regular is using on of the Pumping Lemmas.
Using the lemma is a little tricky, since it has all those "exists" and so on. To prove a language L is not regular using the pumping lemma you have to prove that
whooo!
I'l l show how the proof looks for the "same number of as and bs" language. It should be straighfoward to convert to your case:
If you need intuition on why this works, it follows from how you need to be able to count to arbritrarily large numbers to verify if a word belongs to one of these languages. However, Regular Languages are described by finite automata and no finite automata can represent the infinite ammount of states required to represent all the numbers. (The Wikipedia article should have a formal proof).
EDIT: It looks like you can't straight up use the pumping lemma in this particular case directly: if you always make
y
be one character long you can never make a word stop being accepted (aba becoming abbbba makes no difference and so on).Just do the equivalence class approach suggested by Patrick87 - it will probably turn out to be cleaner than any of the dirty hacks you would need to do to make the pumping lemma applicable here.