Let G1 ,G2 be Context Free Grammars (CFGs) and RR be a regular expression. For a grammar G, let L(G) denote the language generated by G. Which ONE among the following questions is decidable?
Correct Answer :
Is L(G1)=∅?
Solution :
The correct option is: Is ?
To understand why this question is decidable, let us analyze the properties of Context-Free Grammars (CFGs) and the languages they generate, and examine the decidability of each of the options provided.
1. Decidability of Emptiness for CFGs (Is ?)
The emptiness problem for Context-Free Grammars asks whether a given CFG generates any string at all, i.e., whether .
This problem is decidable. We can determine if the language is empty by using a simple algorithm that finds all generating variables in the grammar:
- A variable is generating if it can derive a terminal string (i.e., where ).
- We start by marking all terminal symbols as generating.
- We then iteratively mark a variable as generating if there is a production rule where all symbols in are already marked as generating.
- This process continues until no new variables can be marked. If the start symbol of the grammar is marked as generating, then ; otherwise, .
Since this algorithm is guaranteed to terminate in finite steps, the emptiness problem for CFGs is decidable.
2. Why the other options are undecidable:
- Is ?: The equivalence problem for two CFGs is a classic undecidable problem. There is no algorithm that can determine if two arbitrary CFGs generate the same language.
- Is ?: The intersection-emptiness problem for two CFGs is also undecidable. This can be proven by reduction from the Post Correspondence Problem (PCP).
- Is ?: Testing whether a context-free language is equal to a regular language is undecidable. Specifically, testing whether (the universality problem for CFGs, where is a regular language) is undecidable.
Therefore, the only question among the choices that can be decided by an algorithm in all cases is "Is ?".
Access expert-curated educational resources and study materials—completely free.
Create, conduct, and manage professional online assessments with Mindyard. Perfect for teachers and institutes.
Copyright © 2026 Mindyard. All Rights Reserved.