Let be Context Free Grammars (CFGs) and be a regular expression. For a grammar , let denote the language generated by .
Which ONE among the following questions is decidable?
View worked solution
Answer: D
To determine which of the given questions is decidable, we analyze the decidability properties of Context-Free Languages (CFLs) represented by Context-Free Grammars (CFGs):
- Option A: Is ?
The equivalence problem for two CFGs is undecidable. There is no algorithm to determine if two arbitrary CFGs generate the exact same language. - Option B: Is ?
The disjointness problem for two CFGs is undecidable. This can be shown by reduction from the Post Correspondence Problem (PCP). - Option C: Is ?
The problem of checking whether a CFG generates a given regular language is undecidable. In particular, testing if (where is regular) is a well-known undecidable problem. - Option D: Is ?
The emptiness problem for CFGs is decidable. We can determine if a CFG generates any terminal string by identifying "productive" variables (variables that can eventually derive a string of terminals). If the start symbol is productive, then ; otherwise, . This algorithm always terminates in polynomial time.
Therefore, the only decidable question among the choices is D.
Free practice · Your answers on this page are not saved.
