寻找常规语言的补语
你能帮我找到一种语言的补语吗?它以 abab - (a|b)*abab (over an Alphabet {a,b}) 结尾
我想,补语必须包含所有字符串,不以 abab 结尾。 在构建一个 DFA 来补充 (a|b)*abab
后,可以尝试使用 Rij-Algorithm 来完成此操作,但是请帮助我理解在没有 Automaton 和 Rij 的情况下它是如何工作的(因为 Automaton有 5 个状态)。
好吧,单词不能以abab
结尾。末尾的 a
和 b
四个字母有 24 种方式。好的,必须删除 abab
,这样就有 15 种组合。这是否意味着补语语言是 (a|b)*
。(a
和 b
的所有组合的并集没有abab
)?但是 (a|b)
还是一开始的样子吗?
请帮助我理解这一点。
Could you help me please to find a complement of a language, which ends with abab - (a|b)*abab (over an alphabet {a,b})
I guess, the complement must contain all string, that don't end with abab.
One can try to do it with Rij-Algorithm after building a DFA for complement of (a|b)*abab
, but pleaseee, help me to understand how it works without Automaton and Rij (because that Automaton has 5 states).
Ok, the words are not allowed to end with abab
. There are 24 ways for four letters of a
's and b
's at the end. Okay, abab
must be erased so there are 15 combinations. Does it mean, that the complement-language is (a|b)*
.(union of all those combinations of a
's and b
's without abab
)? But does (a|b)
still stay the same at the beginning?
Help me please to understand this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许我不太明白你的意思,但这不是更简单吗?我是
(a|b)*(a|bb|aab|bbab)
或事件(a|b)*(a|(b|(a|bb)a)b )
?PS 不要忘记还有比
abab
短的单词,并且所有这些单词也应该包含在内。即(a|b){0,3}
(其中{0,3}
表示重复次数 [0; 3])Maybe I quiet don't understand you, but isn't it much simplier. I'e
(a|b)*(a|bb|aab|bbab)
or event(a|b)*(a|(b|(a|bb)a)b)
?P.S. Don't forget that there is words shorter than
abab
and all of them should be included too. I.e.(a|b){0,3}
(where{0,3}
denotes amount of repeats [0; 3])