fibonacci numbers, vector programs and a new kind of science

112
Fibonacci Numbers, Vector Programs and a new kind of science

Upload: clarissa-heath

Post on 13-Dec-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Fibonacci Numbers, Vector Programs and a new kind of science

Fibonacci Numbers, Vector Programs and a new kind of

science

Page 2: Fibonacci Numbers, Vector Programs and a new kind of science

Sequences That Sum To n

Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.

Example: f5 = 5

Page 3: Fibonacci Numbers, Vector Programs and a new kind of science

Sequences That Sum To n

Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.

Example: f5 = 5

4 = 2 + 2

2 + 1 + 11 + 2 + 11 + 1 + 21 + 1 + 1 + 1

Page 4: Fibonacci Numbers, Vector Programs and a new kind of science

Sequences That Sum To n

f1

f2

f3

Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.

Page 5: Fibonacci Numbers, Vector Programs and a new kind of science

Sequences That Sum To n

f1 = 1

0 = the empty sumf2 = 1

1 = 1

f3 = 2

2 = 1 + 1

2

Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.

Page 6: Fibonacci Numbers, Vector Programs and a new kind of science

Sequences That Sum To n

fn+1 = fn + fn-1

Let fn+1 be the number of different sequences of 1’s and 2’s that sum to n.

Page 7: Fibonacci Numbers, Vector Programs and a new kind of science

Sequences That Sum To n

fn+1 = fn + fn-1

Let fn+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

Page 8: Fibonacci Numbers, Vector Programs and a new kind of science

Leonardo Fibonacci

In 1202, Fibonacci proposed a problem about the growth of rabbit populations.

Page 9: Fibonacci Numbers, Vector Programs and a new kind of science

Rules

1. in the first month there is just one pair2. new-born pairs become fertile after

their second month 3. each month every fertile pair begets a

new pair, and 4. the rabbits never die

Page 10: Fibonacci Numbers, Vector Programs and a new kind of science

Inductive Definition or Recurrence Relation for the

Fibonacci Numbers Stage 0, Initial Condition, or Base Case:Fib(0) = 0; Fib (1) = 1

Inductive RuleFor n>1, Fib(n) = Fib(n-1) + Fib(n-2)

n 0 1 2 3 4 5 6 7

Fib(n) 0 1 1 2 3 5 813

Page 11: Fibonacci Numbers, Vector Programs and a new kind of science

Fibonacci Numbers Again

ffn+1n+1 = f = fnn + f + fn-1n-1

ff11 = 1 f = 1 f22 = 1 = 1

Let fn+1 be the number of different sequences of 1’s and 2’s that sum to

n.

Page 12: Fibonacci Numbers, Vector Programs and a new kind of science

Visual Representation: Tiling

Let fn+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.

Page 13: Fibonacci Numbers, Vector Programs and a new kind of science

Visual Representation: Tiling

Let fn+1 be the number of different ways to tile a 1 × n strip with squares and dominoes.

Page 14: Fibonacci Numbers, Vector Programs and a new kind of science

Visual Representation: Tiling

1 way to tile a strip of length 0

1 way to tile a strip of length 1:

2 ways to tile a strip of length 2:

Page 15: Fibonacci Numbers, Vector Programs and a new kind of science

fn+1 = fn + fn-1

fn+1 is number of ways to tile length n.

fn tilings that start with a square.

fn-1 tilings that start with a domino.

Page 16: Fibonacci Numbers, Vector Programs and a new kind of science

Let’s use this visual representation to prove a couple of

Fibonacci identities.

Page 17: Fibonacci Numbers, Vector Programs and a new kind of science

Fibonacci Identities

Some examples:

F2n = F1 + F3 + F5 + … + F2n-1

Fm+n+1 = Fm+1 Fn+1 + Fm Fn

(Fn)2 = Fn-1 Fn+1 + (-1)n

Page 18: Fibonacci Numbers, Vector Programs and a new kind of science

Fm+n+1 = Fm+1 Fn+1 + Fm Fn

mm nn

m-1m-1 n-1n-1

Page 19: Fibonacci Numbers, Vector Programs and a new kind of science

(Fn)2 = Fn-1 Fn+1 + (-1)n

Page 20: Fibonacci Numbers, Vector Programs and a new kind of science

(Fn)2 = Fn-1 Fn+1 + (-1)n

n-1n-1

Fn tilings of a strip of length n-1

Page 21: Fibonacci Numbers, Vector Programs and a new kind of science

(Fn)2 = Fn-1 Fn+1 + (-1)n

n-1n-1

n-1n-1

Page 22: Fibonacci Numbers, Vector Programs and a new kind of science

(Fn)2 = Fn-1 Fn+1 + (-1)n

nn

(Fn)2 tilings of two strips of size n-1

Page 23: Fibonacci Numbers, Vector Programs and a new kind of science

(Fn)2 = Fn-1 Fn+1 + (-1)n

nn

Draw a vertical “fault Draw a vertical “fault line” at the line” at the rightmost rightmost

position position (<n)(<n) possible without possible without

cutting any cutting any dominoes dominoes

Page 24: Fibonacci Numbers, Vector Programs and a new kind of science

(Fn)2 = Fn-1 Fn+1 + (-1)n

nn

Swap the tailsSwap the tails at the at the fault linefault line to map to a to map to a tiling of 2 n-1 ‘s to a tiling of 2 n-1 ‘s to a tiling of an n-2 and an tiling of an n-2 and an n.n.

Page 25: Fibonacci Numbers, Vector Programs and a new kind of science

(Fn)2 = Fn-1 Fn+1 + (-1)n

nn

Swap the tailsSwap the tails at the at the fault linefault line to map to a to map to a tiling of 2 n-1 ‘s to a tiling of 2 n-1 ‘s to a tiling of an n-2 and an tiling of an n-2 and an n.n.

Page 26: Fibonacci Numbers, Vector Programs and a new kind of science

(Fn)2 = Fn-1 Fn+1 + (-1)n-1

n n eveneven

n oddn odd

Page 27: Fibonacci Numbers, Vector Programs and a new kind of science

The Fibonacci Quarterly

Page 28: Fibonacci Numbers, Vector Programs and a new kind of science

Vector Programs

Let’s define a (parallel) programming language called VECTOR that operates on possibly infinite vectors of numbers. Each variable V! can be thought of as:

< * , * , * , * , *, *, . . . . . . . . . >

0 1 2 3 4 5 . . . . . . . . .

Page 29: Fibonacci Numbers, Vector Programs and a new kind of science

Vector Programs

Let k stand for a scalar constant<k> will stand for the vector <k,0,0,0,…>

<0> = <0,0,0,0,….><1> = <1,0,0,0,…>

V! + T! means to add the vectors position-wise.

<4,2,3,…> + <5,1,1,….> = <9,3,4,…>

Page 30: Fibonacci Numbers, Vector Programs and a new kind of science

Vector Programs

RIGHT(V!) means to shift every number in V! one position to the right and to place a 0 in position 0.

RIGHT( <1,2,3, …> ) = <0,1,2,3,. …>

Page 31: Fibonacci Numbers, Vector Programs and a new kind of science

Vector Programs

Example:

V! := <6>;V! := RIGHT(V!) + <42>;V! := RIGHT(V!) + <2>;V! := RIGHT(V!) + <13>;

VV!! = < 13, 2, 42, 6, 0, 0, 0, . . . > = < 13, 2, 42, 6, 0, 0, 0, . . . >

Store

V! = <6,0,0,0,..>V! = <42,6,0,0,..>V! = <2,42,6,0,..> V!

= <13,2,42,6,.>

Page 32: Fibonacci Numbers, Vector Programs and a new kind of science

Vector Programs

Example:

V! := <1>;

Loop n times: V! := V! + RIGHT(V!);

VV!! = n = nthth row of Pascal’s triangle. row of Pascal’s triangle.

Store

V! = <1,0,0,0,..>

V! = <1,1,0,0,..>V! = <1,2,1,0,..> V! = <1,3,3,1,.>

Page 33: Fibonacci Numbers, Vector Programs and a new kind of science

X1 X2 + + X3

Vector programs can be

implemented by polynomials!

Page 34: Fibonacci Numbers, Vector Programs and a new kind of science

Programs -----> Polynomials

The vector V! = < a0, a1, a2, . . . > will be represented by the polynomial:

Page 35: Fibonacci Numbers, Vector Programs and a new kind of science

Formal Power Series

The vector V! = < a0, a1, a2, . . . > will be represented by the formal power series:

Page 36: Fibonacci Numbers, Vector Programs and a new kind of science

V! = < a0, a1, a2, . . . >

<0> is represented by 0<k> is represented by k

RIGHT(V! ) is represented by (PV X)

V! + T! is represented by (PV + PT)

Page 37: Fibonacci Numbers, Vector Programs and a new kind of science

Vector Programs

Example:

V! := <1>;

Loop n times: V! := V! + RIGHT(V!);

VV!! = n = nthth row of Pascal’s triangle. row of Pascal’s triangle.

PV := 1;

PV := PV + PV X;

Page 38: Fibonacci Numbers, Vector Programs and a new kind of science

Vector Programs

Example:

V! := <1>;

Loop n times: V! := V! + RIGHT(V!);

VV!! = n = nthth row of Pascal’s triangle. row of Pascal’s triangle.

PV := 1;

PV := PV (1+ X);

Page 39: Fibonacci Numbers, Vector Programs and a new kind of science

Vector Programs

Example:

V! := <1>;

Loop n times: V! := V! + RIGHT(V!);

VV!! = n = nthth row of Pascal’s triangle. row of Pascal’s triangle.

PV = (1+ X)n

Page 40: Fibonacci Numbers, Vector Programs and a new kind of science

Let’s add an instruction called PREFIXSUM to our

VECTOR language.

W! := PREFIXSUM(V!)

means that the ith position of W contains the sum of all the numbers in V from

positions 0 to i.

Page 41: Fibonacci Numbers, Vector Programs and a new kind of science

What does this program output?

V! := 1! ;Loop k times: V! := PREFIXSUM(V!) ;

k’th Avenue01

23

4

Page 42: Fibonacci Numbers, Vector Programs and a new kind of science

Al Karaji Perfect SquaresAl Karaji Perfect Squares

Zero_Ave := PREFIXSUM(<1>);First_Ave := PREFIXSUM(Zero_Ave);Second_Ave :=PREFIXSUM(First_Ave);

Output:= RIGHT(Second_Ave) + Second_Ave

Second_Ave = <1, 3, 6, 10, 15,. Second_Ave = <1, 3, 6, 10, 15,.

RIGHT(Second_Ave) = <0, 1, 3, 6, 10,.RIGHT(Second_Ave) = <0, 1, 3, 6, 10,.Output = <1, 4, 9, 16, 25

Page 43: Fibonacci Numbers, Vector Programs and a new kind of science

Can you see how PREFIXSUM can be represented by a

familiar polynomial expression?

Page 44: Fibonacci Numbers, Vector Programs and a new kind of science

How to divide polynomials?

1 1

1 – X?

1 – X 1

1

-(1 – X)

X

+ X

-(X – X2)

X2

+ X2

-(X2 – X3)

X3

=1 + X + X2 + X3 + X4 + X5 + X6 + X7 + …

Page 45: Fibonacci Numbers, Vector Programs and a new kind of science

1 + X1 + X11 + X + X22 + X + X33 + … + X + … + Xnn + ….. = + ….. = 11

1 - X1 - X

The Infinite Geometric Series

Page 46: Fibonacci Numbers, Vector Programs and a new kind of science

W! := PREFIXSUM(V!)

is represented by

PW = PV / (1-X)

= PV (1+X+X2+X3+

….. )

Page 47: Fibonacci Numbers, Vector Programs and a new kind of science

Al-Karaji Program

Zero_Ave = 1/(1-X);First_Ave = 1/(1-X)2;Second_Ave = 1/(1-X)3;

Output = 1/(1-X)3 + X/(1-X)3

= (1+X)/(1-X)= (1+X)/(1-X)33

Page 48: Fibonacci Numbers, Vector Programs and a new kind of science

(1+X)/(1-X)(1+X)/(1-X)33

Zero_Ave := PREFIXSUM(<1>);First_Ave := PREFIXSUM(Zero_Ave);Second_Ave :=PREFIXSUM(First_Ave);

Output:= RIGHT(Second_Ave) + Second_Ave

Second_Ave = <1, 3, 6, 10, 15,. Second_Ave = <1, 3, 6, 10, 15,.

RIGHT(Second_Ave) = <0, 1, 3, 6, 10,.RIGHT(Second_Ave) = <0, 1, 3, 6, 10,.Output = <1, 4, 9, 16, 25

