Consider the context-free grammar G below S → aSb | X X → aX | Xb | a | b ,…
GATE · 2023 · CS · Computer Science & IT
Consider the context-free grammar G below
S → aSb | X
X → aX | Xb | a | b ,
where S and X are non-terminals, and a and b are terminal symbols. The starting non-terminal is S.
Which one of the following statements is CORRECT?
- A.
The language generated by G is (a + b)∗
- B.
The language generated by G is a∗(a + b)b∗
- C.
The language generated by G is a∗b∗(a + b)
- D.
The language generated by G is not a regular language
Attempted by 116 students.
Show answer
Correct answer: B
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…