I just did some Grammar Problems that need some checking:

Here's what I've got. I've also included the directions as well.

1. Write a grammar for each of the following languages. (The grammar you write does not have to be right-linear necessarily).

(A) abb

S XY
S ε
X aY
Y bB
B b
Y b

(B) fg (fg) ∗

S fA
A g
A gX
X fA
X ε


(C) (f Ig)(f Ig) ∗

S → ε
S fX
X gY
X ε
Y fX
X g
Y ε



(D) (aa bb∗)Ic

S→ XY
X→ aaB
B→ bbX
Y → c
X → ε
B → ε