Consider a grammar with the following productions
The above grammar is:
Marks were awarded to all candidates for this question. It is not scored as a normal quiz.
View worked solution
Marks to all
To determine the type of the given grammar, we analyze the production rules:
We observe the following:
- The production has a left-hand side () containing more than one symbol. In a Context-Free Grammar (CFG), the left-hand side of every production must be a single non-terminal. Thus, this grammar is not Context-Free.
- Since it is not context-free, it cannot be Regular (Option B) or (Option D), as both are subsets of context-free grammars.
- By elimination, the grammar is classified as Context sensitive (Option C).
Note on formal classification: Strictly speaking, the production is length-decreasing (), which technically makes the grammar unrestricted (Type-0). However, among the given options, Option C is the intended choice.
Free practice · Your answers on this page are not saved.