Page 49: Fibonacci Numbers, Vector Programs and a new kind of science

(1+X)/(1-X)(1+X)/(1-X)3 3 outputs <1, 4, 9, ..>outputs <1, 4, 9, ..>

X(1+X)/(1-X)X(1+X)/(1-X)3 3 outputs <0, 1, 4, 9, ..>outputs <0, 1, 4, 9, ..>

The kThe kthth entry is k entry is k22

Page 50: Fibonacci Numbers, Vector Programs and a new kind of science

X(1+X)/(1-X)X(1+X)/(1-X)3 3 = = k k22XXkk

What does X(1+X)/(1-X)What does X(1+X)/(1-X)44 do?do?

Page 51: Fibonacci Numbers, Vector Programs and a new kind of science

X(1+X)/(1-X)X(1+X)/(1-X)44 expands to : expands to :

SSkk X Xkk

where Swhere Skk is the sum of the is the sum of the first k squaresfirst k squares

Page 52: Fibonacci Numbers, Vector Programs and a new kind of science

Aha! Thus, if there is an Aha! Thus, if there is an alternative interpretation of alternative interpretation of

the kthe kthth coefficient of coefficient of X(1+X)/(1-X)X(1+X)/(1-X)44

we would have a new way we would have a new way to get a formula for the sum to get a formula for the sum

of the first k squares.of the first k squares.

Page 53: Fibonacci Numbers, Vector Programs and a new kind of science

What is the coefficient of Xk in the expansion of:

( 1 + X + X2 + X3 + X4

+ . . . . )n ?

Each path in the choice tree for the cross terms has n choices of exponent e1, e2, . . . , en ¸ 0. Each exponent can be any natural number.

Coefficient of Xk is the number of non-negative solutions to:

e1 + e2 + . . . + en = k

Page 54: Fibonacci Numbers, Vector Programs and a new kind of science

What is the coefficient of Xk in the expansion of:

( 1 + X + X2 + X3 + X4

+ . . . . )n ?

n

n -1

1k

Page 55: Fibonacci Numbers, Vector Programs and a new kind of science

( 1 + X + X2 + X3 + X4

+ . . . . )n =

k

k 0

nX

n -1

11

1n

k

X

Page 56: Fibonacci Numbers, Vector Programs and a new kind of science

Using pirates and gold we found that:

k

k 0

nX

n -1

11

1n

k

X

k

k 0

X3

4

31

1

k

X

THUS:

Page 57: Fibonacci Numbers, Vector Programs and a new kind of science

Vector programs -> Polynomials-> Closed form expression

Page 58: Fibonacci Numbers, Vector Programs and a new kind of science

A big jump

Let’s jump into the world of simple programs

Page 59: Fibonacci Numbers, Vector Programs and a new kind of science

Cellular automata

Page 60: Fibonacci Numbers, Vector Programs and a new kind of science
Page 61: Fibonacci Numbers, Vector Programs and a new kind of science

The main discovery

A simple program can create complex output

Page 62: Fibonacci Numbers, Vector Programs and a new kind of science

4 kinds of behavior

Page 63: Fibonacci Numbers, Vector Programs and a new kind of science

Why these discoveries were not made before?

New technologies!

Page 64: Fibonacci Numbers, Vector Programs and a new kind of science

A hypothesis

Cellular automata are an exception!

Page 65: Fibonacci Numbers, Vector Programs and a new kind of science

Other simple programs

Page 66: Fibonacci Numbers, Vector Programs and a new kind of science

3 colors

Page 67: Fibonacci Numbers, Vector Programs and a new kind of science

Being mobile

Not parallel!

Page 68: Fibonacci Numbers, Vector Programs and a new kind of science

Mobile Automata

Page 69: Fibonacci Numbers, Vector Programs and a new kind of science
Page 70: Fibonacci Numbers, Vector Programs and a new kind of science

Turing machines

Page 71: Fibonacci Numbers, Vector Programs and a new kind of science
Page 72: Fibonacci Numbers, Vector Programs and a new kind of science

Other

Page 73: Fibonacci Numbers, Vector Programs and a new kind of science

First conclusions

Phenomena of Complexity can be found in a variety of simple programs!

Page 74: Fibonacci Numbers, Vector Programs and a new kind of science

Systems based on Numbers

