GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Which of the following statements are correct? I. Every regular language has an unambiguous context-free grammar. II. Every context-free language has an unambiguous context-free grammar. III. Every deterministic context-free language has an unambiguous context-free grammar. IV. { aⁱbʲcᵏ : i = j or j = k } has an unambiguous context-free grammar.

  1. A. I, II and III only
  2. B. I and IV only
  3. C. II and III only
  4. D. I and III only

Correct answer: D. I and III only

Regular languages and DCFLs always have unambiguous grammars. Some CFLs, such as { aⁱbʲcᵏ : i = j or j = k }, are inherently ambiguous, so II and IV are false.

More Theory of Computation questions

Exams that ask this topic