All mock tests are FREE till 31 December — register to save your progress

To obtain a string of n Terminals from a given Chomsky normal form grammar, the number of productions to be used is :

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

Show answer & explanation

Correct answer: A. 2n − 1

Explanation

In CNF, n − 1 productions of the form A → BC create n variables and n productions A → a turn them into terminals: 2n − 1 steps.

More Theory of Computation and Compilers questions