- 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