简体   繁体   English

确定DFA中的州数

[英]Determining number of states in a DFA

For Σ = {a,b,c,d,e,...,z}, consider the set L of words w such that the last symbol of w has not appeared before. 对于Σ= {a,b,c,d,e,...,z},请考虑单词w的集合L,以使w的最后一个符号之前没有出现过。 For example, the words apple, google, k, and ε are in L, but the words potato, and nutrition are not in L. Suppose we want to construct a DFA for this language. 例如,苹果,谷歌,k和ε这两个词在L中,但是土豆和营养这两个词不在L中。假设我们要为此语言构建DFA。 How many states will it have (minimally)? (最少)有几个州? Describe the DFA succinctly: do not attempt to draw it, but explain its formal definition, (eg states and transitions) using a suitable mathematical notation. 简要描述DFA:不要尝试绘制DFA,而应使用适当的数学符号解释其正式定义(例如状态和转换)。

I don't need the whole definition, just a start as to how many states it will have and why. 我不需要整个定义,而仅是关于它将具有多少个状态以及原因的一个开始。 From there I'm comfident I can figure it out. 从那里我很自以为是。

Some hints: 一些提示:

  • You're going to need one state for each possible subset of Σ so that you can keep track of which characters you've seen so far. 您将需要为Σ的每个可能子集提供一种状态,以便可以跟踪到目前为止所看到的字符。

  • For each subset of Σ, you'll need another state to represent "this set of characters, where the last character read happened to be in the set." 对于Σ的每个子集,您将需要另一个状态来表示“该字符集,其中最后一个读取的字符恰好在该字符集中”。

I'll leave the rest of the details to you and you'll have to think about how to formally prove this is correct. 我将其余的细节留给您,您将不得不考虑如何正式证明这是正确的。

Hope this helps! 希望这可以帮助!

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

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