29 29 votes Suppose that $L_1$ is a regular language and $L_2$ is a context-free language. Which one of the following languages is $\text{NOT}$ necessarily context-free? $L_1 \cap L_2$ $L_1 \cdot L_2$ $L_1- L_2$ $L_1\cup L_2$ Theory of Computation gatecse-2021-set1 context-free-language theory-of-computation one-mark + – Arjun 15.0k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 41 41 votes Correct Option: $C$ Given, $L_1-$ Regular Language (RL) $L_2-$ Context-Free Language (CFL) $(A)$ $L_1 \cap L_2 \to$ CFL Because intersection operation with regular languages is closed under CFLs. Hence, True. $(B)$ $L_1.L_2\to$ CFL Every regular language is a CFL and CFLs are closed under concatenation. Hence, True. $(C)$ $L_1-L_2$ $\equiv$ $L_1 \cap L_2 ^{c}$. Suppose, let’s consider $L_1 = \Sigma^*$ and $L_2$ as any CFL and we get $L_1 \cap \overline{L_2} = \overline{L_2}.$ Since CFLs aren’t closed under complementation, this means $L_1 – L_2$ NEED NOT be a CFL! Hence, False. $(D)$ $L_1\cup L_2 \to$ CFL Since CFLs are closed under union operation and a regular language is also a CFL. Hence, True. Ref: Closure Property of Language Families Hira Thakur answered Feb 19, 2021 • edited May 5, 2021 by Arjun Hira Thakur comment Share Follow See all 3 Comments 3 3 Comments reply swami_9 commented Jul 30, 2021 reply Follow flag https://gatecse.in/closure-property-of-language-families/ in this it is given Regular ⊂ DCFL ⊂CFL ⊂ REC ⊂ RE. regular language is subset of CFL, if we take L1= Σ* and L2 some CFL then it won’t be subset right? i am not understanding this “Suppose, let’s consider L1=Σ∗ and L2 as any CFL and we get L1∩L2 “ 0 0 replyShare Abhrajyoti00 commented Oct 18, 2022 reply Follow flag $L1-L2 = Reg \ – \ CFL = Reg\cap CFL' = Reg \ \cap CSL = CSL$But, $L2 – L1 = CFL \ – \ Reg = CFL\cap Reg' = CFL\cap Reg = CFL$ (Because intersection operation with regular languages is closed under ALL LANGUAGES.) 11 11 replyShare Rohit ._. commented Jan 7 reply Follow flag https://gateoverflow.in/357528/gate-cse-2021-set-2-question-12#a_list_title Option A from this question is same, L1-L2 => L1 intersection L2' 0 0 replyShare Please log in or register to add a comment.
1 1 vote C option is correct. Cfl are not closed under - shubham shende answered Feb 18, 2021 shubham shende comment Share Follow See 1 comment 1 1 comment reply zxy123 commented Feb 18, 2021 reply Follow flag Correct, for example $\bar{ww}$ is CFL but $\Sigma^* – \bar{ww}$ is CSL. 1 1 replyShare Please log in or register to add a comment.
1 1 vote Answer will be C. Assume L1 to be (a+b)* then L1 - L2 will be L2' that is Context Sensitive. Krish_Vg answered Jan 9 Krish_Vg comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes A) CFL intersection with Regular language is CFL B) All Regular languages are CFL, CFLs are closed under concatenation D) CFLs are closed under union C) CFLs are not closed under set difference Option C) is correct Ashwani Kumar 2 answered Feb 19, 2021 Ashwani Kumar 2 comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes JUST TAKE THE REGULAR LANGUAGE TO BE SIGMA STAR THEN L1 - L2 IS SIMPLY L2 COMPLEMENT SO, L2 COMPLEMENT IS COMPLEMENT OF CFL AND IT IS NOT CLOSED AS WE KNOW Gowtham_Kumar answered Jun 8 Gowtham_Kumar comment Share Follow 0 reply Please log in or register to add a comment.