← Quiz: Regular Grammars and Finite Automata: all 10 questions
Quiz: Regular Grammars and Finite Automata · Question 8 of 10
The grammar S → aA, A → Sb | ε mixes right-linear and left-linear rules. Which language does it generate?
The grammar S → aA, A → Sb | ε mixes right-linear and left-linear rules. Which language does it generate?
- A.ab
- B.(ab)*
- C.aⁿ⁺¹bⁿ for n ≥ 0
- D.All strings over {a, b}
Answer & explanation
Correct answer: aⁿ⁺¹bⁿ for n ≥ 0
Each round adds an a on the left side of A and a b on its right, so the counts are matched.
Can you get the rest right without peeking?
Take the timed Quiz: Regular Grammars and Finite Automata quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →