hw5solutions - EE 369 Homework #5 Solutions (Sixth Edition)...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EE 369 Homework #5 Solutions (Sixth Edition) Section 2.4 10) T(1)=1 T(2)=2 T(3)=3 T(n)= T(n-1)+2T(n-2)+3T(n-3) n>3 Solution: 1, 2, 3, 10, 22 12) Prove the property of Fibonacci numbers: F(n)=5F(n-4)+3F(n-5) for n>=6 F(n) = F(n-2) + F(n-1) = F(n-3) + F(n-4) + F(n-2) + F(n-3) = 2F(n-3) + F(n-4) + F(n-2) = 2[F(n-4) + F(n-5)] + F(n-4) + [F(n-3) + F(n-4)] = 5F(n-4)+ 3F(n-5) 17) Prove the property of the Fibonacci numbers for n>=1 F(2)+F(4)+....+F(2n)=F(2n+1)-1 n=1: F(2)=F(3)-1 or 1=2-1 (true) Assume true for n=k: F(2)+ ... F(2k) = F(2k+1)-1 Show true for n=k+1: F(2)+ ... F(2(k+1)) = F(2(K+1)+1) -1 F(2)+....+F(2(k+1)) = F(2)+....F(2k)+F(2(k+1)) = F(2k+1)-1 + F(2(K+1)) inductive hypothesis = F(2k+3) -1 recurrence relation = F(2(K+1)+1)-1 46) Give a recursive definition for the set of all strings of well balanced parenthesis. 1. A string without parenthesis is well balanced. 2. If A and B are strings of well balanced parentheses, so are (A) and AB. Section 2.5 2. Solve the recurrence relation subject to the basis step: F(1)=2 F(n)=2F(n-1) + 2^n for n>=2 The recurrence relation matches Equation(6) with c=2 and g(n) = 2^n. From equation(8) the solution is F(n) = 2^(n-1)(2) + \sum(i=2 to n) 2^(n-i)2^i = 2^n + \sum(i=2 to n) 2^n = n(2^n) 3. T(1)=1 T(n)=2T(n-1) + 1 for n>=2 The recurrence relation matches Equation(6) with c=2 and g(n) = 1. From equation(8) the solution is T(n) = 2^(n-1)(1) + \sum(i=2 to n) 2^(n-i)(1) = 2^(n-1) + ...+2+1 = 2^n - 1 8. Solve the recurrence relation subject to the basis step by using the expand, guess, and verify approach. S(1)=1 S(n)=nS(n-1)+n! S(n)=nS(n-1)+n! =n[(n-1)S(n-2)+(n-1)!]+n!...
View Full Document

This note was uploaded on 09/24/2009 for the course ECE 369 taught by Professor Bagchi during the Spring '08 term at Purdue University.

Page1 / 6

hw5solutions - EE 369 Homework #5 Solutions (Sixth Edition)...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online