mathematics. Accomplishments u To become a famous mathematician. u He is widely known. u He introduced Arabic numerals to Europe. u He made the **Fibonacci** **sequence**. Bibliography Books: u Fascinating **Fibonacci**. Dale Seymour Publishing; Page 1 u Portraits;Dale Seymour Publishing: **Fibonacci** page CD Rom: u “**Fibonacci**” Encarta. Microsoft 1997. Internet-World Wide Web: u www.encarta.msn.com/index/concise/OVOL39/06D7 6000.asp

will be given an instruction set You will design a datapath to implement the instructions You will design a FSM to implement an instruction **sequence** for the **fibonacci** **sequence** calculation **Fibonacci** **Sequence** **Fibonacci** **sequence** Pseudo code F(1) = 1 F(2) = 1 F(N) = F(N-1) + F(N-2) e/A + 0, carry_in = 1 Decrement can be implemented as A + “1111”, carry_in = 0 zero_flag = 1 if the output of the ALU is “0000” **Fibonacci** **Sequence** **Fibonacci** **sequence** Pseudo code F(1) = 1 F(2) = 1 F(N) = F(N-1) + F(N-2) e.g. 1, 1, 2,3,/

2) x … x 2 x 1 n! = n x (n-1)! Defined recursively: 1if n = 0 n! =n(n-1)!if n > 0 Compute n! in BlueJ… Another Example : **Fibonacci** **Fibonacci** **sequence**: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … After first two, each term is sum of previous two Defined recursively: Let f n be the n th/ term, n = 0, 1, 2… 0if n = 0 f n =1if n = 1 f n-1 + f n-2 if n > 1 Another Example : **Fibonacci** **Fibonacci** **sequence**: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … 0if n = 0 f n =1if n = 1 f n-1 + f n-2 if n > 1 f/

book Liber Abcai asked a question involving the reproduction of a single pair of rabbits which is the basis of the **Fibonacci** **sequence**. It was posed: Suppose a newly born pair of rabbits (a male and female) are put in a /by! As n increases, the ratio of approaches the golden ratio and is expressed as = This is the fundamental property of both the **Fibonacci** **sequence** and the golden ratio. Both of these ratios converge at the same limit and are the positive root of the quadratic equation If the two/

The next example shows how to use the distinct-roots theorem to find an explicit formula for the **Fibonacci** **sequence**. 23 Example 4 – A Formula for the **Fibonacci** **Sequence** The **Fibonacci** **sequence** F 0, F 1, F 2,... satisfies the recurrence relation for all integers k 2 with/for all integers n 0. Remarkably, even though the formula for F n involves all of the values of the **Fibonacci** **sequence** are integers. cont’d 29 The Single-Root Case 30 The Single-Root Case Consider again the recurrence relation where A and/

are 1 and 1, and each remaining number is the sum of the previous two. **Fibonacci** **sequence**: recurrence In mathematical terms, the **sequence** Fn of **Fibonacci** numbers is defined by the recurrence relation with seed values Graph of consecutive values of **Fibonacci** **sequence** Golden mean Ratios of consecutive values of **Fibonacci** **sequence**: F n+1 /F n Tend to a number – it is Golden Mean Ratio of terms/

= f n + f n-1 Let f n+1 be the number of different **sequences** of 1’s and 2’s that sum to n. # of **sequences** beginning with a 2 # of **sequences** beginning with a 1 Leonardo **Fibonacci** In 1202, **Fibonacci** proposed a problem about the growth of rabbit populations. Rules 1.in the first month /(n) = Fib(n-1) + Fib(n-2) n01234567 Fib(n)0112358 1313 **Fibonacci** Numbers Again f n+1 = f n + f n-1 f 1 = 1 f 2 = 1 Let f n+1 be the number of different **sequences** of 1’s and 2’s that sum to n. Visual Representation: Tiling Let f/

