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)

x_{i+1} = 0.85x_{i} +0.04y_{i}

y_{i+1}= -0.04x_{i}+0.85y_{i}+1.6

**Transformation 2:** (0.07 probability of occurrence)

x_{i+1} = 0.2x_{i} -0.26y_{i}

y_{i+1}= 0.23x_{i}+0.22y_{i}+1.6

**Transformation 3:** (0.07 probability of occurrence)

x_{i+1} = -0.15x_{i} -0.28y_{i}

y_{i+1}= 0.26x_{i}+0.24y_{i}+0.44

**Transformation 4:** (0.01 probability of occurrence)

x_{i+1} = 0

y_{i+1}= 0.16y_{i}

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.

x_{i+1} = 0.85(0)+0.04(0)

y_{i+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:

x_{i+1} = 0.2(0) -0.26(1.6)

y_{i+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**

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:

**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.**Original Paper 3 investigations**(with full worked solutions) to develop investigative techniques and support both the exploration and the Paper 3 examination.- Over 150 pages of
**Coursework Guides**to introduce students to the essentials behind getting an excellent mark on their exploration coursework. - 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

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.

## 1 comment

Comments feed for this article

June 27, 2021 at 6:40 pm

YogeetaExcellent exploration