152k views
5 votes
Let V = {S, A, B, a, b} and T = {a, b}. Determine whether G = (V, T, S, P ) is a type 0 grammar but not a type 1 grammar, a type 1 grammar but not a type 2 grammar, or a type 2 grammar but not a type 3 grammar if P, the set of productions, is:_______

a) S → aAB, A → Bb, B → λ.
b) S → aA, A → a, A → b.
c) S → ABa, AB → a.
d) S → ABA, A → aB, B → ab.
e) S → bA, A → B, B → a.
f ) S → aA, aA → B, B → aA, A → b.
g) S → bA, A → b, S → λ.
h) S → AB, B → aAb, aAb → b.
i) S → aA, A → bB, B → b, B → λ.
j) S → A, A → B, B → λ

User StoneHeart
by
5.2k points

1 Answer

1 vote

Answer:

a)Type 2 grammar

b) Type 3 grammar

c) Type 0 grammar

d) Type 2 grammar

e) Type 2 grammar

f) Type 0 grammar

g) Type 3 grammar

h) Type 0 grammar

i) Type 2 grammar

j) Type 2 grammar

Explanation:

See attached image

Let V = {S, A, B, a, b} and T = {a, b}. Determine whether G = (V, T, S, P ) is a type-example-1
User Jagtesh Chadha
by
5.0k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.