All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · December 2022 (Shift 1)

Which of the following is -free grammar?

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

Show answer & explanation

Correct answer: B. Type-1

Explanation

Type-1 rules must satisfy |α| ≤ |β|, so a rule can never shrink a string to ε (apart from the special S → ε case). Type-0, Type-2 and Type-3 grammars all allow ε-productions.

Note on the official key: the official key says option D. Official/PW key is D (Type-3). Regular grammars may contain A → ε; context-sensitive (Type-1) grammars are the non-contracting, ε-free class.

More Theory of Computation and Compilers questions