edited by
288 views

1 Answer

Best answer
1 votes
1 votes
L2 will be CFL only option C os correct.

Its given that L1 is CFL also

prefix of every string in L2 is an element of the language L1.

Thereofre we can say that

w'.w is in L2, implies,

L1.w1 is a string in L2 (since w' is a cfl)

But the trick here is we can extend the lenght of w' so that it can cover the whole string just leaving one symbol either a or b in the end.

Eg. aaabbaaab

If this is a string in L2 it is pf form w'.w, now we can extend w' from aaabbaaa (which will still be a prefix) leaving just b in end for w.

CFL.a or CFL.b will be L2 therefore it is a CFL only.
selected by

Related questions