"Fun Maths" with Geek Dad
I am an unashamed geek dad, and despite doing analytics for a living, have a passion for recreational maths which I've tried to pass on to my daughter. About 5 years ago she realised that what I term "fun maths" is actually just extra maths. However, to her credit she still entertains the occasional fun maths session. She's now embarked on her first year of GCSE study and as the sophistication of the topics she studies at school increases, it offers more potential for interesting investigation beyond the core curriculum.
The topic we've been exploring recently is how pi shows up in many places other than circles. This has been an opportunity to talk about simple harmonic motion and infinite series. Thanks to an excellent video on YouTube by the Numberphile channel, the weirdest place pi shows up we've investigated is in the Mandelbrot set.
The Mandelbrot set is the set of complex numbers c for which f(z)=z^2+c does not diverge when iterated from z=0. So, this fun maths session was an excuse to introduce complex numbers and the complex plane. We Googled Python code to create the set which yielded the following familiar picture.
The white areas are those which don't diverge when iterated. "It's easy to see where pi is in there!" you might be thinking, "there are multiple obviously circular lobes". That would be too easy for fun maths. Some of you might be thinking that pi must also show up in the main lobe, which is a cardioid. This shape is obtained by tracing a point on one circle rolling around an equally sized circle. This is also correct, but I did say that where we will find pi is weird, and the cardioid explanation isn't sufficiently weird.
Normal practice when calculating whether a point on the complex plane is in the Mandelbrot set is to set a threshold of 2. Once you iterate above that, you stop and classify the point as being outside the set. Pi can be found in the number of iterations required to go above 2 using some particular points outside the set on the real axis. If you start at the cusp of the main cardioid (the pointy bit of the large heart-shaped section) which is the point on the real axis at 0.25, add an offset of 1 and iterate, pi will appear. Starting with an offset of 1 and iterating, it takes 3 iterations to go above 2 (0 → 1.25 → 2.8125).
Now 3 isn't perhaps the best approximation for pi, so to improve on this, we successively reduce the offset from 0.25 by factors of 100. Iterating from 1.25 by hand is straightforward but iterating from 0.26 (0.25+1/100) would be very laborious. So, for subsequent iterations, the fun maths challenge I set was to code this in Python. Fortunately, my daughter has been voluntarily attending coding classes every Saturday for about 5 years (thank you Spark for Kids). This is something she does far more eagerly than my fun maths sessions! A few lines of Python later and we'd created this table:
The number of iterations to get above 2 for successive 100x smaller deltas from 0.25 yields better and better approximations for pi, with 0.2500000001 giving an approximation which is just 0.0004% short of pi. While it's an enormously inefficient way to approximate pi, it was a great way to introduce some new topics and solve a maths puzzle with an algorithm. Now, as to why pi shows up in this sequence - that's a tougher one to explain and perhaps one for a future post.
Chief Scientist @ Mastery Logistics | Adjunct Professor @ Northwestern | Analytics, Supply Chain Optimization
4 年We have a weekly puzzle shared through Slack among my teammates, and we consolidated into book: https://www.amazon.com/Opex-Analytics-Weekly-Puzzle-Probability/dp/1731343647 Not all strictly math, but fun stuff!
Talent Acquisition Operations Specialist
4 年This is all a bit complex for me.?However, I’m also a geeky dad who enjoys a bit of maths, and for anyone wanting an accessible and genuinely entertaining book on ‘fun maths’ I’d wholeheartedly recommend “Alex’s Adventures in Numberland” by Alex Bellos.?A cracking read.
Senior Solutions Architect at Databricks
4 年Numberphile is an amazing channel ????.. fractals is another thing that I find simply amazing ??
Product, Data & Technology
4 年I was reading a blog post this week in which the author argued you don’t need to be a mathematician to be a data scientist. What do you and your very curious daughter think ?
Viticulturist | Oenologist | Physicist | Retired Accenture MD
4 年Love it. Hope she does A level. You can then look at "e to the power of minus i Pi"... my favourite...