Page 75: Fibonacci Numbers, Vector Programs and a new kind of science

But…

Page 76: Fibonacci Numbers, Vector Programs and a new kind of science
Page 77: Fibonacci Numbers, Vector Programs and a new kind of science

A hypothesis

This is all because of the representation in base 2!

Page 78: Fibonacci Numbers, Vector Programs and a new kind of science
Page 79: Fibonacci Numbers, Vector Programs and a new kind of science

Primes

Page 80: Fibonacci Numbers, Vector Programs and a new kind of science

Pi

Page 81: Fibonacci Numbers, Vector Programs and a new kind of science

Functions

Page 82: Fibonacci Numbers, Vector Programs and a new kind of science

Functions

Page 83: Fibonacci Numbers, Vector Programs and a new kind of science

Conclusion

Other systems can exhibit the same behavior as cellular automatas

Page 84: Fibonacci Numbers, Vector Programs and a new kind of science

Chaos phenomena

Page 85: Fibonacci Numbers, Vector Programs and a new kind of science

Start with 1/2

Page 86: Fibonacci Numbers, Vector Programs and a new kind of science

Start with random value

Page 87: Fibonacci Numbers, Vector Programs and a new kind of science

Tiny perturbations of the input

Page 88: Fibonacci Numbers, Vector Programs and a new kind of science

Can (d) create randomness?

No! Random input can lead to random output

But (a) and (b) can!

Page 89: Fibonacci Numbers, Vector Programs and a new kind of science

Continuous

Page 90: Fibonacci Numbers, Vector Programs and a new kind of science

Conclusion

Same results in continuous and discrete

First discovered in discrete because

easier to investigate

Continuous is like average of discrete

Page 91: Fibonacci Numbers, Vector Programs and a new kind of science

Dimensions

Page 92: Fibonacci Numbers, Vector Programs and a new kind of science
Page 93: Fibonacci Numbers, Vector Programs and a new kind of science
Page 94: Fibonacci Numbers, Vector Programs and a new kind of science
Page 95: Fibonacci Numbers, Vector Programs and a new kind of science

Constraints

Every cell must have a black and white neighbor

Page 96: Fibonacci Numbers, Vector Programs and a new kind of science
Page 97: Fibonacci Numbers, Vector Programs and a new kind of science
Page 98: Fibonacci Numbers, Vector Programs and a new kind of science

Constraints

Only complicated constraints yield complicated output! Constraint=Equatio

n

Traditional science concentrates on

equations!

Page 99: Fibonacci Numbers, Vector Programs and a new kind of science

A hypothesis

Starting from randomness no order can emerge

Page 100: Fibonacci Numbers, Vector Programs and a new kind of science
Page 101: Fibonacci Numbers, Vector Programs and a new kind of science

Conclusion

Order can emerge from randomness

Page 102: Fibonacci Numbers, Vector Programs and a new kind of science

Four classes of behavior

Page 103: Fibonacci Numbers, Vector Programs and a new kind of science

Sources of randomness

New!

Page 104: Fibonacci Numbers, Vector Programs and a new kind of science

Is this useful?

Page 105: Fibonacci Numbers, Vector Programs and a new kind of science

Snow flakes

Page 106: Fibonacci Numbers, Vector Programs and a new kind of science

Growth of plants

Page 107: Fibonacci Numbers, Vector Programs and a new kind of science

Computation

Page 108: Fibonacci Numbers, Vector Programs and a new kind of science

Is there a universal cellular automata?

Yes!

Page 109: Fibonacci Numbers, Vector Programs and a new kind of science
Page 110: Fibonacci Numbers, Vector Programs and a new kind of science

Take home message

Thinking in terms of programs instead of equations can lead to new insights

A simple program could produce all the complexity we see.

Page 111: Fibonacci Numbers, Vector Programs and a new kind of science

…Go and find it!

Page 112: Fibonacci Numbers, Vector Programs and a new kind of science

REFERENCES

Coxeter, H. S. M. ``The Golden Section, Phyllotaxis, and Wythoff's Game.'' Scripta Mathematica 19, 135-143, 1953.

"Recounting Fibonacci and Lucas Identities" by Arthur T. Benjamin and Jennifer J. Quinn, College Mathematics Journal, Vol. 30(5): 359--366, 1999.

Stephen Wolfram, “A New Kind of Science”, 2002