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: 1 − I Where denotes the cardinality of the set.
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. (K − 1)|P| + |T|
Explanation
Each production with K symbols on the right splits into at most K − 1 binary rules, and one rule per terminal (A_t → t) is added: (K − 1)|P| + |T|.
More Theory of Computation and Compilers questions
- Consider the following language families : L ≡ The context - free languages 1 L ≡ The context - sensitive languages 2 L 3 ≡ The recursively…
- Consider the following statements : S 1 : These exists no algorithm for deciding if any M M two Turing machines 1 and 2 accept the same lan…
- Let A = {001, 0011, 11, 101} and B = {01, 111, 111, 010}; C = {00, 001, 1000} and D = {0, 11, 011}. Which pairs have a Post correspondence…
- Which data structure is used by the compiler for managing variables and their attributes?
- On translating the expression given below into quadruple representation, how many operations are required? (i*j)+(e+f)*(a*b+c)
- Replacing the expression by 8.56 is known as