Open In App

UGC-NET | UGC NET CS 2018 July – II | Question 35

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

(A)



2n – 1

(B)



2n

(C)

n + 1

(D)

n 2


Answer: (A)
Explanation:

To generate a string of in terminals from a Chomsky Normal Form (CNF) grammar:
Each production rule of type 2 (A -> a) directly contributes 1 to the string length.
Each production rule of type 1 (A->BC) consumes 2 non-terminals but doesn’t directly add to the string length.
We need to apply type-2 productions n times to generate n terminals.
Each type-1 production consumes 2 non-terminals but contributes 0 to the string length until it reaches terminal symbols.
We start with 1 non-terminal symbol and end with n terminals.
The total number of steps (type-1 and type-2 productions) is n + (n-1) = 2n – 1.
Hence, to obtain a string of n terminals, we require 2n-1 productions.

Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :