🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Regular Grammars and Finite Automata: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Which rule is NOT allowed in a right-linear grammar?
  2. Q2. When converting a DFA to a right-linear grammar, what does the arrow P --1-- Q become?
  3. Q3. In the DFA-to-grammar method, which variables get an ε-rule?
  4. Q4. What does this print? (code)
  5. Q5. When converting a right-linear grammar to an NFA, what does the rule A → b become?
  6. Q6. Why can the automaton built from a right-linear grammar be an NFA rather than a DFA?
  7. Q7. How do you handle a left-linear grammar?
  8. Q8. The grammar S → aA, A → Sb | ε mixes right-linear and left-linear rules. Which language does it generate?
  9. Q9. What does this print? (code)
  10. Q10. Which statement is true?