You are currently browsing the tag archive for the ‘fractals’ tag.

If you are a teacher then please also visit my new site: intermathematics.com for over 2000+ pdf pages of resources for teaching IB maths!

The Barnsley Fern: Mathematical Art

This pattern of a fern pictured above was generated by a simple iterative program designed by mathematician Michael Barnsely.  I downloaded the Python code from the excellent Tutorialspoint and then modified it slightly to run on repl.it.  What we are seeing is the result of 40,000 individual points – each plotted according to a simple algorithm.  The algorithm is as follows:

Transformation 1: (0.85 probability of occurrence)

xi+1 = 0.85xi +0.04yi

yi+1= -0.04xi+0.85yi+1.6

Transformation 2: (0.07 probability of occurrence)

xi+1 = 0.2xi -0.26yi

yi+1= 0.23xi+0.22yi+1.6

Transformation 3: (0.07 probability of occurrence)

xi+1 = -0.15xi -0.28yi

yi+1= 0.26xi+0.24yi+0.44

Transformation 4: (0.01 probability of occurrence)

xi+1 = 0

yi+1= 0.16yi

So, I start with (0,0) and then use a random number generator to decide which transformation to use.  I can run a generator from 1-100 and assign 1-85 for transformation 1, 86-92 to transformation 2, 93-99 for transformation 3 and 100 for transformation 4.  Say I generate the number 36 – therefore I will apply transformation 1.

xi+1 = 0.85(0)+0.04(0)

yi+1= -0.04(0)+0.85(0)+1.6

and my new coordinate is (0,1.6).  I mark this on my graph.

I then repeat this process – say this time I generate the number 90.  This tells me to do transformation 2.  So:

xi+1 = 0.2(0) -0.26(1.6)

yi+1= 0.23(0)+0.22(1.6)+1.6

and my new coordinate is (-0.416, 1.952).  I mark this on my graph and carry on again.  The graph above was generated with 40,000 iterations – let’s see how it develops over time:

1000 iterations:

10,000 iterations:

100,000 iterations:

500,000 iterations:

If we want to understand what is happening here we can think of each transformation as responsible for a different part of our fern.  Transformation 1 is most likely and therefore this fills in the smaller leaflets. Transformations 2 and 3 fill in the bottom left and right leaflet (respectively) and transformation 4 fills in the stem.

It’s quite amazing to think that a simple computer program can create what looks like art – or indeed that is can replicate what we see in nature so well.  This fern is an example of a self-similar pattern – i.e one which will look the same at different scales.  You could zoom into a detailed picture and see the same patterns repeating.  You might want to explore the idea of fractals in delving into this topic in more detail.

Changing the iterations

We can explore what happens when we change the iterations very slightly.

Christmas tree

Crazy spiral

Modern art

You can modify the code to run this here.  Have a go!

Essential Resources for IB Teachers

1) Intermathematics.com

Screen Shot 2021-08-21 at 1.07.49 PM

If you are a teacher then please also visit my new site.  This has been designed specifically for teachers of mathematics at international schools.  The content now includes over 2000 pages of pdf content for the entire SL and HL Analysis syllabus and also the SL Applications syllabus.  Some of the content includes:

  1. Original pdf worksheets (with full worked solutions) designed to cover all the syllabus topics.  These make great homework sheets or in class worksheets – and are each designed to last between 40 minutes and 1 hour.
  2. Original Paper 3 investigations (with full worked solutions) to develop investigative techniques and support both the exploration and the Paper 3 examination.
  3. Over 150 pages of Coursework Guides to introduce students to the essentials behind getting an excellent mark on their exploration coursework.
  4. A large number of enrichment activities such as treasure hunts, quizzes, investigations, Desmos explorations, Python coding and more – to engage IB learners in the course.

There is also a lot more.  I think this could save teachers 200+ hours of preparation time in delivering an IB maths course – so it should be well worth exploring!

Essential Resources for both IB teachers and IB students

1) Exploration Guides and Paper 3 Resources

Screen Shot 2021-12-01 at 1.19.14 PM

I’ve put together a 168 page Super Exploration Guide to talk students and teachers through all aspects of producing an excellent coursework submission.  Students always make the same mistakes when doing their coursework – get the inside track from an IB moderator!  I have also made Paper 3 packs for HL Analysis and also Applications students to help prepare for their Paper 3 exams.  The Exploration Guides can be downloaded here and the Paper 3 Questions can be downloaded here.

If you are a teacher then please also visit my new site: intermathematics.com for over 2000+ pdf pages of resources for teaching IB maths!

Sierpinski Triangle: A picture of infinity

This pattern of a Sierpinski triangle pictured above was generated by a simple iterative program.  I made it by modifying the code previously used to plot the Barnsley Fern. You can run the code I used on repl.it.  What we are seeing is the result of 30,000 iterations of a simple algorithm.  The algorithm is as follows:

Transformation 1:

xi+1 = 0.5xi

yi+1= 0.5yi

Transformation 2:

xi+1 = 0.5xi + 0.5

yi+1= 0.5yi+0.5

Transformation 3:

