I need some help on these problems. I do not know where to begin. The book that I have does not explain much.
Can somebody walk me through on solving these type of problems? I already know the answers to these problems. I just want to know how to solve them using a tree.
Problem 1) A set T of numbers is defined recursively by
- 2 belongs to T.
- If x belongs to T, so does x+3 and 2*x.
Which of the following numbers belong to T? a) 6 b) 7 c) 19 d) 12
Problem 2) A set S of strings of characters is defined recursively by
- a and b belong to S.
- If x belongs to S, so does xb.
Which of the following strings belong to S? a) a b) ab c) aba d) aaab e) bbbbb
Book: Mathematical Structures for Computer Science
EDIT: new problem added.
Now, what about this problem:
Problem 3) A set M of numbers is defined recursively by:
- 2 and 3 belong to M.
- If x and y belong to M, so does x*y.
Do I create 2 separate nodes? One for 2 and one for 3?