CSE20 Lecture 12 - 1 CSE 20 Lecture 12 2/25/10 2 3....

Info iconThis preview shows pages 1–8. 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

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight 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: 1 CSE 20 Lecture 12 2/25/10 2 3. Analysis 3.1 Introduction 3.2 Homogeneous Linear Recursion 3.3 Pigeonhole Principle 3.4 Inclusion-Exclusion Principle 3 3.1 Introduction Derive the bound of functions or recursions Estimate CPU time and memory allocation Example on Fibonacci Sequence: We estimate Fn. 0 1 2 3 4 5 6 7 8 9 0 1 1 2 3 4 5 8 13 21 34 Fn = 1/r5(((1+rr5)/2)^n-((1-rr5)/2)^n) F0 = 1/rr5(1-1) = 0 F1 = 1/rr5(((1+rr5)/2)-((1-rr5)/2)) = 1 4 Example: Fibonacci Sequence 0 1 2 3 4 5 6 7 8 9 0 1 1 2 3 5 8 13 21 34 5 3.2 Homogeneous Linear Recursion (1) Arithmetic Recursion a, a+d, a+2d, , a+kd (2) Geometric Recursion A, ar, ar 2 , , ar k (3) Linear Recursion a n = e 1 a n-1 +e 2 a n-2 ++e k a n-k + f(n) 6 Linear Recursion and Homogeneous Linear Recursion Linear Recursion: There are no powers or products of Homogenous Linear Recursion: A linear recursion with f(n)=0. 7 Solving Linear Recursion Input: ,...
View Full Document

Page1 / 13

CSE20 Lecture 12 - 1 CSE 20 Lecture 12 2/25/10 2 3....

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

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