🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Simplifying CFGs and CNF: all 10 questions

Quiz: Simplifying CFGs and CNF · Question 3 of 10

In S → ASA | aB, A → B | S, B → b | ε, which variables are nullable?

In S → ASA | aB, A → B | S, B → b | ε, which variables are nullable?

  1. A.Only B
  2. B.A and B
  3. C.S, A and B
  4. D.None
Answer & explanation

Correct answer: A and B

B → ε and A → B. S is not nullable because S → aB contains a terminal and S → ASA needs S itself.

Can you get the rest right without peeking?

Take the timed Quiz: Simplifying CFGs and CNF quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →