Skip to content
Official PYQ · 2022

GATE CS 2022 Q38 — Context-free Grammars and Push-down Automata

Explain with AI

Consider the following languages:

  • L1={ww∣w∈{a,b}∗}L_{1} = \{ ww | w \in \{a,b\}^{\ast} \}
  • L2={anbncm∣m,n≥0}L_{2} = \{a^{n} b^{n} c^{m} | m,n \geq 0 \}
  • L3={ambncn∣m,n≥0}L_{3} = \{a^{m} b^{n} c^{n} | m,n \geq 0 \}

Which of the following statements is/are FALSE?\text{FALSE}?

Select all correct options
View worked solution

Answer: B;C;D

Let us analyze the properties of the given languages:

  • L1={ww∣w∈{a,b}∗}L_1 = \{ ww \mid w \in \{a,b\}^* \}: This is a classic non-context-free language. However, its complement L1‾\overline{L_1} is context-free.
  • L2={anbncm∣m,n≥0}L_2 = \{ a^n b^n c^m \mid m,n \ge 0 \}: This is a deterministic context-free language (DCFL) because we can match aa's and bb's using a deterministic pushdown automaton (DPDA) and then read any number of cc's.
  • L3={ambncn∣m,n≥0}L_3 = \{ a^m b^n c^n \mid m,n \ge 0 \}: This is also a DCFL because we can skip aa's and then match bb's and cc's using a DPDA.
  • L2∩L3={anbncn∣n≥0}L_2 \cap L_3 = \{ a^n b^n c^n \mid n \ge 0 \}: This is a well-known non-context-free language.

Now, let us evaluate each statement to find which ones are FALSE:

  1. Statement A (TRUE): L1L_1 is indeed not context-free, and both L2L_2 and L3L_3 are deterministic context-free.
  2. Statement B (FALSE): L2L_2 is context-free, so the claim that "neither L1L_1 nor L2L_2 is context-free" is false.
  3. Statement C (FALSE): L2∩L3L_2 \cap L_3 is not context-free, so the claim that all three are context-free is false.
  4. Statement D (FALSE): The complement of L1L_1 is context-free, so the claim that "neither L1L_1 nor its complement is context-free" is false.

Thus, the false statements are B, C, 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