Undecidability
Question 1 |
Which one of the following problems is undecidable?
Deciding if a given context-free grammar is ambiguous. | |
Deciding if a given string is generated by a given context-free grammar. | |
Deciding if the language generated by a given context-free grammar is empty. | |
Deciding if the language generated by a given context-free grammar is finite. |
Question 1 Explanation:
The problem, whether a given CFG is ambiguous is undecidable, as we don’t have any algorithm which decides it.
We have a membership algorithm which decides that whether a given string is generated by a given context-free grammar. Similarly, the problems, whether the language generated by a given context-free grammar is empty and the language generated by a given context-free grammar is finite are decidable.
We have a membership algorithm which decides that whether a given string is generated by a given context-free grammar. Similarly, the problems, whether the language generated by a given context-free grammar is empty and the language generated by a given context-free grammar is finite are decidable.