- Problem 4.1
- Rowland Prime Sequences (PDF)
- Plotting
- GadFly
- GR
- Python Plots
- PlotlyJS
- Visualisation
- Makie
- Drawing
- Luxor
- Turtles
- Luxor
Working-Explanation Not all fractals are self-similar (3B1B) but many processes that involve repetition lead to self similarity and the emergence of order and fractals.
Fractals model nature in a way that captures roughness, sort of the opposite of calculus in a way, but self-similarity is only a subset of all possible fractals.
The definition of fractals has to do with fractal dimension, there is a way to define dimension so that fractals can be attributed a dimension.
The fractal dimension refers to the rate of change in measure of a shape in response to scaling.
So for example halving:
- a line will reduce the length (i.e. measure) by half
- a square will reduce the area (i.e. measure) by $\frac{1}{22}$
- a cube will reduce the area (i.e. measure) by $\frac{1}{23}$
A natural question might be, how much will the area of any given fractal change? this value will be referred to as the fractal dimension.
When a shape is scaled by some ratio
e.g. in the case of halving a cube the $m=\frac{1}{2}3$
\[ D = logs\left( m \right) \]
So the dimension is non-integer, alghough many fractals can be depicted in 1/2/3 dimensions, the mass is also not quite an analogue because: length = β, area = 0
The dimension is easy to solve in self similar fractals because the measure is always known (e.g. when a sierpinski triangle is halved the the measure is reduced to a third and a Koch snowflake to a fourth)
So if we wanted to deal with non-self similar shapes, this concept of mass or measure, needs to be fleshed out.
For our approach we will generate our fractals on matrices and any non-zero element of the matrix will be considered as one unit of measure.
So by doing a log transform and linear regression we can find the dimension of any fractal shape, so, for example, a coast line.
A fractal is any shape that has a non-integer dimension, which is essentially saying that the shape has complexity at all scales.
In a pure math sense the limit of the
In an applied setting itβs just that the dimension value has to stay constant accross a sufficiently wide range of scaling factors.
for example the dimension of Great Britain remains as about 1.21 through 1000X scale.
Well probably do another country, Aus/NZ umm Greenland maybe?
#------------------------------------------------------------
#--- Dragon -------------------------------------------------
#------------------------------------------------------------
function dragon(π’, order, length)
print(" ") # Don't remove this or code breaks, I don't know why?
Turn(π’, order*45)
dragon_iterate(π’, order, length, 1)
end
function dragon_iterate(π’, order, length, sign)
if order==0
Forward(π’, length)
else
rootHalf = sqrt(0.5)
dragon_iterate(π’, order -1, length*rootHalf, 1)
Turn(π’, sign * -90)
dragon_iterate(π’, order -1, length*rootHalf, -1)
end
end
;mkdir /tmp/dragon
@png begin
π’ = Turtle()
Turn(π’, 180)
Penup(π’)
Forward(π’, 200)
Pendown(π’)
Turn(π’, 180)
dragon(π’, 15, 400)
end 1000 1000
for i in 1:20
name = string("/tmp/dragon/", lpad(i, 5, "0"), ".png")
print(name)
Drawing(600, 600, name)
origin()
background("white")
sethue("black")
###
π’ = Turtle()
Turn(π’, 180)
Penup(π’)
Forward(π’, 200)
Pendown(π’)
Turn(π’, 180)
dragon(π’, i, 400)
###
finish()
end
;montage -geometry 1200x1200 /tmp/dragon/*.png /tmp/dragon/dragon.png
tree ./
./ βββ Problems βΒ Β βββ 00EmailedInitialProblems βΒ Β βΒ Β βββ Matrix-Determinant.ipynb βΒ Β βΒ Β βββ Matrix-Determinant-Numpy.ipynb βΒ Β βΒ Β βββ partA.py βΒ Β βΒ Β βββ Persian-Recursion βΒ Β βΒ Β βΒ Β βββ Persian-Recursion-Example.R βΒ Β βΒ Β βΒ Β βββ Persian-Recursion.ipynb βΒ Β βΒ Β βΒ Β βββ Persian-Recursion.py βΒ Β βΒ Β βΒ Β βββ Persian-Recursion.R βΒ Β βΒ Β βΒ Β βββ test2.py βΒ Β βΒ Β βββ proba2.py βΒ Β βΒ Β βββ ProbA.md βΒ Β βΒ Β βββ ProbA.pdf βΒ Β βββ chapter_03 βΒ Β βΒ Β βββ prob31-recursive-fraction.ipynb βΒ Β βΒ Β βββ Problem 3.2.md βΒ Β βΒ Β βββ Problem 3.6.md βΒ Β βββ chapter_04 βΒ Β βββ Docs βΒ Β βΒ Β βββ Lists βΒ Β βΒ Β βΒ Β βββ Python-Lists.ipynb βΒ Β βΒ Β βββ Variable-Scope-of-Nested-Functions.md βΒ Β βββ Julia βΒ Β βΒ Β βββ PlotlyAttempt.ipynb βΒ Β βΒ Β βββ primes.jl βΒ Β βΒ Β βββ surfaceiplot.png βΒ Β βΒ Β βββ Symata-FoldList.ipynb βΒ Β βββ Learning-Sympy βΒ Β βΒ Β βββ FindPrimes.ipynb βΒ Β βΒ Β βββ _minted-input βΒ Β βΒ Β βββ sympyDocs.py βΒ Β βΒ Β βββ Sympy.ipynb βΒ Β βββ Matrix-Exponentiation βΒ Β βΒ Β βββ Matrix-Exponentiation.ipynb βΒ Β βββ ProjectA βΒ Β βββ A-12(1).py βΒ Β βββ A-12.ipynb βΒ Β βββ A-12.jl βΒ Β βββ A-35.py βΒ Β βββ A-44.ipynb βΒ Β βββ A-44.pdf βΒ Β βββ a44SurdSeries.html βΒ Β βββ a44SurdSeries.pdf βΒ Β βββ Recursion.md βΒ Β βββ Recursion.pdf βββ README.org βββ Report βΒ Β βββ pythonQuant.bbl βΒ Β βββ pythonQuant.org βΒ Β βββ pythonQuant.pdf βΒ Β βββ pythonQuant.synctex.gz βΒ Β βββ pythonQuant.tex βΒ Β βββ references.bib βββ Resources βββ 9780495708247.pdf (1231) βΒ Β βββ 9780495708247.pdf - Differential equations.pdf βΒ Β βββ cover.jpg βΒ Β βββ metadata.opf βββ (Graduate Texts in Mathematics 222) Brian Hall (auth.) - Lie Groups, Lie Algebras, and Representations_ An Elementary Introduction-Springer International Publishing (2015).pdf βββ references.bib βββ style.sty βββ turing.pdf 15 directories, 48 files
So I was going to turn this into a dot graph but I gave up.
But the point was going to be to illustrate that Itβd be nice if we symlinked problems out of Project A into Ch. 3/4/5 etc.
@startuml
digraph finite_state_machine {
rankdir=LR;
size="8,5"
node [shape = doublecircle, label = "Problems" ]; pb;
node [shape = doublecircle, label = "Resources" ]; rs;
node [shape = square, label = "00EmaiiledInitialProblems" ]; eml;
node [shape = square, label = "Docs" ]; d;
node [shape = oval, label = "Ch. 3" ]; c3;
node [shape = oval, label = "Ch. 4" ]; c4;
node [shape = oval, label = "Ch. 5" ]; c5;
node [shape = circle, label = "Julia" ]; jl;
node [shape = circle, label = "Learning-Sympy" ]; sp;
node [shape = circle, label = "ProjectA" ]; pa;
node [shape = circle, label = "README.org" ]; rd;
node [shape = circle, label = "Report" ]; rp;
node [shape = circle];
pb -> eml [];
pb -> c3 [];
pb -> c4 [];
pb -> c5 [];
pb -> d [];
pb -> jl [];
pb -> sp [];
pb -> rp [];
pb -> rd [];
pb -> pa [];
pb -> rs [];
rs -> docs [];
pa -> c3 [];
pa -> c4 [];
c4 -> eml [];
}
@enduml