Search code examples
algorithmmembershipregular-language

Exhibiting an algorithm that determines if L = L*, given any regular language L


I am studying membership algorithms and I am working on this particular problem which says the following:

Exhibit an algorithm that, given any regular language L, determines whether or not L = L*

So, my first thought was, we have L* which is Kleene star of L and to determine if L = L*, well couldn't we just say that since L is regular, we know L* is by definition which states that the family of regular languages is closed under star-closure. Therefore L will always be equal to L*?

I feel like there is definitely a lot more to it, there is probably something I am missing. Any help would be appreciated. Thanks again.


Solution

  • since L is regular, we know L* is by definition which states that the family of regular languages is closed under star-closure. Therefore L will always be equal to L*?

    No. Regular(L) --> Regular(L*), but that does not mean that L == L*. Just because two languages are both regular does not mean that they are the same regular language. For instance, a* and b* are both regular languages, but this does not make them the same language.

    A example of L != L* would be the language L = a*b*, and thus L* = (a*b*)*. The string abab is part of L* but not part of L.

    As far as an algorithm goes, let me remind you that the concept of a regular language is one that can be parsed by a DFA - and for any given DFA, there is a single optimal reduction of that DFA.