Skip to content
GATEiit

GATE CSE 2026 Session 1 Q25: Ambiguity of S → aSbS | bS | ε

Question

Consider the following grammar where SS is the start symbol, and aa and bb are terminal symbols.

S→aSbS∣bS∣ϵS \to aSbS \mid bS \mid \epsilon

Which of the following statements is/are true?

Try it: multiple select: one or more correct options

Select one or more options
Select all correct options. No negative marking, no partial marks.
Show answer and explanation

Answer: A, B, C (official GATE 2026 final answer key)

Concept used: A grammar is ambiguous if some string has two parse trees; membership in a CFL is always decidable.

First step: Parse abbabb from S→aSbSS \to aSbS: the extra bb can come from the first SS (via bSbS) or from the second SS.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2026 Session 1 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key