简体   繁体   English

如何 L={ww^Rx| 其中 w, x 属于 {a,b}^* } 是常规语言?

[英]How L={ww^Rx| where w, x belongs to {a,b}^* } is a regular language?

I have understood that L={wxw^r|w,x belongs to {a,b}^* } is regular because it turns out to be the pattern of starting and ending with same symbol but I am not getting the proper explanation that how to say L={ww^rx|w,x belongs to {a,b}*} is regular language using DFA design.我知道 L={wxw^r|w,x belongs to {a,b}^* } 是规则的,因为它原来是以相同符号开始和结束的模式,但我没有得到正确的解释How to say L={ww^rx|w,x belongs to {a,b}*} 是使用DFA设计的正则语言。 Please help me in understanding this!请帮助我理解这一点!

This is a trick question.这是一个技巧问题。 The language L as you have specified is the language of the regular expression (a + b)* , that is, any string of a's and b's.您指定的语言 L 是正则表达式(a + b)*的语言,即 a 和 b 的任意字符串。 The trick is that for any string y = s1.s2.s3...sk where si in {a, b} , we can write y = wxw^R where w is the empty string and x = y .诀窍是对于任何字符串y = s1.s2.s3...sk where si in {a, b} ,我们可以写y = wxw^R where w is the empty string and x = y Basically, the trick is that we can always choose w to be the empty string, and in that case we are left with L = {x | x in {a, b}^*}基本上,诀窍是我们总是可以选择w为空字符串,在这种情况下我们只剩下L = {x | x in {a, b}^*} L = {x | x in {a, b}^*} , clearly regular. L = {x | x in {a, b}^*} ,显然是规则的。 Another way of thinking about it is this: can you find any string of a's and b's that is not in L?另一种思考方式是:你能找到任何不在 L 中的 a 和 b 串吗? Is it not in L even if you take w to be the empty string?就算你把w当空串也不在L里吗?

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

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