正则表达式的FA

发布于 2024-09-10 20:23:24 字数 117 浏览 1 评论 0原文

给出字母表 {a,b} 的字符串集合的 FA,其中包含或都不包含 aa 和 bb 作为子字符串。 这意味着 FA 接受所有不带 aa 和 bb 的字符串作为子字符串。如果我错了请纠正我并给我一些提示。谢谢大家。 :D

Give an FA for the set of the strings with alphabet {a,b} that contain both or neither aa and bb as substrings.
It means FA accept all strings without aa and bb as substrings. correct me if I wrong and give me some hint. Thanks all. :D

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情痴 2024-09-17 20:23:24

等等,它是否接受“aaabababbb”?你说两者都不说,后来又说两者都不说。

这是家庭作业,所以我们不会为您绘制机器,但这里有一些提示:

首先,一旦您同时看到了 aa 或 bb,您需要进入接受接收状态并且永远不要离开。

其次,在您看到“aa”或“bb”之前,您需要处于接受状态,因此您也从接受状态开始,因为到目前为止,两者都不是。

在您看到“aa”或“bb”(但不是两者)之后的任何状态都不是接受状态,但也不是接收器,因为您将来总是可以看到其他类型。

开始用这些术语思考并构建一个高级架构。然后弄清楚细节,因为你的字母表中只有两个字母。

Wait, does it accept "aaabababbb" or not? You said neither or both, and later said only neither.

It's homework so we're not going to draw the machine for you, but here are a few tips:

First, once you have seen both aa or bb, you need to head into an accepting sink state and never leave.

Second, until you see "aa" or "bb", you need to be in an accepting state so you also start in an accepting state since up to now it is neither.

Any state after you have seen "aa" or "bb" (but not both) is not an accepting state but is not a sink since you could always see the other type in the future.

Start thinking in these terms and build a high-level schema. then figure out the details as you only have two letters in your alphabet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文