Answer
a) Showing that 10101 belongs to the language generated
by G.
b) Showing that 10110 does not belong to the language generated
by G.
c) showing what the language generated by G
Work Step by Step
--Let G = (V, T, S, P) be the phrase-structure grammar with V = {0, 1,A,B, S}, T = {0, 1}, and set of productions P consisting of
S → 0A, S → 1A, A → 0B, B → 1A, B → 1.
a) S ⇒1A⇒10B ⇒101A⇒1010B ⇒10101
b) Because of the productions in this grammar, every 1 must be followed by a 0 unless it occurs at the end of the string.
c) All strings consisting of a 0 or a 1 followed by one or more repetitions of 01