Question
Consider the following languages:
Which of the following statements is/are FALSE?
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.
- is a well-known non-context-free language (provable via the pumping lemma for CFLs).
- is a Deterministic Context-Free Language (DCFL), accepted by a DPDA that matches 's and 's on its stack and then scans 's.
- is also a DCFL.
- , which is well-known to be non-context-free.
- The complement of , , 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: is not context-free, and are DCFLs.
- (B) FALSE: is context-free.
- (C) FALSE: is not context-free.
- (D) FALSE: The complement 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.