简体   繁体   English

这两个离散有限自动机有何不同?

[英]How do these two discrete finite automata differ?

I have the discrete finite automaton defined by the following statement: 我有以下语句定义的离散有限自动机:

{ω | {ω| ω is any string not in a* ∪ b*} ω是不在*∪b *}中的任何字符串

For some reason I'm just not understanding the "a* ∪ b*" part. 出于某种原因,我只是不理解“a *∪b *”部分。 I know what a union is, but how is this different from a* b*? 我知道联盟是什么,但这与a * b *有什么不同? Is the resulting DFA of these two statements the same? 这两个陈述的结果DFA是否相同? I need to first create the DFA for the complement of this language, and then use that DFA to create the DFA of the above language based on that. 我需要首先为此语言的补充创建DFA,然后使用该DFA基于此创建上述语言的DFA。

Can someone help me understand this? 有人能帮助我理解这个吗?

Let's break down the definitions and then it'll be simpler to see the difference between a* ∪ b* and a* b* . 让我们分解定义,然后看一下a* ∪ b*a* b*之间的区别会更简单。

  • The set x* refers to any non-negative number (including zero) of times of the symbol x . 集合x*指的是符号x任何非负数(包括零)。 This includes the empty string ( ε ), x , xx , xxx and so forth. 这包括空字符串( ε ), xxxxxx等。
  • The set XY refers to any symbol that is in X followed by Y 集合XY指的是X后跟Y任何符号
    • If X = {1, 2} and Y = {a, b} , then XY = {1a, 1b, 2a, 2b} 如果X = {1, 2}Y = {a, b} ,则XY = {1a, 1b, 2a, 2b}
  • The set X ∪ Y refers to the union of the sets described by X and Y . 集合X ∪ Y指的是由XY描述的集合的并集。 This includes any symbols that may be in set X OR Y but not necessarily both. 这包括可能在XY集合中但不一定都在两者中的任何符号。
    • If X = {1, 2} and Y = {a, b} , then X ∪ Y = {1, 2, a, b} 如果X = {1, 2}Y = {a, b} ,那么X ∪ Y = {1, 2, a, b}

From the above we can tell deduce that the set of elements in a* b* is any element in the set a* followed by any element in the set b* (remember since we're using the * notation, the empty string is included). 从上面我们可以推断出a* b*中的元素集a*集合a*的任何元素,后跟集合b*中的任何元素(记得因为我们使用*表示法,所以包含空字符串)。 a* = {ε, a, aa, aaa, aaaa, ... } and b* = {ε, b, bb, bbb, bbbb, ... } . a* = {ε, a, aa, aaa, aaaa, ... }b* = {ε, b, bb, bbb, bbbb, ... } Therefore a* b* = {ε, a, b, ab, aa, aab, aabb, bb, abb, aabb, ...} . 因此a* b* = {ε, a, b, ab, aa, aab, aabb, bb, abb, aabb, ...}

Similarly we now know that a* ∪ b* includes any elements in the set a* OR b* . 类似地,我们现在知道a* ∪ b*包括集合a* OR b*中的任何元素。 Therefore a* ∪ b* = {ε, a, b, aa, bb, aaa, bbb, aaaa, bbbb, ...} . 因此a* ∪ b* = {ε, a, b, aa, bb, aaa, bbb, aaaa, bbbb, ...} Notice there isn't any element that has both the symbols a AND b because that is not in the set. 请注意,没有任何元素同时具有符号a AND b因为它不在集合中。

Finally, you can ask what are the elements that are in a* b* BUT are not in a* ∪ b* . 最后,你可以问一下a* b* BUT中的元素不在a* ∪ b* a* b* \\ a* ∪ b* = { x ∈ a* b* | x ∉ a* ∪ b*} = { ab, abb, abbb, ... aab, aabb, aabbb, ..., aaab, aaabb, ... } a* b* \\ a* ∪ b* = { x ∈ a* b* | x ∉ a* ∪ b*} = { ab, abb, abbb, ... aab, aabb, aabbb, ..., aaab, aaabb, ... } . a* b* \\ a* ∪ b* = { x ∈ a* b* | x ∉ a* ∪ b*} = { ab, abb, abbb, ... aab, aabb, aabbb, ..., aaab, aaabb, ... } These are the elements with both symbols a and b in them. 这些是两个符号的元素a b在它们。

a* U b* is the language of all strings of a only along with all strings of b only: {empty, a, b, aa, bb, aaa, bbb, ...} . a* U b*是所有串的语言a只有伴随着所有字符串b只: {empty, a, b, aa, bb, aaa, bbb, ...} The strings not in this language are those strings that contain not only a s or b s but both: {ab, ba, aab, aba, baa, abb, bab, bba, ...} . 在这门语言的字符串是那些不仅含有字符串a S或b秒,但二者: {ab, ba, aab, aba, baa, abb, bab, bba, ...} a*b* is yet another language which consists of all the strings where any a s come before any b s: {empty, a, b, aa, ab, bb, ...} . a*b*又是它由其中任何一个的所有字符串的另一种语言的a š任何来之前b S: {empty, a, b, aa, ab, bb, ...} a*b* is a superset of a* U b* but it is not equal to it. a*b*a* U b*的超集,但它不等于它。 It is neither a subset nor a superset of the language of strings not in a* U b* but it does overlap in many places. 它既不是字符串语言的子集也不是超集,而不是在a* U b*但它在很多地方都重叠。 Since all three languages are distinct, all three have distinct DFAs. 由于所有三种语言都是不同的,所以三种语言都有不同的DFA。

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

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