xi+1 = 0.5xi +1

yi+1= 0.5yi

So, I start with (0,0) and then use a random number generator to decide which transformation to use.  I can run a generator from 1-3 and assign 1 for transformation 1, 2 for transformation 2, and 3 for transformation 3.   Say I generate the number 2 – therefore I will apply transformation 2.

xi+1 = 0.5(0) + 0.5

yi+1= 0.5(0)+0.5

and my new coordinate is (0.5,0.5).  I mark this on my graph.

I then repeat this process – say this time I generate the number 3.  This tells me to do transformation 3.  So:

xi+1 = 0.5(0.5) +1

yi+1= 0.5(0.5)

and my new coordinate is (1.25, 0.25).  I mark this on my graph and carry on again.  The graph above was generated with 30,000 iterations.

Altering the algorithm

We can alter the algorithm so that we replace all the 0.5 coefficients of x and y with another number, a.

a = 0.3 has disconnected triangles:

When a = 0.7 we still have a triangle:

By a = 0.9 the triangle is starting to degenerate

By a = 0.99 we start to see the emergence of a line “tail”

By a = 0.999 we see the line dominate.

And when a = 1 we then get a straight line:

When a is greater than 1 the coordinates quickly become extremely large and so the scale required to plot points means the disconnected points are not visible.

If I alternatively alter transformations 2 and 3 so that I add b for transformation 2 and 2b for transformation 3 (rather than 0.5 and 1 respectively) then we can see we simply change the scale of the triangle.

When b = 10 we can see the triangle width is now 40 (we changed b from 0.5 to 10 and so made the triangle 20 times bigger in length):

Fractal mathematics

This triangle is an example of a self-similar pattern – i.e one which will look the same at different scales.  You could zoom into a detailed picture and see the same patterns repeating.  Amazingly fractal patterns don’t fit into our usual understanding of 1 dimensional, 2 dimensional, 3 dimensional space.  Fractals can instead be thought of as having fractional dimensions.

The Hausdorff dimension is a measure of the “roughness” or “crinkley-ness” of a fractal.  It’s given by the formula:

D = log(N)/log(S)

For the Sierpinski triangle, doubling the size (i.e S = 2), creates 3 copies of itself (i.e N =3)

This gives:

D = log(3)/log(2)

Which gives a fractal dimension of about 1.59.  This means it has a higher dimension than a line, but a lower dimension than a 2 dimensional shape.

Essential Resources for IB Teachers

1) Intermathematics.com

Screen Shot 2021-08-21 at 1.07.49 PM

If you are a teacher then please also visit my new site.  This has been designed specifically for teachers of mathematics at international schools.  The content now includes over 2000 pages of pdf content for the entire SL and HL Analysis syllabus and also the SL Applications syllabus.  Some of the content includes:

  1. Original pdf worksheets (with full worked solutions) designed to cover all the syllabus topics.  These make great homework sheets or in class worksheets – and are each designed to last between 40 minutes and 1 hour.
  2. Original Paper 3 investigations (with full worked solutions) to develop investigative techniques and support both the exploration and the Paper 3 examination.
  3. Over 150 pages of Coursework Guides to introduce students to the essentials behind getting an excellent mark on their exploration coursework.
  4. A large number of enrichment activities such as treasure hunts, quizzes, investigations, Desmos explorations, Python coding and more – to engage IB learners in the course.

There is also a lot more.  I think this could save teachers 200+ hours of preparation time in delivering an IB maths course – so it should be well worth exploring!

Essential Resources for both IB teachers and IB students

1) Exploration Guides and Paper 3 Resources

Screen Shot 2021-12-01 at 1.19.14 PM

I’ve put together a 168 page Super Exploration Guide to talk students and teachers through all aspects of producing an excellent coursework submission.  Students always make the same mistakes when doing their coursework – get the inside track from an IB moderator!  I have also made Paper 3 packs for HL Analysis and also Applications students to help prepare for their Paper 3 exams.  The Exploration Guides can be downloaded here and the Paper 3 Questions can be downloaded here.

The Coastline Paradox and Fractional Dimensions

The coastline paradox arises from the difficulty of measuring shapes with complicated edges such as those of countries like the Britain.  As we try and be ever more accurate in our measurement of the British coastline, we get an ever larger answer!  We can see this demonstrated below:

fractal2

This first map represents an approximation of the British coastline with each line representing 200km.  With this scale we arrive at an estimation of around 2400km.  Yet if we take each line with length 50km we get the following:

fractal3

This map now has a length of around 3400km.  Indeed by choosing ever smaller measuring lengths we can make it much larger still.  Coastlines have similar attributes to fractals – which are shapes which exhibit self similarity on ever smaller scales.

fractal1

We can attempt to classify the dimension of fractals by using decimals.  Just as 1 dimension represents a straight line and 2 dimensions represents a surface, we can have a pattern with dimension (say) 1.32.  These dimensions make sense in terms of classifying fractal.  A fractal with dimension close to 1 will be close to a straight line, one with a dimension close to 2 will be very “crinkly” indeed.

