a.
1988, as seen by the derivation
S => D D L
=> O D L
=> 1 D L
=> 1 O L
=> 1 9 L
=> 1 9 L
=> 1 9 E F
=> 1 9 F F
=> 1 9 8 F
=> 1 9 8 8
The grammar generates decimal numerals that have at least two digits and
are multiples of 4. To see this, note the following:
- E generates all even digits.
- O generates all odd digits.
- D generates all digits.
- L must always get used.
- S generates an arbitrary sequence of digits, followed by what L generates.
- L generates pairs of digits, ones starting with 0, 2, 4, 6, or 8 and
followed by 0, 4, or 8; and ones starting with 1, 3, 5, 7, 9 and followed
by 2 or 6.
- The pairs of digits for numerals divisible by 4 are 00, 04, 08, 20, 24, 28,
40, 44, 48, 60, 64, 68, 80, 84, 88, together with 12, 16, 32, 36, 52, 56, 72,
76, 92, 96.
- Every decimal numeral divisible by 4 that has at least two digits
consists of some arbtrary multiple of 100, followed two digits in the set
above.
b.
S is the start string.
S -> E b E | O b O | E
E -> empty | a a E
O -> a E