Question

Consider the following languages:

L1={ww∣w∈{a,b}∗}L_1 = \{ww \mid w \in \{a, b\}^*\}
L2={anbncm∣m,n≥0}L_2 = \{a^n b^n c^m \mid m, n \ge 0\}
L3={ambncn∣m,n≥0}L_3 = \{a^m b^n c^n \mid m, n \ge 0\}

Which of the following statements is/are FALSE?

Choose every correct option
Official answer and solution
Official answer
B, C and D
From
Official GATE 2022 answer key

Solution

Evaluate standard CFL and DCFL classification for the given languages and identify the FALSE statements.

  1. L1={ww∣w∈{a,b}∗}L_1 = \{ww \mid w \in \{a, b\}^*\} is a well-known non-context-free language (provable via the pumping lemma for CFLs).
  2. L2={anbncm∣m,n≥0}L_2 = \{a^n b^n c^m \mid m, n \ge 0\} is a Deterministic Context-Free Language (DCFL), accepted by a DPDA that matches aa's and bb's on its stack and then scans cc's.
  3. L3={ambncn∣m,n≥0}L_3 = \{a^m b^n c^n \mid m, n \ge 0\} is also a DCFL.
  4. L2∩L3={anbncn∣n≥0}L_2 \cap L_3 = \{a^n b^n c^n \mid n \ge 0\}, which is well-known to be non-context-free.
  5. The complement of L1L_1, L1‾={x∈{a,b}∗∣x≠ww}\overline{L_1} = \{x \in \{a, b\}^* \mid x \ne ww\}, is a context-free language (it can be generated by a non-deterministic PDA that guesses the mismatch position).

Now evaluate each statement to find which are FALSE:

  • (A) TRUE: L1L_1 is not context-free, and L2,L3L_2, L_3 are DCFLs.
  • (B) FALSE: L2L_2 is context-free.
  • (C) FALSE: L2∩L3L_2 \cap L_3 is not context-free.
  • (D) FALSE: The complement L1‾\overline{L_1} is context-free.

Thus, statements (B), (C), and (D) are FALSE.

Final answer

Options (B), (C), (D)

Common trap

Believing that the complement of a non-CFL cannot be a CFL.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2022 Computer Science and Information Technology (CS)
Question
48 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.