We can use the graph above, which was used by one of the founding fathers of fractal mathematics – Mandelbrot – to help expand his early ideas on the subject.  The x axis is a log base 10 scale of the length chosen to measure the coastline in.  The y axis is a log base 10 scale of the subsequent coastline length.  So for example if we take our first estimate of the British coastline, i.e measurements of 200km, which achieved an estimate of 2400km – then we would plot the coordinate ( log(200), log(2400) )  For our second estimate this achieves the point (log(50), log(3400) ).

We can see that countries with steeper slopes (i.e those whose coastline greatly increases with ever smaller measuring scales) will have a more jagged coastline and so can be regarded as having a higher dimension.  Mandelbrot assigned the coastline dimension as related to the gradient of the slope.

Finding the gradient of a log-log graph

However to find the gradient of the lines above is slightly complicated by the fact that we have a log-log plot.  There is a formula we should use:

 m = \frac { \mathrm {log} (F_2) - \mathrm {log} (F_1)} { \log(x_2) - \log(x_1) } = \frac {\log (F_2/F_1)}{\log(x_2/x_1)}, \,

In the formula above, m is the gradient and F1 and F2 are the corresponding y values to x1 and x2.  So using our coordinate values ( log(200), log(2400) ) and (log(50), log(3400) ) we would get a slope of:

log(2400/3400)/log(200/50) = -0.251

We then take the absolute value of this and add 1 – which gives a coastline dimension of 1.251 for Britain’s West coast.

We can also read off the approximate values from the graph.  If we take the points (1.5, 3.3) and (2.7, 3) then we have a slope of:

log(3/3.3)/log(2.7/1.5) = -0.162 which gives a coastline dimension of 1.162.

Actually, with a more accurate reading of this scale Mandelbrot arrived at a coastline dimension of 1.25 for Britain – agreeing with our previous working out.

The coastline dimensions of other countries

fractal5

The coastline of the German land frontier was assigned a dimension of 1.15 – i.e it is not as jagged as that of Britain.  Meanwhile below we can see the South African coast:

fractal6

This has a very smooth coastline – and as such the log-log graph looks to have an almost flat gradient.  As such it has a dimension of 1.02.

If you liked this post you might also like:

Mandelbrot and the Koch Snowflake: An exploration of fractal patterns

Julia and Mandelbrot sets: How to use complex numbers to generate pictures of infinity.

fractals - kock snowflake

Fractals aren’t actually on the syllabus – but they do offer quite a good opportunity to look at limits, infinite sequences, complex numbers (eg Julia sets etc), the relationship between maths and art and so on.

This video is a fantastic introduction to fractals – looking at how the Koch snowflake has simultaneously a finite area and an infinite perimeter (interesting to link this to Gabriel’s Horn which has finite volume and infinite surface area – though this is not related to fractals):

Even more amazing, the Koch snowflake has a fractional dimension – more than 1 but less than 2.

PBS Nova have created a really detailed and interesting look at fractals and how they occur in real life:

To introduce students to fractals, you can also use the Sierpinski Triangle – which can be generated quite easily (instructions here)

and while you at it, the video of an ultra-detailed Mandelbrot zoom in is pretty impressive – a form of pictorial infinity:

There’s also the Dragon Curve – which is explained in a Youtube video. This allows students to see the beginnings of a fractal design from simply repeatedly folding a strip of paper.

From this you can start to look at both Julia and Mandelbrot sets. Dan Pearcy has posted a fantastic blogpost on the topic – which explains how the amazing fractal nature of these shapes are generated. There are also some amazing Julia Set generators and Mandelbrot generators on Geogebra.

All of this can lead onto the coastline paradox (or indeed, it might be a good place to start a lesson) – which asks can we ever actually measure the length of a coastline – because the more detail we go into, the longer the perimeter becomes.  A good link to ToK knowledge.

Essential resources for IB students:

1) Exploration Guides and Paper 3 Resources

Screen Shot 2021-05-19 at 6.32.13 PM

I’ve put together four comprehensive pdf guides to help students prepare for their exploration coursework and Paper 3 investigations. The exploration guides talk through the marking criteria, common student mistakes, excellent ideas for explorations, technology advice, modeling methods and a variety of statistical techniques with detailed explanations. I’ve also made 17 full investigation questions which are also excellent starting points for explorations.  The Exploration Guides can be downloaded here and the Paper 3 Questions can be downloaded here.

Website Stats

  • 9,460,825 views

About

All content on this site has been written by Andrew Chambers (MSc. Mathematics, IB Mathematics Examiner).

New website for International teachers

I’ve just launched a brand new maths site for international schools – over 2000 pdf pages of resources to support IB teachers.  If you are an IB teacher this could save you 200+ hours of preparation time.

Explore here!

Free HL Paper 3 Questions

P3 investigation questions and fully typed mark scheme.  Packs for both Applications students and Analysis students.

Available to download here

IB Maths Super Exploration Guide

A Super Exploration Guide with 168 pages of essential advice from a current IB examiner to ensure you get great marks on your coursework.

Available to download here.

Recent Posts

Follow IB Maths Resources from Intermathematics on WordPress.com