I'd like to know if the concatenation between two language (one regular and the other not) is always not regular or it may happen that the output is a regular language. Thanks.
-
I'm voting to close this question as off-topic because it not a programming problem. It is a problem in theoretical computer science. – Raymond Chen Nov 21 '16 at 14:44
3 Answers
No, because we can find a counterexample that prove that sometimes it happen:
L1 not regular: (a^2)^n with n>=0
L2 regular: a*
The concatenation produce the language L3= aa* and this is obviously regular.

- 836
- 8
- 24
-
This proof is correct, except (a^2)^n with n>1 is a regular language with regular expression (aa)(aa)*. A better example would have been a^(2^n) with n >= 0. – Patrick87 Feb 22 '17 at 18:56
-
a^(2^n) n>=0 is non regular except concatenating it with a* which is regular, produces a regular language. It becomes L = {a^(2^n)a*, n>=0} which basically cancels down to L={aa*} which is regular.
Patrick87, (a^2)^n n>1 has regular expression (aaaa)(aa)*

- 4,129
- 1
- 32
- 42
Remember that the empty language ∅ and the singleton language of the empty string {ε} are both regular. The concatenation of any nonregular language and the empty language is the empty language (regular), and the concatenation of any nonregular language and {ε} is the original language (nonregular). Therefore, the answer depends on the choice of languages.
(@Hyruma92 gives another example of where the concatenation gives a regular language; I added this answer because I think it more directly and simply gets you there. The intuition here is that the empty language is the zero element for language concatenation and {ε} is the identity element, which motivates why you might want to try them out.)

- 362,284
- 104
- 897
- 1,065