简体   繁体   English

为常规语言绘制 NFA

[英]Draw NFA for regular language

Here I found a example for a regular language. 在这里,我找到了一个常规语言的例子。

L = { a^n | L = { a^n | n>=2 } is regular. n>=2 } 是常规的。 Clearly, we can draw a finite automaton with 3 states.显然,我们可以画出具有 3 个状态的有限自动机。

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.如果我选择 n=11,这意味着该语言包含所有具有 11 个 a 序列的单词。 This can't be solved with a graph with 3 states, or am I wrong?这不能用具有 3 个状态的图表来解决,还是我错了?

given language is L = { a^n |给定的语言是 L = { a^n | n>=2 }. 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*).这里 a 的最小数量是 2,所以有限自动机包含 3 个状态 (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).类似地,如果所需的 a 的最小数量是 11(n>=11),那么有限自动机包含 12 个状态 (11+1)。
Therefore L = { a^n |因此 L = { a^n | n>=11} cannot be solved using 3 states n>=11} 不能使用 3 个状态求解

The given language L cannot be solved using 3 states for your condition ie, 11a's.给定的语言 L 不能使用 3 个状态来解决您的条件,即 11a。 For every word to contain a sequence of 11 a's, there should be a minimum of 11 a's.对于包含 11 个 a 的序列的每个单词,至少应该有 11 个 a。 So the graph should contain (11+1)=12 States.所以该图应该包含 (11+1)=12 个状态。 Therefore it can't be solved using 3 states.因此它不能使用 3 个状态来解决。

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

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