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.
- A. I, II and III only
- B. I and IV only
- C. II and III only
- 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
- Rice's theorem cannot be applied directly to which of the following properties of a Turing machine M (although some of them are…
- If a language L and its complement are both recursively enumerable, then L is
- Which of the following classes of languages is closed under complement but NOT under union?
- Consider L = { aⁿbⁿ : n ≥ 0 } ∪ { aⁿb²ⁿ : n ≥ 0 }. Which classification is correct?
- Over the alphabet {a, b, c}, what is the status of the complement of { aⁿbⁿcⁿ : n ≥ 0 }?
- Consider the language L of strings over {a, b} that contain both abab and bb as substrings, have na ≡ 1 (mod 3) and have an even number of…