Intro:
Fibonacci Numbers I
Daniel Kane
Department of Computer Science and Engineering
University of California, San Diego
Data Structures and Algorithms
Algorithmic Toolbox
Learning Objectives
Understand the definition of the
Fibonacci numbers.
Show that Fibonacci numbers become
very large.
Definition
⎧
⎨0, n = 0,
⎪
⎪
Fn = 1, n = 1,
⎪
⎩Fn−1 + Fn−2, n > 1 .
⎪
Definition
⎧
⎨0, n = 0,
⎪
⎪
Fn = 1, n = 1,
⎪
⎩Fn−1 + Fn−2, n > 1 .
⎪
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, . . .
Developed to Study Rabbit
Populations
Rapid Growth
Lemma
Fn ≥ 2n/2 for n ≥ 6 .
Rapid Growth
Lemma
Fn ≥ 2n/2 for n ≥ 6 .
Proof
By induction
Rapid Growth
Lemma
Fn ≥ 2n/2 for n ≥ 6 .
Proof
By induction
Base case: n = 6, 7 (by direct computation).
Rapid Growth
Lemma
Fn ≥ 2n/2 for n ≥ 6 .
Proof
By induction
Base case: n = 6, 7 (by direct computation).
Inductive step:
Fn = Fn−1 + Fn−2 ≥ 2(n−1)/2 + 2(n−2)/2 ≥
2 · 2(n−2)/2 = 2n/2.
Formula
Theorem
(︃(︃ √ )︃n (︃ √ )︃n )︃
1 1+ 5 1− 5
Fn = √ − .
5 2 2
Example
F20 = 6765
Example
F20 = 6765
F50 = 12586269025
Example
F20 = 6765
F50 = 12586269025
F100 = 354224848179261915075
Example
F20 = 6765
F50 = 12586269025
F100 = 354224848179261915075
F500 = 1394232245616978801397243828
7040728395007025658769730726
4108962948325571622863290691
557658876222521294125
Computing Fibonacci numbers
Compute Fn
Input: An integer n ≥ 0.
Output: Fn .