为正则语言绘制NFA

发布于 2025-01-12 22:04:10 字数 286 浏览 4 评论 0原文

在这里我发现常规语言的示例。

L = {a^n | n>=2 } 是有规律的。显然,我们可以画出一个具有 3 个状态的有限自动机。

我问自己这张图会是什么样子。如果我选择 n=11,这意味着该语言包含具有 11 个 a 序列的所有单词。这不能用具有 3 个状态的图来解决,还是我错了?

Here I found a example for a regular language.

L = { a^n | n>=2 } is regular. Clearly, we can draw a finite automaton with 3 states.

I was asking myself how this graph would look like. If I choose n=11, this means, that the language contains all words with a sequence of 11 a's. This can't be solved with a graph with 3 states, or am I wrong?

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

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

发布评论

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

评论(2

Hello爱情风 2025-01-19 22:04:10

给定语言是 L = { a^n | n>=2}。
这里a的最小数量是2,所以有限自动机包含3个状态(2+1)
=>(q0,a)->(q1,a)->(qf,a*)。
类似地,如果所需的 a 的最小数量为 11(n>=11),则有限自动机包含 12 个状态 (11+1)。
因此 L = { a^n | n>=11} 无法使用 3 种状态求解

given language is L = { a^n | n>=2 }.
here the minimum number of a's is 2, so the finite automata contains 3 states(2+1)
=>(q0,a)->(q1,a)->(qf,a*).
Similarly if the minimum number of a's required is 11(n>=11),so the finite automata contains 12 states (11+1).
Therefore L = { a^n | n>=11} cannot be solved using 3 states

入怼 2025-01-19 22:04:10

给定的语言 L 无法使用您的条件的 3 个状态(即 11a)来求解。对于包含 11 个 a 序列的每个单词,应该至少有 11 个 a。所以该图应包含 (11+1)=12 个状态。因此不能使用 3 种状态来解决。

The given language L cannot be solved using 3 states for your condition i.e, 11a's. For every word to contain a sequence of 11 a's, there should be a minimum of 11 a's. So the graph should contain (11+1)=12 States. Therefore it can't be solved using 3 states.

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