A quick link through to my first ever screen case written for a Maths MOOC that’s hopefully going live soon… this was much more hard work than I gave it credit for when I agreed to write it.

The slides are available from below as a slideshare link.

I was recently approached to see if I could tinker about and create a short video associated with the Fibonacci series and more specifically the golden ratio for a maths MOOC that’s about to launch. As per usual my inability to say no came into play and then I suddenly realised that I’ve never created a teaching video before and really what do I know about the Fibonacci series apart from fluffing about with a few Mathematica notebooks, and so blind panic set in… and with blind panic comes a quick trip to XKCD to check out the latest strips for a bit of inspiration…

Now the golden ratio (φ) doesn’t sound like the sort of everyday mathematics that you would use will pushing a trolley around TESCO’s but the key thing you have to appreciate is that it’s a very sneaky number. Things are that are proportioned using the golden ratio are naturally and inexplicably appealing to the eye, we find the ratio a thing of beauty even though most people don’t even know what it is. It turns out that it’s used in everything from composing pleasing photographs (using the rule of thirds as an approximation) through to designing the Parthenon in Greece which is proportioned using this ratio. It’s cool stuff, and to be frank if Mother Nature sees fit to use the principle to establish geometries in plants and other animals… who am I to argue?!

One of the things I like about XKCD are the graphs that they create, they have a certain charm about them and I love the style… and as sketchy as it looks, I’ve always struggled to replicate these diagrams using Visio or Omnigraffle.

One of my other digital haunts is the Stack Exchange forum, which as a (very) amateur coder I constantly find myself sitting reading through in a sense of amazement at some of the nifty tricks that people pull to make some quite elegant and funky code. One of the sub-forums I like there is the Mathematica one, which recently asked the question if it was possible to create XKCD graphs using Mathematica, a copy of the thread is here. I’ve replicated the code below, as much to save it for myself should the thread ever get closed.

The author of this code has created some sample images using this code and I think they’re brilliant.

But coming back to the reason I needed to create some diagrams, the fibonacci sequence and the golden ratio… starting with the golden ratio this is defined by the equation below.

\[\varphi = \frac{{1 + \sqrt 5 }}{2}\]

\[\varphi = 1.61803…\]

The reason that this number is expressed as a fraction is that it is an irrational number, which means it’s similar to π and the decimal places keep on repeating forever with no repetition and so it can’t accurately be approximated a decimal. So how would you approximate this number? Well to start with you need to understand the Fibonacci sequence, which sounds quite grand and complex, but is simple once you understand the trick to determine the sequence… essentially you add together the previous two numbers in the sequence and this gives you the next number. So to start with 1+0=1; 1+1=2; 2+1=3; 3+2=5; etc etc.

But how does this get you to the golden ratio? Well, if you divide one number, by the number before it you get a series of numbers that after a few iterations start to get close to the golden ratio (φ).

Which shows that the number starts to approximate towards the golden ratio with a reasonable level of accuracy after about the fifth iteration or so (well reasonable to a simple engineering brain anyway).. but let’s not be blinded by numbers, let’s draw an XKCD style graph using our new mathematica code…

The last ImageSize term is important to get a reasonable resolution on the image when you export it from Mathematica for embedding into other documents, but the code above gives the graph below… which I think is quite a good attempt at a XKCD style diagram.

Now that we can determine the Fibonacci sequence and the golden mean easily in Mathematica, we could start to see how these relate to the large sunflower seed heads that mother nature creates time after time…

Just a single line of code will help us generate some nice pretty Golden Ratio inspired spirals in Mathematica which look strangely familiar.

1

2

3

Graphics[Point[

Table[Sqrt[n]{Cos[2PinGoldenRatio],

Sin[2PinGoldenRatio]},{n,1000}]]]

So it turns out that I did know enough about the Fibonacci sequence and the Golden Ratio to be almost dangerous… the trick’s going to be can I record a short YouTube video for a maths MOOC as I promised to a half decent standard? We’ll have to wait and see… but now I know I can muck about with formatting diagrams and the code that goes along with the Golden Ratio in Mathematica I can start to mess around with tessalating spheres to create geodesic domes…

And here’s a Mathematica graphic after following the procedure set out in this blog post.

But I don’t want to go off another tangent just yet with Bucky Fuller… but he was inspired by nature and the cleanness of the geometry that the golden ratio presented.

One of the challenges when researching in an engineering field is to determine what patterns your data may present you with. This can be an unfamiliar skill for those of us that have come from industry as we’re used to dealing with certainty when designing buildings, not uncertainty. One of things I’ve been messing about with lately is patterns and series of numbers as I’ve been learning Mathematica, using Roozbeh Hazrat’s book to help.

This has let me calculate the palindromic prime numbers less than 10,000 and other long winded sums in a single line of code. It has had me thinking about other series of numbers such as the Fibonacci series which is present in nature and Pascal’s triangle… (below) I’ve been seeking these types of patterns and puzzles out to try and sharpen my powers of observation and help with rebuilding my maths skills which have atrophied over the years.

Pascal’s triangle is quite a simple pattern to determine, you simply work through the line above and it helps you create the next line below in the series. Take the first number, it’s always 1, then add the first two numbers together on the line above to get your next number, rinse repeat to see what you get…

In the example above when you add together the two numbers on the second row, you get the number 2…. I’ve highlighted this with a bracket on the example above to illustrate how you get the number 2 on the third line… try working through this process to see if you can get the pattern above to repeat and see if you can follow the logic.

Now this is all fine and well, but Pascal’s triangle is well known and it isn’t going to win you a bet down the pub… the Aha! moment that goes with puzzles is the key to a successful puzzle (Badger, Sangwin, Ventura-Medina, & Thomas, 2012) the simpler the explanation, the more readily the solution will be accepted (Michalewicz & Michalewicz, 2008).

So following the pattern theme of this post, let’s see what we can make of the following pattern and see if it can help sharpen up the old grey stuff… and if you crack the puzzle, maybe you can try it down your local and see if it earns you a free pint…

What is the next line for this pyramid? If you’re struggling and would like a hint, then try saying the series aloud.

The solution is 3 1 2 2 1 1 because there are THREE ONES, TWO TWOs, and ONE ONE on the line above…

If you’re struggling to solve this puzzle, then you can highlight the text from this line to the line above to reveal the answer.

References:

Badger, M., Sangwin, C. J., Ventura-Medina, E., & Thomas, C. R. (2012). A guide to puzzle-based learning in STEM subjects. Birmingham: University of Birmingham.

Michalewicz, Z., & Michalewicz, M. (2008). Puzzle-based learning: An introduction to critical thinking, mathematics, and problem solving. Melbourne: Hybrid Publishers.