Concatenation & union - common and context-free languages

Given the context of L1, free irregular language. This regular language is L2.

Is it possible that L1 U L2 = the correct language? Is it possible that L1 * L2 = the correct language?

I think the second is impossible. But I'm not sure.

I would like to see an example if one of the above statements (or both) is / true.

+3
source share
3 answers

Is it possible that L1 U L2= ordinary language?

Yes it is possible.

Simple case: if L 1 is a subset of L 2, then it L1 U L2will be regular ( ), for example: L=L2 1: { | where } andanbnn >= 0L2 = (a + b)*

is it possible that L1 * L2 = the correct language?

. - - ( L1 L1 * L2).

: CS 273:

0

, -

L1 = a ^ nb ^ n, CFL, L2 = Ø, .

, L1.L2 = (a ^ nb ^ n).Ø = Ø,

. ,   , .

0

   , L1 U L2 = ?

, . :

L1 = {0*1*} () L2 = {0^n1^n |n>=0} ( ).

L = L1 U L2 = {0*1*}, , . , , - .

, L1·L2 = ?

- - . :

L = L1·L2 = {(0*1*)·(0^n1^n) |n>=0} ( ).

, , , L1 L2 Ø, L1·L2 Ø (). , Ø .

: Geeks for Geeks

0

All Articles