closed by
555 views
0 votes
0 votes
closed with the note: answer in comments

If a language L1 is given as anb and L2 is given as {a,b}* , then the language L1 - L2 will be : regular or CFL and why ?
My doubt is that since L2 is a regular language and L1 is CFL and L2 will contain all strings in L1, so L1 - L2 will give {} which is regular. 
But I found in some book the since L1 is CFL and L2 is regular L1 - L2 can be written as $L1\cap L2¯$ ( CFL intersection regular complement ). Complement of regular is regular and intersection of CFL with regular is closed and the language will be CFL.

Which one is right and why ?

closed by

1 Answer

1 votes
1 votes
Remember that all languages are closed in following operations:

1)Intersection with RL (L union R)

2)Difference with RL (L - R)

Related questions

1 votes
1 votes
1 answer
1
raviyogi asked Dec 30, 2017
689 views
CFL over a single alphabet are always->A. dcflB. regularC. dcfl but not regulard. non regular
0 votes
0 votes
0 answers
2
3 votes
3 votes
1 answer
3
iarnav asked Nov 1, 2017
582 views
If L1 = Regular L and L2 = CFL then L1 UNION L2?= L1 U L2= Reg L U CFL= CFL U CFL= CFL is it True?
1 votes
1 votes
0 answers
4
Na462 asked Sep 9, 2018
1,890 views
If L1 is CSL and L2 is CFL, then which of the following is correct ?A.L1' - L2 is CSL alwaysB. L1 - L2' is CSL alwaysC. L1 intersection Regular is Regular alwaysD. L1.L2...