1 / 4

Recursion and Recurrence Relations

Recursion and Recurrence Relations. An Introduction. Recursion. A technique of defining a function, a set or an algorithm in terms of itself is a “recursion”. For Example: Factorial !n=n X !(n-1), and !0=! 1=1 Fibonacci sequence f 0 =1, f 1 =1 and f k =f k-2 +f k-1 for k≥2 .

phoebe
Download Presentation

Recursion and Recurrence Relations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Recursion and Recurrence Relations An Introduction

  2. Recursion • A technique of defining a function, a set or an algorithm in terms of itself is a “recursion”. • For Example: • Factorial !n=n X !(n-1), and !0=!1=1 • Fibonacci sequence f0 =1, f1 =1 and fk =fk-2 +fk-1 for k≥2

  3. Solution of a problem with recursion and Iteration • Lets solve this problem with to methods • Recursion • Iteration Telescoping form of a polynomial expression Eg. X5 + 3x4 – 15x2 +x -10 Its telescoping form is (((x((x)+3)))x-15)x+1)x-10

  4. Types of Recurrence Relation • Linear Recurrence relation with constant coefficients. c0ar + c1 ar-1 + c2 ar-2 + ……..+ ckar-k =f(r) • Homogeneous recurrence Relation s(k)+c1 s(k-1) +c2 s(k-2)+…….+ cn s(k-n)=f(k) and f(n)=0 • Non-Homogeneous recurrence Relation • s(k)+c1 s(k-1) +c2 s(k-2)+…….+ cn s(k-n)=f(k) and f(n)=non-zero.

More Related