(21) If we did then the answer is just fib(22) + fib(21) What happens if we write a function to calculate **Fibonacci** numbers in this way? Calculating the **Fibonacci** **Sequence** Here is a function to return nth number in the **Fibonacci** **sequence** e.g. fib(1) = 1, fib(3) = 2, fib(5) = 5, fib(8) = 21, … public static int fib(int n){ if(n/

the number of petals on a flower, generally you will find that this number is a **Fibonacci** Number, 3, 5, 8, 13, etc. However, this is just the beginning. The **Fibonacci** **Sequence** can also be seen when observing leaves. NATURE If you start at the bottom leaf / come to the next leaf that is in line with the initial starting leaf, generally the number will be in line with the **Fibonacci** **Sequence**. IN CONCLUSION: MATH AND SCIENCE ARE ALL AROUND US!! It’s easy to think (especially when students take classes for Gen Ed/

Techniques 8 Copyright M.R.K. Krishna Rao 2003 Rabbit Reproduction MonthAdult pairsYoungTotal 1011 2011 3112 4123 5235 6358 **Fibonacci** defined a **sequence** when observing the reproduction of rabbits. Starting with one male/female pair of newborn rabbits, he came up with/ pairs of mature rabbits will there be? 6.Advanced Counting Techniques 9 Copyright M.R.K. Krishna Rao 2003 Rabbit Reproduction - **Fibonacci** numbers This **sequence** of numbers {f n } satisfies the recurrence relation f n = f n-1 + f n-2, n 3 /

to the sum of the previous two. Each **Fibonacci** number has its place in the **Fibonacci** **sequence**. The standard mathematical notation to describe a **Fibonacci** number is an F followed by a subscript indicating its place in the **sequence**. For example, F8 stands for the eighth **Fibonacci** number, which is 21 (F8 = 21). **Fibonacci** Numbers **Fibonacci** numbers that come before FN, are FN-1 and FN-2. The/

many different forms such as flower patterns and shells. One of the best representations is in the sunflower. The pattern of seeds within a sunflower follows the **Fibonacci** **sequence**. Another well known representation of the **Fibonacci** **sequence** is found in pinecones. In In the picture, there are 8 spirals bending to the left as they open out indicated in red. Likewise there are 13/

mathematician who lived 800 years ago!!! These numbers are to be found everywhere in nature. Applications of **Fibonacci** series are nearly limitless. Lots of matematicians added a new piece to the Fibonnaci puzzle. **Fibonacci** mathematics is a constantly expanding branch of number theory. 2) **Fibonacci** **Sequence** 1, 1, 2, 3, 5, 8, 13, 21, ………….. The first two numbers in the series are one and/

ends when the value is less than or equal to 1 2002 Prentice Hall. All rights reserved. 49 6.15 Example Using Recursion: The **Fibonacci** **Sequence** **Fibonacci** **Sequence** –F(0) = 0 –F(1) = 1 –F(n) = F(n - 1) + F(n - 2) –Recursion is / reserved. Outline 52 FibonacciTest.cs Program Output 2002 Prentice Hall. All rights reserved. 53 6.15 Example Using Recursion: The **Fibonacci** **Sequence** Fig. 6.17Set of recursive calls to method **Fibonacci** (abbreviated as F ). return 1return 0 F( 1 )F( 0 )return 1 F( 3 ) F( 2 )F(/

, 3, 5, 8, 13, … The current term is found by adding the previous two The **Fibonacci** **Sequence** Originated from a question he had about rabbit population The **Fibonacci** **Sequence** What’s special about it? If we continue the **sequence**… and take the limit of the ratio to infinity… The **Fibonacci** **Sequence** We find a ratio that is approximately 1.61803399 This is known as the GOLDEN Ratio/

decimal number system which replaced the Roman Numeral system. It was this problem that led **Fibonacci** to the introduction of the **Fibonacci** Numbers and the **Fibonacci** **Sequence** which is what he remains famous for today. The **sequence** is 1, 1, 2, 3, 5, 8, 13, 21, 34, 55.. This **sequence** is that each number is the sum of the two proceeding numbers. Home Viruses Elizabeth Blackwell/

(x,y), (x,y-x),… 25 The relationship between FN and GR : In the above diagram, we can see that y/x = x / (y-x)…………..(1) In **Fibonacci** **Sequence** : For large values of n, we have Fn / Fn-1 = Fn-1 / Fn-2 …..(2) 26 But, Fn = Fn-1 + Fn-2 Fn-2/ - Fn-1) If we replace, Fn with y and Fn-1 with x, we have y / x = x / (y – x) which is Golden Ratio. Compute any number in **Fibonacci** **Sequence** : Fn = n / √5 where F0 = 0, F1 = 1, F2 = 1, F3 = 2,….. ***** 27 3. Recurrences & Solutions of Recurrence Equations : 3.1 Divide-/

spirals of the sunflower head pineapple scales Flowers Nautilus Sun Flower Pineapple in the introduction to Europe Conclusion The greatest European mathematician of the middle age, most famous for the **Fibonacci** **sequence**, in which each number is the sum of the previous two and for his role in the introduction to Europe of the modern Arabic decimal system. HAPPY EASTER!!! THE END/

到下圖 DNA Walk (conti.) Fluctuations: Fluctuations: Correlation: Correlation: Random **sequence** and short correlated **sequence**: Random **sequence** and short correlated **sequence**: Long-range correlated **sequence**: Long-range correlated **sequence**: F(N) N 關於一維 Walker 的分析（續） 由 F(N)=N 的行為看來，這三種序列有很大的不 同： 由 F(N)=N 的行為看來，這三種序列有很大的不 同： Random walk: = 0.5 Random walk: = 0.5 Human Ch22: ~ 0.6 Human Ch22: ~ 0.6 **Fibonacci**: << 0.5 **Fibonacci**: << 0.5 Random walk 裡面不含資訊（全是隨機亂數）， 因此 =0.5 表示「資訊量最低」 Random walk/

到下圖 DNA Walk (conti.) Fluctuations: Fluctuations: Correlation: Correlation: Random **sequence** and short correlated **sequence**: Random **sequence** and short correlated **sequence**: Long-range correlated **sequence**: Long-range correlated **sequence**: F(N) N 關於一維 Walker 的分析（續） 由 F(N)=N 的行為看來，這三種序列有很大的不 同： 由 F(N)=N 的行為看來，這三種序列有很大的不 同： Random walk: = 0.5 Random walk: = 0.5 Human Ch22: ~ 0.6 Human Ch22: ~ 0.6 **Fibonacci**: << 0.5 **Fibonacci**: << 0.5 Random walk 裡面不含資訊（全是隨機亂數）， 因此 =0.5 表示「資訊量最低」 Random walk/

到下圖 DNA Walk (conti.) Fluctuations: Fluctuations: Correlation: Correlation: Random **sequence** and short correlated **sequence**: Random **sequence** and short correlated **sequence**: Long-range correlated **sequence**: Long-range correlated **sequence**: F(N) N 關於一維 Walker 的分析（續） 由 F(N)=N 的行為看來，這三種序列有很大的不 同： 由 F(N)=N 的行為看來，這三種序列有很大的不 同： Random walk: = 0.5 Random walk: = 0.5 Human Ch22: ~ 0.6 Human Ch22: ~ 0.6 **Fibonacci**: << 0.5 **Fibonacci**: << 0.5 Random walk 裡面不含資訊（全是隨機亂數）， 因此 =0.5 表示「資訊量最低」 Random walk/

node of size s k, and let y 1,..., y k be children in order that they were linked to x*. Assume k 2 41 **Fibonacci** Facts Definition. The **Fibonacci** **sequence** is: n 1, 2, 3, 5, 8, 13, 21,... Slightly nonstandard definition. Fact F1. F k k, where =/ Fact F2. Consequence. s k F k k. n This implies that size(x) degree(x) for all nodes x. 42 Golden Ratio Definition. The **Fibonacci** **sequence** is: 1, 2, 3, 5, 8, 13, 21,... Definition. The golden ratio = (1 + 5) / 2 = 1.618… n Divide a rectangle into/

the first ‘X’ **Fibonacci** Numbers Really Understand the Problem Start with 0 and 1 (by definition) Start of **sequence** is: 0,1 Add these two together: 1 Expanded **sequence** is:0,1,1 Add last two numbers together –1+1 = 2 Expanded **sequence** is: 0,1/ minutes to draw a black box for this function Function as Black Box Function InputOutput **Fibonacci** as Black Box **Fibonacci** Count **Fibonacci** Numbers Compute the first “count” **fibonacci** numbers Array of Numbers Integer Comment Your Function You have 1 minute to write a brief/

Sum To n f n+1 = f n + f n-1 Let f n+1 be the number of different **sequences** of 1’s and 2’s that sum to n. # of **sequences** beginning with a 2 # of **sequences** beginning with a 1 **Fibonacci** Numbers Again f n+1 = f n + f n-1 f 1 = 1 f 2 = 1 Let f n+/1 be the number of different **sequences** of 1’s and 2’s that sum to n. Visual Representation: Tiling Let f /

they do not have a common constant or ratio These are commonly called **Fibonacci**-type The difficult thing about these is finding an explicit formula Now we will go through deriving an explicit formula for the **Fibonacci** **Sequence** We know the relational formula is A n = A n−1 + /the form A n =Cx n and plug it in to the relational equation and get Cx n = Cx n−1 + Cx n−2 **Fibonacci** **Sequence** Explicit Formula Cx n = Cx n−1 + Cx n−2 this will always simplify to an equation with the same coefficients as the relational /

how many pairs of rabbits will there be at the end of one year? THE **FIBONACCI** **SEQUENCE** Slide 5-5-3 The solution of the problem leads to the **Fibonacci** **sequence**. Here are the first thirteen terms of the **sequence**: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, /is obtained by adding the two previous terms. RECURSIVE FORMULA FOR **FIBONACCI** **SEQUENCE** Slide 5-5-4 If F n represents the **Fibonacci** number in the nth position in the **sequence**, then EXAMPLE: A PATTERN OF THE **FIBONACCI** NUMBERS Slide 5-5-5 Find the sum of the squares of/

to multiply by two. B.) { 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89.. } This is another example, called the **Fibonacci** **sequence**. Each element is the sum of the two before it; 5 = 3+2, 21= 13+8. In this case there are two values that this does not work for/just as many roots as initial values. So it makes sense that we work out the coefficients by using the initial values. Let’s find the coefficients for the **Fibonacci** **sequence**. We already know the roots, so: a n = b 1 [ (1+√5)/2] n + b 2 [(1- √5)/2] n If we plug/

,1,2,3,5,8,..............................., What is the limiting value for the ratio of consecutive terms in the **Fibonacci** **sequence**? To the far right, does this **sequence** behave like a geometric **sequence**? x1 x2 X1.5 For the left end behaviour, the first few numbers, the **Fibonacci** **Sequence** does not appear to be of a geometric type, but perhaps the right end behaviour, the list does/

and facts when he published his findings When we think of **Fibonacci**, we think of his introduction on the Hindu-Arabic numerals (HAN) to the Western world and the famous **Fibonacci** **sequence** MORE ABOUT **FIBONACCI** **Fibonacci** is one of general revelation from God to mankind that gave /.618) didapat dengan membagi angka setelah deret ke 13 dengan angka sebelumnya 233/144 = 1,618 377/233 = 1,618 610/377 = 1,618 **Fibonacci** **Sequence** and Ratio 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584/

