Open In App

GATE | GATE-CS-2014-(Set-3) | Question 45

Like Article
Like
Save
Share
Report

Which of the following problems is undecidable?
(A) Deciding if a given context-free grammar is ambiguous.
(B) Deciding if a given string is generated by a given context-free grammar.
(C) Deciding if the language generated by a given context-free grammar is empty.
(D) Deciding if the language generated by a given context-free grammar is finite.


Answer: (A)

Explanation: Context free grammar is not closed under ambiguity.A set is closed under an operation means when we operate an element of that set with that operator we get an element from that set.
Here, context free grammar generates a context free language and set of all context free languages is also a set. But, ambiguity is not an operation and hence we can never say that CFG is closed under ambiguity.

Thus, problem mentioned in option (A) is undecidable.

Please comment below if you find anything wrong in the above post.

Quiz of this Question


Last Updated : 11 Oct, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads