918 views
1 votes
1 votes

Let L be a given context-free language over the alphabet {a, b}. Construct L1, L2 as follows.
Let L1 = L − {xyx | x, y ∈ {a, b}},
and L2 = L·L. Then,

   
   
 

(A) Both L1 and L2 are regular.

 

(B) Both L1 and L2 are context free but not necessarily regular.

 

(C) L1 is regular and L2 is context free.

 

(D) L1 and L2 both may not be context free

1 Answer

0 votes
0 votes

let $L_3=\left \{ xyx| x,y\,\, \epsilon (a+b)^{*}  \right \}$ 

$L_3=(a+b)^{*}$ is regular.

$L$ is CFL.

$L_1=L-L_3=L\bigcap (L_3)^{'}$

$(L_3)^{'}$ is regular

hence $L_1$ is CFL.

[edit]

thanks to  Anu007

But if we see carefully,

$L_1=L-(a+b)^{*}=\phi$i.e Regular


CFL are closed under concatenation hence $L_2$ is CFl.


Most appropriate answer is option $C$

edited by

Related questions

0 votes
0 votes
1 answer
1
codingo1234 asked Aug 20, 2017
493 views
Let L be CFL and M a regular language. Language L ⋂ M is always(a) always regular (b) never regular(c) always DCFL (d) always context free language
0 votes
0 votes
1 answer
4