over all the operations performed. - Can be used to show that average cost of an operation is small, if you average over a **sequence** of operations, even though a single operation might be expensive **Fibonacci** Heap Operations 1. Make **Fibonacci** Heap -Assign N[H] = 0, min[H] = nil Amortized cost is O(1) 2. Find Min -Access Min[H] in O(1) time/

Basic Practice of Statistics - 3rd Edition Lecture 4 1. **Fibonacci** **Sequence** 2. Golden ratio Chapter 2 Basic Practice of Statistics - 3rd Edition **Fibonacci** **Sequence** Recap: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, … Finding Patterns in Nature that exhibit numbers in the **sequence**: your project. Chapter 2 Basic Practice of Statistics - 3rd Edition Plants White Calla Lily One Petal Euphorbia Two/

1; f[n] = f[n - 1] + f[n - 2], n ≥ 3. At the conclusion of the algorithm, the array f holds the first n **Fibonacci** numbers. Input Parameters: n Output Parameters: None fibonacci1(n) { // f is a local array f[1] = 1 f[2] = 1 for i = 3 /1,j,denom,used) } Algorithm 8.3.1 Optimal Matrix Multiplication This algorithm computes the minimum number of scalar multiplications to multiply a **sequence** of n matrices. The input is the array size that contains the sizes of the matrices to be multiplied. The first matrix is /

and How They Relate to Nature November 30, 2004 Allison Trask Outline History of Leonardo Pisano **Fibonacci** What are the **Fibonacci** numbers? Explaining the **sequence** Recursive Definition Theorems and Properties The Golden Ratio Binet’s Formula **Fibonacci** numbers and Nature Leonardo Pisano **Fibonacci** Born in 1170 in the city-state of Pisa Books: Liber Abaci, Practica Geometriae, Flos, and Liber Quadratorum Frederick II’s challenge/

If the pattern is extended, what are the next two terms? How is this **sequence** different from the famous **Fibonacci** **sequence**? 4, 8, 12, 16, 20, 24,... positive integers terms of **sequence** Aim: Arithmetic **Sequence** Course: Alg. 2 & Trig. Model Problem Write the rule that can be used in forming a **sequence** 1, 4, 9, 16,..., then use the rule to find the next three terms/

The **Fibonacci** **Sequence** Ava Boussy What is the **Fibonacci** **Sequence**? The **fibonacci** **sequence** is a pattern of numbers that uses adding, so once you get it, it’s easy. 1,1,2,3,5,8,13….. Doodle in Math http://www.youtube.com/ guy) Look Familiar? Pascals Triangle Of Course.It was in a different doodling in math class video. Pascal’s Triangle in made of the **Fibonacci** **Sequence**. Do It – Use words to make it Yearn-1 syllable Pine-1 Desire-2 how I feel-3 About the nintendo-5 Sitting in the Gamestop window-8 Homework See /

lived during the 12 th century Spread the use of the hindu- arabic numbers in Europe Used the **Fibonacci** **sequence** in his book Liber Abaci And the **Sequence**? The first two terms of the **sequence** are 1 and 1 Each succeeding term is the sum of the previous two terms, or (for/, 3, 5, 8, 13, 21, 34 Applications Choose any two numbers between 1 and 10. Add these numbers like you would a **Fibonacci** **sequence**. The sum is… The Golden Ratio Suppose a and b are two consecutive terms of the FS. Then the next term would be a+/

rabbits population grows again? How you calculate the growth and decay pattern? Leonardo **Fibonacci** Leonardo **Fibonacci**, a famous mathematician, born in Pisa, Italy around 1170, figured out the rabbit puzzle. **Fibonacci** **sequence**, or Number Add the last two numbers to get the next. 0, 1/ to these patterns? What has this got to do with investment on market? The Golden Ratio Divide any number in the **Fibonacci** **sequence** by the one before it, for example 55/34, or 21/13, and the answer is always close to 1.61803/

and while statements) into a working program The example we use is writing a program to compute and display a **Fibonacci** **sequence** 3 **Fibonacci** **sequences** A **Fibonacci** **sequence** is an infinite list of integers The first two numbers are given Usually (but not necessarily) these are 1 and/ numbers: 1 1 2 3 5 8 13 21 34 55 89 144... Let’s write a program to compute these 4 Starting the **Fibonacci** **sequence** We need to supply the first two integers int first = 1; int second = 1; We need to print these out: System.out/

兔子出生後, 隔一個月才會生產, 且永不死亡 生產 0 1 1 2 3... 總數 1 1 2 3 5 8... http://www.mcs.surrey.ac.uk/Personal/R.Knott/**Fibonacci**/fibnat.html 7 -3 **Fibonacci** **sequence** (2) 0,1,1,2,3,5,8,13,21,34,... 7 -4 **Fibonacci** **sequence** and golden number 0,1,1,2,3,5,8,13,21,34,... f n = 0 if n = 0 f n = 1/ if n = 1 f n = f n-1 + f n-2 if n 2 1 x-1 x 7 -5 Computation of **Fibonacci** **sequence** Solved by a recursive program: Much replicated computation is done. It should be solved by a simple loop. f n = 0 if n = 0 f n = 1 if n =/

huge redundancy we will look at better examples later, but first analyze these simple ones /** * Computes Nth **Fibonacci** number. * @param N **sequence** index * @returns Nth **Fibonacci** number */ public int **fibonacci**(int N) { if (N <= 2) { return 1; } else { return **fibonacci**(N-1) + **fibonacci**(N-2); } /** * Computes Greatest Common Denominator. * @param a a positive integer * @param b positive integer (a >= b) * @returns GCD of a and b/

decimal number system which replaced the Roman Numeral system. It was this problem that led **Fibonacci** to the introduction of the **Fibonacci** Numbers and the **Fibonacci** **Sequence** which is what he remains famous for today. The **sequence** is 1, 1, 2, 3, 5, 8, 13, 21, 34, 55.. This **sequence** is that each number is the sum of the two proceeding numbers. Home Viruses Elizabeth Blackwell/

modular-arithmetic.html mod mods powermod OK to use powermod for Problem 5 on Homework 1 See also www.wolframalpha.comwww.wolframalpha.com 6 **Fibonacci** **Sequence** A man puts a pair of rabbits in a place surrounded on all sides by a wall. How many pairs of rabbits can be/ many digits are in F 1000 and what are the first few digits? More Exercises 7.Investigate the ratio F n+1 /F n of consecutive **Fibonacci** numbers and try to identify the limit. 8.Investigate the sum F 0 + F 1 + … + F n. Find a formula for this /

… Count the number of spirals. Spirals in a pine cone: clockwise and anti-clockwise And more Pascal’s Triangle Finding the n-th term of a **Fibonacci** **Sequence** Summation Formula For the first “n” numbers in the **Fibonacci** **Sequence** **Fibonacci** **Sequence** As the terms increase, the ratio between successive terms approaches 1.618 This is called the “golden ratio” –Ratio of human leg length to arm/

to calculate present value, compound interest, geometric series… – Rabbit problem First western appearance of **Fibonacci** **sequence** Liber Abaci Rabbits! The Golden Ratio The **Fibonacci** **Sequence** Technical Trading Pioneered by Charles Dow A Random Walk Down Wall Street – Burton G. /, 1994. Pictures and Other Sources: http://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/**Fibonacci**.jpg/220px-**Fibonacci**.jpg http://en.wikipedia.org/wiki/File:The_Parthenon_in_Athens.jpg http://www.mathacademy.com/pr/prime/articles/

Parthenon, Athens United Nations Building, New York The **Fibonacci** **Sequence** Leonardo Pisano **Fibonacci** discovered it in about 1202 A.D. He lived from 1170-1250 He first used the **sequence** to calculate the growth of a Rabbit population. The **sequence** is: 0, 1, 1, 2, 3, / is found by adding up the two previous numbers. The **Fibonacci** **sequence** is found in nature and is still used to predict growth patterns. The **sequence** in Nature: Flower Petals 123 5 813 2134 **Fibonacci** in the Real World “A group of rabbits mate at /

#(ones) Amortized(increment) = actual(increment) + Amortized(increment) = 1+ #(1 => 0) + 1 - #(1 => 0) = O(1) ==> **Sequence** of n increments takes O(n) time 15 Binomial heaps - amortized ana. (collection of heaps) = #(trees) Amortized cost of insert O(1) Amortized cost/ cuts) (decrease-key) = O(1) - #(cascading cuts) ==> amortized(decrease-key) = O(1) ! 32 **Fibonacci** heaps (analysis) Cascading cuts and successive linking will pay for themselves. The only question is what is the maximum degree of a/

b) Then Avery wrote t(n) = 6n + 8. Help Collin write a recursive equation. 5-75. The **Fibonacci** **sequence** is a famous **sequence** that appears many times in mathematics. It can describe patterns found in nature, such as the number of petals on / mathematicians in India. The equation that describes the **Fibonacci** **sequence** can be written as: t(1) = 1 t(2) = 1 t(n + 1) = t(n) + t(n – 1) a)Write the first 10 terms of the **Fibonacci** **sequence**. b)Is the **Fibonacci** **sequence** arithmetic, geometric, or neither? c)Describe what/

15, 21, 27, 33... Add 6 to the previous number S n = S n-1 + 6 Examples of **sequences** 1, 3, 9, 27, 81, 243... Multiply the previous number by 3 S n = 3*S n-1 The **Fibonacci** **Sequence** Start with the numbers 1 and 1, and apply the following rule: S n = S n-1 + S /n-2 In other words, the next term is found from adding up the previous 2 numbers The First Few **Fibonacci** Numbers 1, 1, 2, 3, 5, 8, 13/

+11+22+33+55+88+1313+2121+34 © Boardworks Ltd 2005 66 of 68 The n th term of the **Fibonacci** **sequence** The **Fibonacci** **sequence** is an example of a **sequence** for which the general term cannot be written in terms of its position in the **sequence**. To find any given term we have to know the value of the previous two terms. We can write/

00011 00100 00101 10 Amortized analysis (Cont.) On the worst case increment takes O(k). k = #digits What is the complexity of a **sequence** of increments (on the worst case) ? Define a potential of the counter: Amortized(increment) = actual(increment) + (c) =/cascading cuts) (decrease-key) = O(1) - #(cascading cuts) ==> amortized(decrease-key) = O(1) ! 49 **Fibonacci** heaps (analysis) Cascading cuts and successive linking will pay for themselves. The only question is what is the maximum degree of a node/

Ads by Google