Skip to content
Official PYQ · 1992

GATE CS 1992 Q02 — Context-free Grammars and Push-down Automata

Explain with AI

Context-free languages are:

Select all correct options
View worked solution

Answer: A;D

Context-Free Languages (CFLs) have specific closure properties under various operations:

  • Closed under Union (Option A): If L1L_1 and L2L_2 are CFLs generated by grammars with start symbols S1S_1 and S2S_2 respectively, we can define a new start symbol S→S1∣S2S \rightarrow S_1 \mid S_2 to generate L1∪L2L_1 \cup L_2. Hence, CFLs are closed under union.
  • Closed under Kleene closure (Option D): If LL is a CFL with start symbol S1S_1, we can define a new start symbol S→S1S∣ϵS \rightarrow S_1 S \mid \epsilon to generate L∗L^*. Hence, CFLs are closed under Kleene closure.
  • Not closed under Intersection (Option C): For example, the languages L1={anbncm∣n,m≥0}L_1 = \{a^n b^n c^m \mid n, m \ge 0\} and L2={ambncn∣n,m≥0}L_2 = \{a^m b^n c^n \mid n, m \ge 0\} are both context-free, but their intersection L1∩L2={anbncn∣n≥0}L_1 \cap L_2 = \{a^n b^n c^n \mid n \ge 0\} is a well-known non-context-free language.
  • Not closed under Complementation (Option B): By De Morgan's Laws, if CFLs were closed under complementation, they would also be closed under intersection since L1∩L2=L1‾∪L2‾‾L_1 \cap L_2 = \overline{\overline{L_1} \cup \overline{L_2}}. Since they are not closed under intersection, they cannot be closed under complementation.

Thus, the correct options are A and D.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Context-free Grammars and Push-down Automata questions