Questions 7 and 10 from Exercise set 4.4 of the text. Problem 1: Let f: N ---> N be the function defined by / 1, if n = 0 | f(n) = < 2, if n = 1 | \ 4*f(n - 2) + 2^n if n > 1 Prove that for every integer n >= 3, f(n) <= 3*n*2^{n - 2} Solution: Define S(n) to be the predicate "f(n) <= 3*n*2^{n - 2}". We will prove by complete induction that S(n) is true for all n >= 3. Using the definition of f, we can calculate f(2), f(3), and f(4) easily. We need to compute these values in our base case, as they will be needed when doing the induction step. Base: f(2) = 4f(0) + 2^2 = 4*1 + 4 = 8 f(3) = 4f(1) + 2^3 = 4*2 + 8 = 16 <= 3*3*2^1 f(4) = 4f(2) + 2^4 = 4*8 + 16 = 48 <= 3*4*2^2 So S(3) and S(4) are true. Ind. Hyp.: Let i >= 5 be an arbitrary integer. Assume that S(j) is true for all integers 3 <= j < i. That is, assume that for all integers j such that 3 <= j < i, f(j) <= 3*j*2^{j - 2}. Ind. Step: We will prove that S(i) is true. Since i >= 5, therefore, i - 2 >= 3 and so by Ind. Hyp. S(i - 2) is true, that is, f(i - 2) <= 3*(i - 2)*2^{i - 4}. By definition of f we have: f(i) = 4*f(i - 2) + 2^i since i >= 5 and so i >= 2 <= 4*(3*(i - 2)*2^{i - 4}) + 2^i by Ind. Hyp. = 3*i*2^{i - 2} - (3/2)*2^i + 2^i = 3*i*2^{i - 2} - (1/2)*2^i <= 3*i*2^{i - 2} So S(i) is true, as wanted. Note: In the above proof, if we do not consider n = 4 in our base case, then our induction step starts from i = 4. To compute f(4), we need f(2), and if we are going to use Ind. Hyp. to prove S(4) we need to have S(2) which we have not proved it (and in fact it is not true for n = 2). So we have to consider S(4) as a special case in Ind. Step, or move it to the base case (as we did above).