in Theory of Computation retagged by
6,971 views
31 votes
31 votes

Which one of the following problems is undecidable?

  1. Deciding if a given context-free grammar is ambiguous.
  2. Deciding if a given string is generated by a given context-free grammar.
  3. Deciding if the language generated by a given context-free grammar is empty.
  4. Deciding if the language generated by a given context-free grammar is finite.
in Theory of Computation retagged by
7.0k views

2 Comments

edited by

For option, C

"Note that L(G) != φ if and only if G’s start variable can generate a string in T∗, where T is G’s terminal alphabet. We simply determine this property for each variable A in G : can A generate a string in T∗ ?"

For option, D found this 

Note that L(G) is infinite exactly if there is a path in a derivation tree with a repeated variable. The following algorithm identifies the variables that can be repeated in this way; L(G) is infinite exactly if there is at least one such variable

From- https://cs.nyu.edu/courses/fall09/V22.0453-001/chapter-4.pdf 4.4.3 & 4.4.6 Example.

1
1

option b   membership  

option c   emptiness

option d   finiteness 

all are decidable  for cfl 

0
0

3 Answers

30 votes
30 votes
Best answer

(A) is the answer. Proving (A) is undecidable is not so easy. But we can easily prove the other three options given here are decidable.

https://gatecse.in/grammar-decidable-and-undecidable-problems/

edited by
by

4 Comments

@Arjun sir option A is undecidable but option D is saying Is CFG closed under finite(Regular Grammar) is it Decidable, please explaine.
0
0
If A were decidable, then the PCP problem would have been decidable implying that PCP problem is reducible to finding whether a given context-free grammar is ambiguous. Hence undecidable.
3
3
PCP -> post correspondence problem  ??
0
0
yes.
0
0
3 votes
3 votes

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.

0 votes
0 votes
A.

CFG is not closed under ambiguity.

4 Comments

where undecidable is given in link can you tell the name of person who write
0
0
by "Kai". It's not the best answer but I'm not getting why it's wrong.

"Since the Language is (<G>| G is a CFG and L(G) is empty). We can find one TM which accepts an empty string and one which doesn't. Then by Rice's theorem, this property is non trivial and thus undecidable for Recursively Enumerable languages which involve CFLs."
0
0

#Pcs See it ... Its a trivial property i think ... We jst need to care abt the terminals to  get the result ...

http://www3.cs.stonybrook.edu/~cse350/slides/decide2.pdf

0
0
Answer:

Related questions