Let G = (V, T, S, P) be any context-free grammar without any λ-productions or unit productions. Let K be the maximum number of symbols on the right of any production in P. The maximum number of production rules for any equivalent grammar in Chomsky normal form is given by:
(A)
(K – 1) |P| + |T| – 1
(B)
(K – 1) |P| +|T|
(C)
K |P| + |T| – 1
(D)
K |P| + |T|
Answer: (B)
Explanation:
λ productions:The productions of type ‘A -> λ’ are called λ productions ( also called lambda productions and null productions) . These productions can only be removed from those grammars that do not generate λ (an empty string). It is possible for a grammar to contain null productions and yet not produce an empty string.
Unit productions: The productions of type ‘A -> B’ are called unit productions.
For any context-free grammar G = (V,T,P,S) without any λ-productions or unit-productions.
=> The maximum number of production rules are: (k−1)|P|+|T|
=> Where k is the maximum number of the symbol on the right of production P.
Quiz of this Question
Please comment below if you find anything wrong in the above post