Theory of Computation (3160704) MCQs

MCQs of Context free grammar (CFG)

Showing 21 to 30 out of 36 Questions
21.
Which among the following is the root of the parse tree?
(a) Production P
(b) Nonterminal V
(c) Terminal T
(d) Starting symbol S
Answer:

Option (d)

22.
__________ is the graphical representation of a grammar.
(a) Binary tree
(b) Red black tree
(c) Parse tree
(d) None of the mentioned
Answer:

Option (c)

23.
Which of the following derivations does a top-down parser use while parsing an input string? The input is assumed to be scanned in left to right order
(a) Leftmost derivation
(b) Leftmost derivation traced out in reverse
(c) Rightmost derivation
(d) Rightmost derivation traced out in reverse
Answer:

Option (a)

24.
A context free language is called ambiguous if
(a) It has two or more leftmost derivations for some terminal string
(b) It has two or more leftmost derivations for some terminal string
(c) Both A and B
(d) None of these
Answer:

Option (c)

25.
CFGs are more powerful than
(a) DFA
(b) Mealy Machine
(c) NFA
(d) All of the mentioned
Answer:

Option (d)

26.
Every grammar in Chomsky Normal Form is:
(a) Regular
(b) Context free
(c) Context sensitive
(d) Unrestricted
Answer:

Option (b)

27.
While converting the context free grammar into chomsky normal form, which of the following is necessary
(a) Elimination of null production
(b) Elimination of unit production
(c) Converting given grammar in Chomsky normal form
(d) All of these
Answer:

Option (d)

28.
Which of the following grammars are in Chomsky Normal Form:
(a) SAB|BC|CD A->0 B1 C2 D3
(b) SAB SBCA|0|1|2|3
(c) SABa Aaab BAc
(d) All of the mentioned
Answer:

Option (a)

29.
In conversion from CFG to CNF, the number of nonterminal to be introduced for the terminals are: SABaAaabBAc
(a) 2
(b) 3
(c) 4
(d) 1
Answer:

Option (b)

30.
The variable which produces is called:
(a) Empty variable
(b) Nullable variable
(c) Terminal
(d) All of the mentioned
Answer:

Option (b)

Showing 21 to 30 out of 36 Questions