• retagged by
18,518 views
59 59 votes

Let $L_1, L_2$ be any two context-free languages and $R$ be any regular language. Then which of the following is/are CORRECT?

  1. $L_1 \cup L_2$ is context-free
  2. $\overline{L_1}$ is context-free
  3. $L_1 - R$ is context-free
  4. $L_1 \cap L_2$ is context-free
  1. I, II and IV only
  2. I and III only
  3. II and IV only
  4. I only

Related Questions :

7 Answers

Best answer
54 54 votes

Statement I is TRUE as CFGs are closed under union.

Statement II is FALSE as CFGs are not enclosed under complementation.

Statement III is TRUE as $L1−R$ can be written as $L1\cap \overline{R}$. Regular language are closed under complementation and intersection of CFG and Regular is CFG.

Statement IV is FALSE as CFGs are not enclosed under intersection.

So, I and III are correct. Option B.

• edited by
22 22 votes
intersection of two CFL are not closed operation, and CFL also not closed under complimentation, 
CFL-reg we can write like this CFL $CFL\cap \bar{regular}$  so regular language closed under complimentation and intersection of CFL with regular is always CFL.
18 18 votes
CFLs are closed under union operation and difference with a regular language.Hence option i and iii are correct.

But CFLs are not closed under intersection and complementation.so option ii and iv are wrong.

Ans:B) i and iii
• edited by
9 9 votes

okay CFL s are closed under Union

so  1 is correct

option 2: L1' is not CFL as it is not closed under complementation

option 3 is nothing but intersection with regular language which is CFL

3 is correct so

4 is not correct as cfl is not closed under intersection

so from this i get 1,2,3 correct but that is not in option i think your option 2 will be a different..

so 1 and 3 correct

2 2 votes

1) CFLs are closed under union.

2)CFLs are not enclosed under complementation and intersection.

3) L1−R = L1 intersection R' = L1 intersection R So CFL on intersection with Regular it will be CFL

So Option B

0 0 votes

Only I and III are correct , so option B is correct.

  1. CFG are not closed under complement. and  IV. CFG are not closed under intersection.
Answer:
Position:
Show:

Related questions

50 50 votes
6 answers 6 answers
15.1k
15.1k views
Madhav asked Feb 14, 2017
15,100 views
Consider the following languages.$L_1 = \{a^p \mid p \text{ is a prime number} \}$$L_2 = \{ a^nb^mc^{2m} \mid n \geq 0, m \geq 0 \}$$L_3 = \{a^n b^n c^{2n} \mid n \geq 0 ...
42 42 votes
5 answers 5 answers
14.4k
14.4k views
Madhav asked Feb 14, 2017
14,366 views
Let $L(R)$ be the language represented by regular expression $R$. Let $L(G)$ be the language generated by a context free grammar $G$. Let $L(M)$ be the language accepted ...
116 116 votes
13 answers 13 answers
47.1k
47.1k views
Arjun asked Feb 14, 2017
47,094 views
Let $\delta$ denote the transition function and $\widehat{\delta}$ denote the extended transition function of the $\epsilon$-NFA whose transition table is given below:$$\...
48 48 votes
13 answers 13 answers
25.1k
25.1k views
khushtak asked Feb 14, 2017
25,056 views
Identify the language generated by the following grammar, where $S$ is the start variable.$ S \rightarrow XY$$ X \rightarrow aX \mid a$$ Y \rightarrow aYb \mid \epsilon$$...