Match List I with List II List I List II Production Rules Grammar A. S → XY X → 0 Y → 1 I. Greibach Normal Form B. S → aS| bSS |c II. Context Sensitive Grammar C. S → AB A → 0A | 1A | 0 B → 0A III. Chomsky Normal Form D. S → aAbc Ab → bA Ac → Bbcc bB → Bb aB → aa | aaA IV. S-Grammar Choose the correct answer from the options given below :
A ‐ III, B ‐ IV, C ‐ I, D ‐ II
This question asks us to match different sets of production rules, which define formal grammars, to specific types of grammars based on the format of their rules. Understanding the characteristics of each grammar type is key to solving this problem.
Let's look at the types of grammars listed in List II:
Let's examine each set of production rules provided in List I:
A. $S \rightarrow XY, X \rightarrow 0, Y \rightarrow 1$
The rules are $S \rightarrow XY$ (form $A \rightarrow BC$), $X \rightarrow 0$ (form $A \rightarrow a$), and $Y \rightarrow 1$ (form $A \rightarrow a$). All rules are either a non-terminal mapping to two non-terminals or a non-terminal mapping to a single terminal. This structure precisely matches the definition of Chomsky Normal Form.
Therefore, Grammar A corresponds to Chomsky Normal Form (III).
B. $S \rightarrow aS | bSS | c$
The rules are $S \rightarrow aS$, $S \rightarrow bSS$, and $S \rightarrow c$. Let's analyze their form:
All rules are of the form $A \rightarrow a\alpha$, fitting the definition of Greibach Normal Form. Furthermore, for the non-terminal $S$, there is only one production starting with 'a', one starting with 'b', and one starting with 'c'. This satisfies the condition for an S-Grammar (where for any non-terminal A and terminal a, there is at most one production $A \rightarrow a\alpha$). Therefore, Grammar B is an S-Grammar.
Therefore, Grammar B corresponds to S-Grammar (IV).
C. $S \rightarrow ABA, A \rightarrow 0A | 1A | 0, B \rightarrow 0A$
Let's look at these rules:
While many rules in Grammar C are in GNF form, the rule $S \rightarrow ABA$ prevents the entire grammar from being strictly in Greibach Normal Form based on the standard definition. However, based on the provided correct answer, this grammar is matched with Greibach Normal Form (I). It's possible the question or the context implies that the grammar is related to or can be converted to GNF, or perhaps a less strict definition is assumed where a significant portion of rules fits the form.
Therefore, according to the provided match, Grammar C corresponds to Greibach Normal Form (I).
D. $S \rightarrow aAbcAb, Ab \rightarrow bAA, Ac \rightarrow Bbcc, cbB \rightarrow Bba, B \rightarrow aa | aaA$
Let's examine some of these rules:
Therefore, Grammar D corresponds to Context Sensitive Grammar (II).
Based on our analysis and the provided correct pairing:
This gives the matching A - III, B - IV, C - I, D - II.
| List I (Grammar) | Matching List II (Grammar Type) | Explanation |
|---|---|---|
| A. $S \rightarrow XY, X \rightarrow 0, Y \rightarrow 1$ | III. Chomsky Normal Form | Rules are of the form $A \rightarrow BC$ or $A \rightarrow a$. |
| B. $S \rightarrow aS| bSS |c$ | IV. S-Grammar | Rules are of the form $A \rightarrow a\alpha$, and for $S$, each terminal (a, b, c) starts only one rule. (Also fits GNF definition). |
| C. $S \rightarrow ABA, A \rightarrow 0A | 1A | 0, B \rightarrow 0A$ | I. Greibach Normal Form | Matched as per the provided solution. Note: $S \rightarrow ABA$ is not strictly in GNF form $A \rightarrow a\alpha$. Other rules fit the GNF form. |
| D. $S \rightarrow aAbcAb, Ab \rightarrow bAA, Ac \rightarrow Bbcc, cbB \rightarrow Bba, B \rightarrow aa | aaA$ | II. Context Sensitive Grammar | Includes rules with multiple symbols on the left-hand side, characteristic of CSG. |
| Grammar Type | Chomsky Type | Rule Format Examples | Key Characteristics |
|---|---|---|---|
| Chomsky Normal Form (CNF) | Type 2 (Context-Free) | $A \rightarrow BC$, $A \rightarrow a$ (and $S \rightarrow \epsilon$ if applicable) | Restricted form of Context-Free Grammars, useful for parsing. |
| Greibach Normal Form (GNF) | Type 2 (Context-Free) | $A \rightarrow a\alpha$ where $\alpha$ is string of non-terminals | Restricted form of Context-Free Grammars, useful for parsing, especially top-down. |
| Context Sensitive Grammar (CSG) | Type 1 | $\alpha A \beta \rightarrow \alpha \gamma \beta$ or $|\delta| \le |\epsilon|$ for $\delta \rightarrow \epsilon$ ($\epsilon$ not empty except for $S \rightarrow \epsilon$) | Rules can have context, length-increasing or preserving. More powerful than CFG. |
| S-Grammar | Type 2 (Context-Free), subset of GNF | $A \rightarrow a\alpha$ and unique production for each (A, a) pair | Deterministic Context-Free Grammar, easy to parse (LL(1)). |
Formal grammars are classified into a hierarchy known as the Chomsky Hierarchy, based on the form of their production rules and the power of the automaton required to recognize the languages they generate:
The hierarchy is nested: Type 3 $\subset$ Type 2 $\subset$ Type 1 $\subset$ Type 0. This means any regular language is also context-free, any context-free language is also context-sensitive, and any context-sensitive language is also recursively enumerable.
The reduced grammar equivalent to the grammar, whose production rules are given below, is
S → AB | CA
B → BC | AB
A → a
C → a B | b
Match List I with List II:
| List I | List II | ||
| (A) | Type 0 | (I) | Finite automata |
| (B) | Type 1 | (II) | Tuning machine |
| (C) | Type 2 | (III) | Linear bound automata |
| (D) | Type 3 | (IV) | Pushdown automata |
Choose the correct answer from the options given below:
Consider the following grammars:
G 1: S → aSb|bSa|aa
G 2: S → aSb|bSa|SS|λ
G 3: S → aSb|bSa|SS|a
G 4: S → aSb|bSa|SS|SSS|λ
Which of the following is correct w.r.t. the above grammars?Consider L = L 1 ∩ L 2
Where L 1 = {0 m1 m20 n1 n |m, n >= 0}
L 2 = {0 m1 n2 k | m, n, k ≥ 0}
Then, the language L is
Consider the language \(L = \left\{ {{a^n}{b^{n - 3}}\ | n > 2} \right\}\) on ∑ = {a, b}. Which one of the following grammars generates the language L?