edited by
13,677 views
41 votes
41 votes

Consider the following languages over the alphabet $\Sigma = \left \{ a, b, c \right \}$. Let $L_{1} = \left \{ a^{n}b^{n}c^{m}\mid m,n \geq 0 \right \}$ and $L_{2} = \left \{ a^{m}b^{n}c^{n}\mid m,n \geq 0 \right \}$.

Which of the following are context-free languages?

  1. $L_{1} \cup L_{2}$
  2. $L_{1} \cap L_{2}$
  1. I only
  2. II only
  3. I and II
  4. Neither I nor II
edited by

6 Answers

0 votes
0 votes

The L1 is deterministic CFL  with final state accepted by both empty stack and final state. 

L2 is deterministic CFL with final state accepted by final state only. 

Union of two CFL is a CFL but intersection of two CFL can/cannot be CFL. Hence option A is correct

Answer:

Related questions

44 votes
44 votes
6 answers
2
Arjun asked Feb 14, 2017
11,603 views
If $G$ is a grammar with productions$S\rightarrow SaS\mid aSb\mid bSa\mid SS\mid\epsilon$where $S$ is the start variable, then which one of the following strings is not g...
74 votes
74 votes
8 answers
3