Consider the grammar with productions , ISRO 2017 S → aSb | SS | ϵThis grammar…

2017

Consider the grammar with productions , ISRO 2017

S → aSb | SS | ϵ

This grammar is

  1. A.

    not context-free, not linear

  2. B.

    not context-free, linear

  3. C.

    context-free, not linear

  4. D.

    context free, linear

Attempted by 50 students.

Show answer & explanation

Correct answer: C

The given grammar has productions where the left-hand side is always a single non-terminal (S), which satisfies the definition of a Context-Free Grammar (CFG). However, the production S → SS contains two non-terminals on the right-hand side. A Linear Grammar requires at most one non-terminal per production. Since this condition is violated, the grammar is context-free but not linear.

Explore the full course: Isro