HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How to determine if a regular language L* exists

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
howregularlanguagedetermineexists

Problem

I'm trying to make sense of regular languages, operations on them, and Kleene operations.

Let's say I define a language with the alphabet {x, y}. Let's further say that I place the restriction that there can be no string in the language that contains the substring 'xx'. Thus, my language could be expressed as L = {y, xy, yx}, since that language conforms to the definition.

Could I then argue that there is no language L since L could contain LL? That is, can a particular but arbitrarily chosen finite language that conforms to the definition exist, but since LL can't be in L, L cannot exist? Or must any L necessarily omit anything preventing L* from existing?

Solution

$L^$ always exists. ${}^$ is an operation on languages, just like ${}^2$ is an operation on numbers – whenever you have a number $x$, there is a number $x^2$ and, similarly, whenever you have a language $L$, there is a language $L^$. Specifically, $L^$ is the language of all strings that can be made by concatenating zero or more strings from $L$. That's well-defined for any language $L$.

What you've observed is that $L^$ might have different properties from $L$. If we take your example of $L = \{y,yx,xy\}$, we see that no string in $L$ has $xx$ as a substring ($L$ is not the only language with this property but that's beside the point). On the other hand, $L^$ includes the string $yxxy$, which does have $xx$ as a substring. That doesn't mean that $L^$ doesn't exist; it just means that it doesn't have some property that $L$ has. Well, that's no surprise because $L$ and $L^$ are often different languages, in which case they can't have exactly the same properties.

Context

StackExchange Computer Science Q#52358, answer score: 4

Revisions (0)

No revisions yet.