Answer
a) Constructing a derivation of 0^2 1^4 using the grammar G1
in Example 6(in text book).
b) Constructing a derivation of 0^2 1^4 using the grammar G2
in Example 6(in text book).
Work Step by Step
a)
S ⇒ 0S ⇒ 00S ⇒ 00S1 ⇒ 00S11 ⇒ 00S111⇒00S1111⇒001111
b)
S ⇒0S ⇒00S ⇒ 001A ⇒ 0011A ⇒ 00111A ⇒ 001111 11.
S ⇒ 0SAB ⇒ 00SABAB ⇒ 00ABAB ⇒
00 AABB ⇒ 001ABB ⇒ 0011BB ⇒ 00112B ⇒ 001122