7,192 views

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.

edited

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.

option b   membership

option c   emptiness

option d   finiteness

all are decidable  for cfl

(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/

by

@Arjun sir option A is undecidable but option D is saying Is CFG closed under finite(Regular Grammar) is it Decidable, please explaine.
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.
PCP -> post correspondence problem  ??
yes.

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.

A.

CFG is not closed under ambiguity.

where undecidable is given in link can you tell the name of person who write
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."

#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