Why is {a^n a^n | n >= 0} regular?

半世苍凉 提交于 2019-12-01 11:53:38
Grijesh Chauhan

Yes, Language {an an | n >= 0} is a regular language. To proof that certain language is regular, you can draw its dfa/regular expression. And you can drive do for this language as follows:

Because "anan for n >= 0" is same as "a2n for n >=0", and that is "set of all string contests of even number of symbol a" that is regular — regular expression for this is (aa)*.

Note, regular expressions is only possible for regular languages hence it is proved that {an an | n >= 0} is a regular language. and DFA would be:

I would suggest you to read this why languages like {an bn | n >= 0} are not regular.

First change the definition to the equivalent L = {a^2n | n >= 0}. Now observe that any string that belongs to L is simply a multiple of 2 as. Then change that definition to (aa)*, which is a regular expression since it only uses primitives for expressing regular languages - individual characters (a), concatenation (aa) and Kleene star (*). Now you're done.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!