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?

  1. A.

    The language generated by G is (a + b)∗

  2. B.

    The language generated by G is a∗(a + b)b∗

  3. C.

    The language generated by G is a∗b∗(a + b)

  4. D.

    The language generated by G is not a regular language

Attempted by 118 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…