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

Which of the following CFG(s) is/are in Chomsky Normal Form? (All capital letters are variables & lower case letters are terminals)
A. S → ABC | AB, A → a, B → b, C → d
B. X → RT | TR, T → t, R → XT | r
C. P → qP | sQ, Q → r | s
D. M → MN | MP, N → nm | n, P → p
Choose the correct answer from the options given below:

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

Show answer & explanation

Correct answer: B. B only

Explanation

In CNF every rule is A → BC or A → a. A has S → ABC (three variables). C has P → qP (terminal + variable). D has N → nm (two terminals). Only B satisfies CNF.

More Theory of Computation and Compilers questions