Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I thought all regular languages could be expressed with regular expressions (if a language is regular, it can be expressed with regex), but I have been told that you need all three of the regular operations (concatenation, union, and star) for that to hold.

For example, I have been told that if I can only use the union and concatenation regex operations (2 out of the 3), there would be a regular language I can't describe with just those two.

Same with just Kleene star and union. What are some examples of this?

share|cite|improve this question
up vote 18 down vote accepted

With only union and concatenation, you can't describe any infinite language. The union and concatenation can only produce finitely many strings. With only union and the Kleene star, you can't describe a language such as $L = \{ab\}$, because there's no way to concatenate an expression generating only $a$ with an expression generating only $b$. With only concatenation and the Kleene star, you can't describe a language such as $L = \{a,b\}$.

share|cite|improve this answer
.... and $\{a,b\}$ is not possible without union. – Raphael Feb 1 at 15:30
So why can't I described L={a,b} without union? Is it because they can't be represented as separate elements with star and concatenation? It could only do ab, bb, aba etc.? – user3295674 Feb 1 at 23:53
@user3295674 Exactly. – DylanSp Feb 2 at 2:07
and something like L={a*} would not be possible with just union and concatenation, right? Thank you so much! – user3295674 Feb 2 at 4:16
I don't even understand how star would be defined without concatenation being available. – G. Bach Feb 2 at 12:46

A perhaps more interesting question is that of star height. The other answer mentions that if you can't use star, then you can only generate finite languages. What if you are not allowed to nest stars (so something like $(a^*b^*c)^*$ is not allowed)? What if you are only allowed to nest stars two levels deep? $d$ levels deep? It turns out that for every $d$ there are regular expressions expressible in nesting $d$ but not in nesting $d-1$. The link contains some examples.

share|cite|improve this answer

Another interesting case arises by allowing complementation as a possible operation. Using union, concatenation and complement (but no star), one can obtain the language $A^*$ as the complement of the empty language. One can also obtain languages like $(ab)^*$ and $(a(ab)^*b)^*$ (not so easy to see if you don't know the trick), but there is no way to obtain $(aa)^*$.

If one now allows to use star, but not nested stars, then it is an open problem (for at least 45 years) to know whether one can obtain all regular languages. This question is known as the generalized star height problem. It is similar to the star height problem mentioned by Yuval Filmus, with the difference that complementation is now allowed.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.