GATE Computer ScienceEasyGATE CS (PYQ pattern)
A grammar has productions S → aS | bA | ε; A → aA | b. Which is the most restricted class of the Chomsky hierarchy that the grammar belongs to?
- A. Type 2 but not type 3
- B. Type 1 but not type 2
- C. Type 0 only
- D. Type 3 (right-linear, regular)
Correct answer: D. Type 3 (right-linear, regular)
Every production has the form A → aB, A → a, A → b-type or A → ε: a single terminal followed by at most one variable, so it is right-linear and generates a regular language.
More Theory of Computation questions
- Which of the following statements are correct? I. Every context-free language over a one-letter alphabet is regular. II. { a^(2ⁿ) : n ≥ 0…
- Let A = { ⟨M⟩ : the Turing machine M accepts at most one string }. Which statement is correct?
- Which of the following statements about the Post Correspondence Problem (PCP) are correct? I. PCP restricted to a one-letter alphabet is…
- To prove by the pumping lemma for context-free languages that L = { w w : w ∈ {a, b} } is not context-free, which string (p is the pumping…
- Which of the following statements are correct? I. Every regular language has an unambiguous context-free grammar. II. Every context-free…
- Rice's theorem cannot be applied directly to which of the following properties of a Turing machine M (although some of them are…