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?

  1. A. Type 2 but not type 3
  2. B. Type 1 but not type 2
  3. C. Type 0 only
  4. 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

Exams that ask this topic