Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Which of the following problems is undecidabl... Start Learning for Free
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.
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Which of the following problems is undecidable?a)Deciding if a given c...
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.
View all questions of this test
Most Upvoted Answer
Which of the following problems is undecidable?a)Deciding if a given c...
A. Deciding if a given context-free grammar is ambiguous

Explanation:
- An undecidable problem is a problem for which there is no algorithm that can always answer "yes" or "no" for every input.
- In the case of a context-free grammar (CFG), an ambiguous grammar is a grammar that can derive more than one parse tree for a given input string.
- The problem of deciding if a given CFG is ambiguous is undecidable, which means there is no algorithm that can determine whether a CFG is ambiguous or not for every possible input.
- This undecidability result was proven by the famous computer scientist Alan Turing in his seminal work on computability theory.
- The key idea behind the proof is to reduce the Halting Problem to the problem of determining ambiguity in CFGs.
- The Halting Problem is known to be undecidable, which means there is no algorithm that can determine whether a given Turing machine will halt or run forever for every possible input.
- By constructing a CFG that simulates the behavior of a Turing machine, Turing showed that if we had an algorithm to decide whether a given CFG is ambiguous, we could use it to solve the Halting Problem, which is a contradiction.
- Therefore, the problem of deciding if a given CFG is ambiguous is undecidable.

In summary:
- The problem of deciding if a given context-free grammar is ambiguous is undecidable.
- This result was proven by Alan Turing and is based on a reduction from the Halting Problem.
- An undecidable problem is a problem for which there is no algorithm that can always answer "yes" or "no" for every input.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

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.Correct answer is option 'A'. Can you explain this answer?
Question Description
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.Correct answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about 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.Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for 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.Correct answer is option 'A'. Can you explain this answer?.
Solutions for 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.Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of 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.Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of 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.Correct answer is option 'A'. Can you explain this answer?, a detailed solution for 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.Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of 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.Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice 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.Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev