Example for the sequence given by the initial

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: e sequence given by the initial condition a0=2 and the recurrence an = an-1 + 3, we get the closed formula an=3n+2. 12 Fibonacci Sequence Recall that the Fibonacci sequence is given by the initial conditions f0=0 and f1=1 and the recurrence relation fn = fn-1+fn-2. A closed formula is given by 1 fn = √ 5 ￿￿ √ ￿n ￿ √ ￿n ￿ 1+ 5 1− 5 − 2 2 13 Remark There are many techniques available to solve recurrence relations. We will study some of them in depth later, including methods that allow us to derive the closed form solution to the Fibonacci sequence. 14 Summations 15 Sums We use the notations n ￿ k=m ak = am + am+1 + · · · + an The letter k is called the index of summation. 16 Example 5 ￿ 2 2 2 3 2 k =1 +2 +3 +4 +5 k=1 = 1 + 4 + 9 + 16 + 25 = 55 17 2 Remark When counting the number of operations in the analysis of an algorithm, we get sums when counting the number of operations within a for loop. The notation becomes particularly useful when counting operations in nested loops...
View Full Document

This note was uploaded on 03/24/2014 for the course CSCE 222 taught by Professor Math during the Fall '11 term at Texas A&M.

Ask a homework question - tutors are online