简体   繁体   English

是 L = {ww^Ru | w, u ∈ {0,1}+} 正则语言?

[英]Is L = {ww^Ru | w, u ∈ {0,1}+} regular language?

let L = {ww R u |让 L = {ww R u | w, u ∈ {0,1}+}. w, u ∈ {0,1}+}。 Is L regular language? L 是正则语言吗? Note that w, u cannot be empty.注意 w, u 不能为空。

I've tried to prove it is not regular language by the pumping lemma, but I failed when w = 0^p1^p , 01^p , (01)^p .我试图通过泵引理证明它不是常规语言,但是当 w = 0^p1^p , 01^p , (01)^p时我失败了。 Once I take y = 0^p or 1^p , xyyz will be 00.../11.../01^n0... etc.一旦我采取 y = 0^p1^p , xyyz 将是00.../11.../01^n0...等等。

And I cannot draw its DFA/NFA or write its regular expression to prove it is regular language.而且我无法画出它的 DFA/NFA 或写出它的正则表达式来证明它是正则语言。

So is L regular or not?那么L是正规的还是不正规的? How can I prove it?我该如何证明呢?

The language is not regular, and we can prove it using the Myhill-Nerode theorem.该语言不是规则的,我们可以使用 Myhill-Nerode 定理来证明它。

Consider the sequence of strings 01, 0101, ..., (01)^n, ...考虑字符串序列 01, 0101, ..., (01)^n, ...

First, notice that none of these strings are in the language.首先,请注意这些字符串都不是语言中的。 Any prefix of any of these strings which has even length is of the form (01)^2m for some m, and therefore just a shorter string in the sequence;任何这些字符串的任何具有偶数长度的前缀对于某些 m 都是 (01)^2m 的形式,因此在序列中只是一个较短的字符串; splitting such a prefix in two either has both substrings start with 0 and end with 1, or else it has the first substring start and end with 0 and the second start and end with 1. In either case, these strings are not of the form w(w^R)u for any w or u.将这样的前缀一分为二要么有两个子字符串以 0 开头和 1 结尾,要么它的第一个 substring 以 0 开头和结尾,第二个以 1 开头和结尾。在任何一种情况下,这些字符串都不是形式w(w^R)u 用于任何 w 或 u。

Next, notice that the shortest possible string which we can append to any of these strings, to produce a string in the language, is always the reverse of itself followed by either 0 or 1. That is, to turn 01 into a string in the language, we must append 100 or 101;接下来,请注意,我们可以将 append 转换为这些字符串中的任何一个,以生成语言中的字符串的最短可能字符串始终是其自身的倒数,后跟 0 或 1。也就是说,将 01 转换为语言,必须 append 100 或 101; there are no shorter strings we can append to 01 to get a string in the language.没有较短的字符串,我们可以 append 到 01 以获取该语言的字符串。 The same holds true for 0101: 10100 and 10101 are the shortest possible strings that take 0101 to a string in L. And so on for each string of the form (01)^n.对于 0101 也是如此:10100 和 10101 是将 0101 转换为 L 中的字符串的最短可能字符串。对于 (01)^n 形式的每个字符串,依此类推。

This means that each string of the form (01)^n is distinguishable with respect to the target language w(w^R)u.这意味着 (01)^n 形式的每个字符串相对于目标语言 w(w^R)u 是可区分的。 The Myhill-Nerode theorem tells us that a minimal DFA for a regular language has exactly as many states as there are equivalence classes under the indistinguishability relation. Myhill-Nerode 定理告诉我们,常规语言的最小 DFA 具有与不可区分关系下的等价类一样多的状态。 Because we have infinitely many distinguishable strings with respect to our language, a minimal DFA for this language must have infinitely many states.因为相对于我们的语言,我们有无限多的可区分字符串,所以该语言的最小 DFA 必须具有无限多的状态。 But, a DFA cannot have infinitely many states;但是,一个 DFA 不能有无限多的状态; this is a contradiction.这是一个矛盾。 This means that our language cannot be regular.这意味着我们的语言不可能是规则的。

The language is REGULAR:语言是常规的:

L = 00(0+1) + + 11(0+1) + + 0(11) + 0(0+1) + + 1(00) + 1(0+1) + L = 00(0+1) + + 11(0+1) + + 0(11) + 0(0+1) + + 1(00) + 1(0+1) +

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

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