# Lecture 30 -- introduction to self-similarity (3 lectures)

(previous, next)

## Fibonacci's rabbits

History

Direct translation version:

How Many Pairs of Rabbits Are Created by One Pair in One Year?

A certain man had one pair of rabbits together in a certain enclosed place, and one wishes to know how many are created from the pair in one year when it is the nature of them in a single month to bear another pair, and in the second month those born to bear also.

Solution:

Because the above written pair in the first month bore, you will double it; there will be two pairs in one month. One of these, namely the first, bears in the second month, and thus there are in the second month 3 pairs; of these in one month two are pregnant, and in the third month 2 pairs of rabbits are born, and thus there are 5 pairs in the month; in this month 3 pairs are pregnant, and in the fourth month there are 8 pairs, of which 5 pairs bear another 5 pairs; these are added to the 8 pairs making 13 pairs in the fifth month; these 5 pairs that are born in this month do not mate in this month, but another 8 pairs are pregnant, and thus there are in the sixth month 21 pairs; [p284] to these are added the 13 pairs that are born in the seventh month; there will be 34 pairs in this month; to this are added the 21 pairs that are born in the eighth month; there will be 55 pairs in this month; to these are added the 34 pairs that are born in the ninth month; there will be 89 pairs in this month; to these are added again the 55 pairs that are born in the tenth month; there will be 144 pairs in this month; to these are added again the 89 pairs that are born in the eleventh month; there will be 233 pairs in this month.

Month State Count
0 j 1
1 a 1
2 aj 2
3 aj a 3
4 aj a aj 5
5 aj a aj aj a 8
6 aj a aj aj a aj a aj 13
7 aj a aj aj a aj a aj aj a aj aj a 21

These are getting very long, so let's introduce a shorter notation using exponents to do the counting.

Polynomial rewrite system

j -> a, a -> aj, n -> n+1

/ y  x    \    x + y  y
G\a  j  + n/ = a      j  + n + 1

x(n+1) = y(n)
y(n+1) = y(n)+x(n)

F(n) = y(n) + x(n)
F(n+1) = F(n) + y(n)
F(n+2) = F(n+1) + y(n+1) = F(n+1) + y(n) + x(n) = F(n+1) + F(n)

+----------------------------+
|    Governing equation      |
+----------------------------+
|                            |
|   F(n+2) = F(n+1) + F(n)   |
|                            |
+----------------------------+

Solution....

Depending on whether F_1 = 1 or F_1 = 2, ...

t                            t
/      ___\  /  ___    \   /    ___    \  /    ___    \
|1   \/ 5 |  |\/ 5    1|   |  \/ 5    1|  |  \/ 5    1|
|- + -----|  |----- + -| + |- ----- + -|  |- ----- + -|
\2     2  /  \  10    2/   \    2     2/  \    10    2/

or
t                t
/        ___\ /      ___\    /    ___    \  /      ___    \
|1   3 \/ 5 | |1   \/ 5 |    |  \/ 5    1|  |  3 \/ 5    1|
|- + -------| |- + -----|  + |- ----- + -|  |- ------- + -|
\2      10  / \2     2  /    \    2     2/  \     10     2/

Note: Our sequence is integers, but the solution involves the $$\sqrt{5}$$!

GOLDEN RATIO: $$\phi:= (1+\sqrt{5})/2 \approx 1.618033$$ $1/\phi = ( \sqrt{5}-1 )/2$ $a \phi^t + b (-\phi)^{-t}$ $F(t+1) / F(t) \rightarrow \phi$

Classic case -- self-similarity of a divided line segment

     1           x
+---------+----------------+   (1/x) = x/(1+x)

Inscribed a Pentagon in the diagonals of a larger pentagon. Construct a rhombus using diagonals. Use to show similar triangles. Let z be the edge of the pentagon, y be the inner pentagon edge $$x/z = y/x$$ (similar triangles) , $$z = x+y$$ (rhombus)

Can be used to calculate $$2 cos(\pi/5) = \phi$$.

Golden Rectangle

1 = a + b, a = b + c,  (1+a)/1 = (b+c)/b
(1+a)*(1-a) = a

a = 1/PHI 

## Difference equations and solution properties

Difference equations can be much more complicated that just these matrix equations. For instance, ...

Mendel's law for 2-allelle diploid inheritance

                        2
⎛       y(t)⎞
x(t + 1) = ⎜x(t) + ────⎟
⎝        2  ⎠
⎛y(t)       ⎞
y(t + 1) = (2⋅x(t) + y(t))⋅⎜──── + z(t)⎟
⎝ 2         ⎠
2
⎛y(t)       ⎞
z(t + 1) = ⎜──── + z(t)⎟
⎝ 2         ⎠ 

Mandelbrot set equation

             2
z(t+1) = z(t)  +  c

One of the useful things we would like to know is what can happen to the solutions as we iterate equations over time...

Linear equation x(t+1) = b x(t) + a

x = a / ( 1 - b )  { Steady-state solution }

x(t+1) = b x(t) + a
x(t) = a/(1-b) + ( x(0) - a/(1-b) ) b**t

Example 1

x(t+1) = 2 + x(t)/2
x(t) = 4 + C 2**-t

Example 2

x(t+1) = 3 + 2 x(t)
x(t) = 3 + C*2**t

Cob-webbing - example 1 converges - example 2 diverges

## Steady, Periodic, and Chaotic dynamics

