All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · December 2019

Which grammar generates L = {aⁿbⁿ⁻³ | n > 2} over Σ = {a, b}?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. S → aaaA, A → aAb ∣ λ

Explanation

aⁿbⁿ⁻³ = aaa · aᵏbᵏ with k = n − 3 ≥ 0. S → aaaA, A → aAb | λ produces exactly that.

More Theory of Computation and Compilers questions