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

Consider the following grammar :

S → 0A ∣ 0BB

A → 00A ∣ λ

B → 1B ∣ 11C

C → B Which language does this grammar generate?

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

Show answer & explanation

Correct answer: C. L((00)*0)

Explanation

B → 1B | 11C and C → B never produce a terminal-only string, so B is useless and S → 0BB is dead. What remains is S → 0A with A → 00A | λ: (00)*0.

More Theory of Computation and Compilers questions