### Discrete logistic equation

$x(t+1) = r x(t) ( 1 - x(t) )$

Steady-state condition and local stability: $$x \in 0, 1 - 1/r$$ solve the steady-state equation $$x = f(x)$$. In general, a solution of this equation will be locally stable if $$-1 < f'(x) < 1$$.

Basin of atraction and global stability ...

Discuss Smale's horseshoe, as exemplified by cresant dough folding and rolling. Shown iterates of the function to exemplify folding process. Talk about fixed points of period 1, 2, 3, 4 and their local stability from figure.

Also discuss super-tracks and windowing within the bifurcation diagram.

### Linear equations x(t+1) = b x(t) + a

Local Stability: If we perturb things off the equilibrium a little, do we stay there or go back to were we started?

+----------------+------------------------------------------+
|                |                                          |
|  b < -1        |  Oscillatory instability and divergence  |
|                |                                          |
+----------------+------------------------------------------+
|                |                                          |
|  b = -1        |  Oscillatory stability                   |
|                |                                          |
+----------------+------------------------------------------+
|                |                                          |
|  -1 < b < 0    |  Oscillatory convergence                 |
|                |                                          |
+----------------+------------------------------------------+
|                |                                          |
|  b = 0         |  Instant convergence                     |
|                |                                          |
+----------------+------------------------------------------+
|                |                                          |
|  0 < b < 1     |  Monotone convergence                    |
|                |                                          |
+----------------+------------------------------------------+
|                |                                          |
|  1 = b, a < 0  |  No fixed points, incremental decrease   |
|                |                                          |
+----------------+------------------------------------------+
|                |                                          |
|  1 = b, a = 0  |  All points stationary                   |
|                |                                          |
+----------------+------------------------------------------+
|                |                                          |
|  1 = b, a > 0  |  No fixed points, incremental increase   |
|                |                                          |
+----------------+------------------------------------------+
|                |                                          |
|  1 < b         |  Monotone divergence                     |
|                |                                          |
+----------------+------------------------------------------+

### Feigenbaum's constant

x(t+1) = r x(t) ( 1 - x(t) )

x in 0, 1 - 1/r

x(t+1) = f(x_t)

-1 < f'(x) <  1

x = 0 is stable for r < 1

x = 1 - 1/r is stable for 1 < r < 3

r = 3 introduces oscillator instability

implement in python and show numerical experiments

iterated function maps ... period-2 solutions period-3 solutions period-4 solutions

Smale's model of folding dough, and sensitivity to initial conditions while still remaining finite.

Birfurcation diagram

Mandelbrot = $${ c : z(0) = 0, z(t+1) = z(t)^2 + c, |z(\infty)| < \infty }$$

## Building fractal self-similarity

### Compressing series with rewrite rules...

• Cantor's diagonal argument
• Gödel's incompleteness theorem
• Turing's halting problem

The Kolmogorov complexity of a string (or object) in a language is equal to the length of the shortest representation for the object in the language.

Suppose our language represents numbers in terms of decimals.

* one = 1
* half = 1/2 = 0.5
* 1/3 = 0.3333.... 

So if we are confined to decimal representations, 1/3 has infinite complexity! But we can extend the language to identify repeating components... Then 1/3 = 0.3, and again the represention is short and quick.

* sqrt(2) = 1.4142135623730951....

Now, we have infinite, non-repeating decimals ... But suppose we use geometry or algebra?

* sqrt(2) = length of the diagonal of a unit square
* sqrt(2) = x : x**2 - 2 = 0
* sqrt(2) : Iterate  y/2 + 1/y until convergence

Transcendental numbers = not algebraic, no polynomial...

* pi = limit( |{ (x,y) in Z2 : x**2 + y**2 < n**2}|/n**2, n -> oo)

Most objects have complexity similar to their length.

One interpretation: modelling is working to find simple ways to express the important features of complicated things.

Use a rewrite system to efficiently express the Kochy curve

Use a rewrite system to efficiently express the tree
of the previous example

Use a rewrite system to represent a plant's geometry
(Example A from ABOPs)

### A Fibonacci series

|-||-|-||-||-|-||-|-||-||-|-||-||-|-||-|-||-||-|-||-|-|

a ba a ba ba a ba a ba ba a ba ba a ba a ba ba a ba a b

|-||-|-||-||-|-||-|-|

abaababaabaab

|-||-|-|

abaab

|-|

ab

|

(| -> |-, - -> |)**8 @ |

#### A random series, applying the same approach...

||-||-----||--|--||||||-----|||-|-|-|||||---|||-|||-|||

ba ba ----ba -a -bbbbba ----bba a a bbbba --bba bba bbb

#### Another series

 39 |-||-|-||-||-|-||-||-|-||-|-||-|-||-|-|
24 |-||-|-||-|-||-||-||-||-
15 |-||-||-|-|-|-|
9 |-|-||||-
6 ||---|
• Dragon curve

fx @subs (x -> x+yf+, y -> -fx-y)**20

### Encoding - Expressing an object in a string of symbols

(language depends on the machine which will interpret it)
- Does the language need a stack?

Turtle language:
A square

A 5-pointed star

Simple triangle Kochy curve, 2 iterations

Introduce stack notation "[" = push, "]" = pop

A simple tree

\ | /
\ |\|/| /
--\| | |/--
\ | /
\|/
|
| 

One interpretation: modelling is working to find simple ways to express the important features of complicated things.