← All topics
Quiz: Simplifying CFGs and CNF: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. In the grammar S → AB | a, A → b, B → BC, C → c, which variable is not generating?
- Q2. Why must non-generating symbols be removed before unreachable ones?
- Q3. In S → ASA | aB, A → B | S, B → b | ε, which variables are nullable?
- Q4. A rule A → XYZ has X and Z nullable. How many non-empty bodies does it give after ε-removal?
- Q5. What does this print? (code)
- Q6. Which of these is a unit production?
- Q7. Why are ε-productions removed before unit productions?
- Q8. Which rule is allowed in Chomsky Normal Form?
- Q9. How many new variables are needed to split A → BCDEF into CNF pairs (no reuse)?
- Q10. What does this print? (code)