Which of the following statements are true?
I. Every left-recursive grammar can be converted to a right-recursive grammar and vice-versa II. Allproductions can be removed from any context-free grammar by suitable transformations III. The language generated by a context-free grammar all of whose productions are of the form X --> w or X --> wY (where, w is a string of terminals and Y is a non-terminal), is always regular IV. The derivation trees of strings generated by a context-free grammar in Chomsky Normal Form are always binary trees
(A) I, II, III and IV
(B) II, III and IV only
(C) I, III and IV only
(D) I, II and IV only
Answer: (C)
Explanation:
I is true as we can always remove left recursion from any given grammar.
(For better understanding, see this.)
II is false as we can remove all epsilon productions only if grammar doesn’t contain epsilon in the language.
III is true as it is the definition of regular grammar.
(For better understanding, see type-3 languages in this article.)
IV is true because in chomsky normal form, all the productions are of type X -> YZ or X -> t, where X, Y, Z are variables and ‘t’ is terminal string. When we draw the derivation tree for every node there are at most 2 children. That’s why Derivation trees of grammars in chomsky normal form are Binary trees.
(For better understanding, see this.)
Thus, C is the correct choice.
Quiz of this Question
Recommended Posts:
- GATE | GATE CS 2008 | Question 1
- GATE | GATE CS 2008 | Question 2
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 4
- GATE | GATE CS 2008 | Question 5
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 8
- GATE | GATE CS 2008 | Question 9
- GATE | GATE CS 2008 | Question 10
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 12
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 14
- GATE | GATE CS 2008 | Question 15
- GATE | GATE CS 2008 | Question 16
- GATE | GATE CS 2008 | Question 17
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 20

