Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is concatenation of a non regular language with a regular language always not regular?

Tags:

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.

like image 209
RamsesXVII Avatar asked Nov 21 '16 13:11

RamsesXVII


People also ask

Is concatenation a regular language?

Concatenation: the concatenation of two regular languages is also a regular language. Complement: the complement of a regular language is also a regular language. "*" Operator: the concatenation of 0 or more strings in a regular language is also a regular language.

Is concatenation closed under regular languages?

Regular languages are closed under union, concatenation, star, and complementation.

Can the union of a regular language and a non-regular language be regular?

(b) Union of a regular language with a disjoint non-regular language cannot be regular. Ans: True. Let L1 is a regular language and L2 is a non−regular language and they are disjoint i.e. L1 ∩ L2 = ∅. Suppose L = L1 ∪ L2 and L is regular (since regular languages are closed under union).

Is the complement of a non-regular language regular?

The complement of a nonregular language is never regular. If L is nonregular and Lc were regular, then (Lc)c = L would be regular, a contradiction. Therefore, Lc in your example isn't regular.


2 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.

like image 168
Hyruma92 Avatar answered Sep 25 '22 16:09

Hyruma92


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)*

like image 32
Lewis Kelsey Avatar answered Sep 24 '22 16:09

Lewis Kelsey