Linear recurrences and Fibonacci numbers.

13
Linear recurrences and Fibonacci numbers

description

A rabbit problem In a rabbit farm, we want to know the number of does (female rabbits) we will have after a certain number of months if A doe take one month to mature A doe gives birth to a doe every month after that. Rabbits never die. In the first month, we have only one newborn doe.

Transcript of Linear recurrences and Fibonacci numbers.

Page 1: Linear recurrences and Fibonacci numbers.

Linear recurrencesand Fibonacci numbers

Page 2: Linear recurrences and Fibonacci numbers.

A rabbit problem

In a rabbit farm, we want to know the number of does (female rabbits) we will have after a certain number of months if

• A doe take one month to mature• A doe gives birth to a doe every month after that.• Rabbits never die.• In the first month, we have only one newborn

doe.

Page 3: Linear recurrences and Fibonacci numbers.

Fn = Fn-1+Bn-1

Bn = Fn-1

Fn = Fn-1+Fn-2

n Fn Bn

1 1 0

2 1 1

3 2 1

4 3 2

5 5 3

6 8 5

Page 4: Linear recurrences and Fibonacci numbers.

Check for F2

Theorem:

nn

nF 251

251

51

Proof:

Solution 1

11

1 251

251

51F

Fn = Fn-1+Fn-2

Replace and check

The theorem is true by induction.

Page 5: Linear recurrences and Fibonacci numbers.

Fn = Fn-1+Bn-1

Bn = Fn-1

1 1

1 0

Fn-1

Bn-1

Fn

Bn

=

1 1

1 0

Fn-2

Bn-2

=1 1

1 0

Fn-2

Bn-2

1 1

1 0=

2

F1

B1

1 1

1 0=

n-1 1

0

1 1

1 0=

n-1

Solution 2

Page 6: Linear recurrences and Fibonacci numbers.

1

0

1 1

1 0=

n-1Fn

Bn

1 1

1 0= VDV-1 1 1

1 0= VDn-1V-1

n-1

Solution 2

r 0

0 s

251,

251 srD=

r s

1 1V=

Page 7: Linear recurrences and Fibonacci numbers.

Solution 2

1

0

1 1

1 0=

n-1Fn

Bn

r 0

0 s

r s

1 1

r s

1 1

-1n-1=

1

0

nnn srF

51

Page 8: Linear recurrences and Fibonacci numbers.

Solution 3Fn = Fn-1+Fn-2

(F1,F2,F3,F4,…)={Fi}=F

3211

...0000

...1000

...0100

...0010

L

Rewrite all equations as a vector equation.

L: The left shift operator

L{Fi}={Fi+1}

Page 9: Linear recurrences and Fibonacci numbers.

Fn+2 = Fn+1+Fn

L2F = LF+F(L2-L-I)F = 0(L-rI)(L-sI)F = 0

Solution 3

(L-sI)(L-rI)F = 0Ax = 0

I{Fi}={Fi}

251,

251 sr

Page 10: Linear recurrences and Fibonacci numbers.

(L-rI)(L-sI)F = 0 (L-sI)(L-rI)F = 0

Everything in the null space of (L-sI) and everything in the null space of (L-rI) is a solution.

(L-sI)a = 0an+1 = san

(L-rI)b = 0bn+1 = rbn

an = sn-1a1 bn = rn-1b1

Fn = csn-1+drn-1

Page 11: Linear recurrences and Fibonacci numbers.

Fn = csn-1+drn-1

F1=1 F2=1

Solve for c and d

nn

nF 251

251

51

Page 12: Linear recurrences and Fibonacci numbers.

Fibonacci numbers in nature

2 petals 3 petals

5 petals 34 petals

Page 13: Linear recurrences and Fibonacci numbers.

Fibonacci numbers in nature