Find the highest type number, specified by following grammar. S → 0SBA | 01A…

2025

Find the highest type number, specified by following grammar.

S → 0SBA | 01A

AB → BA

1B → 11

1A → 10

0A → 00

  1. A.

    Type – 3 (Regular)

  2. B.

    Type – 1 (Context sensitive)

  3. C.

    Type – 2 (Context free)

  4. D.

    None of the above

Attempted by 13 students.

Show answer & explanation

Correct answer: B

The production rule AB → BA contains two non-terminals on the left-hand side. Type 2 and Type 3 grammars require exactly one non-terminal, so this violates those constraints. Therefore, the grammar is classified as Type 1 (Context-sensitive) under the Chomsky hierarchy.

Explore the full course: Mppsc Assistant Professor