Answer:
See below
Step-by-step explanation:
a) By the base case, a∈S. By the recursive step, bsb∈S if s∈S. Then, for s=a, bab∈S.
b) By the base case, ∅∈S. By the recursive step, asa∈S if s∈S. Then, for s=∅, a∅a=aa∈S. By the recursive step, bsb∈S if s∈S. Then, for s=aa, baab∈S.
c) Structural induction: We want to prove that s is palindrome for all s∈S.
Inductive basis: If s=a,b or ∅, then s is palindrome because s has either 0 or 1 characters.
Inductive hypothesis: Suppose that r∈S is a palindrome.
Inductive step: We will prove that every element constructed from r using the recursion is also a palindrome. Because of the restriction, all elements of S are constructed in this way, except for the base case. Thus, combining this with the inductive step, we will prove that every element of S is a palindrome.
Let t be an element constructed from r by recursion. Then t=ara or t=brb. If t=ara, then t is a palindrome, because reversing the word (denote the reverse word by capitals) gives T=aRa, with R being the reverse word of r. But r is a palindrome, hence r=R and T=aRa=ara=t. Again, if t=brb, T=bRb=brb=t.
We have completed the inductive step, hence by structural induction, every element of S is palindrome.
d) By recursion and the restiction, the only elements of S of length 3 are aaa,bbb,aba,bab. abb is none of those, hence abb∉S. (note that abb is not a palindrome, so by part c), abb∉S).