包含 epsilon 的语言的长度是多少?
1,我有一个可以识别两个单词“aa”和“epsilon”的NFA。 所以 NFA 识别的语言 L1 是一个集合 {aa, epsilon}。 该语言的长度是多少? 是|L1| = 1?或 |L1| = 2?
2、假设我有另一个NFA可以识别一个单词“aa”。 所以语言 L 将是一个集合 {aa} 在形式语言中,epsilon 属于所有语言。 因此实际上 L2 包含 epsilon,即集合 {aa, epsilon} 那么这个语言L2的长度是多少呢? 1还是2?
谢谢
1, I have an NFA that can recognize two words, "aa" and "epsilon".
So the language L1 this NFA recognizes is a set {aa, epsilon}.
What is the length of this language?
Is |L1| = 1? or |L1| = 2?
2, Assuming I have another NFA that can recognize one word "aa".
So the language L will be a set {aa}
In formal language, epsilon belongs to every language.
Thus in fact L2 contains epsilon, that is a set {aa, epsilon}
So what is the lenght of this language L2? 1 or 2?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
语言的长度是集合的基数。基数是指集合包含多少个元素。 L1 包含两个字符串。因此...
并非所有语言都包含 epsilon。您可能会想到“空集”,它与“epsilon”(“空字符串”)不同。空集的大小为零,它是 L2 的子集。仅包含 epsilon 的集合的大小为 1,并且不是 L2 的子集。 L2 包含一个字符串,因此它的长度是...
The length of a language is the cardinality of the set. Cardinality refers to how many elements the set contains. L1 contains two strings. Ergo...
Not every language contains epsilon. You're probably thinking of the "empty set" which is different from "epsilon", the "empty string". The size of the empty set is zero, and it is a subset of L2. The set containing only epsilon is of size one and is not a subset of L2. L2 contains one string, so it's length is...