GATE CS 2026 Set 1 | Question 25
Theory of Computation › Context Free Grammar · MSQ · 1 mark · Answer: A, B, C
- Question 25Theory of Computationmsq1 markConsider the following grammar where is the start symbol, and and are terminal symbols.Which of the following statements is/are true?
- A.The grammar is ambiguous✓
- B.The string has two distinct derivations in this grammar✓
- C.The string has only one rightmost derivation✓
- D.The language generated by the grammar is undecidable
Answer: A, B, C
Solution
Answer: A, B, C "abb" has two parse trees. In , the extra b can come from either or : Two distinct trees make the grammar ambiguous, so (A) and (B) are true. (C) "abab": the first symbol forces , so must give "bab". Either (possible), or (impossible, because every a needs a later matching b). There is only one tree, so only one rightmost derivation. True. (D) False: the language is context-free, and every CFL is decidable.
- A.
More GATE PYQ on Context Free Grammar
All GATE CS Theory of Computation PYQ →Attempt GATE CS 2026 Set 1 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →