Decidability here means whether an algorithm exists that always halts with a correct yes/no answer, for every possible context-free grammar given as input. Let's check each problem:
- Deciding if a given context-free grammar is ambiguous: This asks whether some string in the language has two distinct parse trees (or leftmost derivations). No general algorithm can check this for every possible CFG, it has been proven that no such algorithm can exist, making this problem undecidable.
- Deciding if a given string can be generated by a given context-free grammar: This is the membership problem, and it's solved routinely by parsing algorithms such as CYK or Earley's algorithm, which always terminate with a definite yes or no. This is decidable.
- Deciding if the language generated by a given context-free grammar is empty: This can be checked by seeing whether the start symbol can ever derive a string of terminals, a straightforward reachability computation over the grammar's productions that always terminates. This is decidable.
- Deciding if the language generated by a given context-free grammar is finite: This reduces to checking for certain cyclic/self-embedding patterns in the grammar's derivation graph, which can be checked algorithmically and always terminates. This is decidable.
Three of these four questions can be answered algorithmically for any CFG; only the ambiguity question has been proven to have no general algorithm.
Therefore, the correct answer is Deciding if a given context-free grammar is ambiguous.