Categories
Uncategorized

A Little Bit of Pi

As it is the \( \pi \) day of the century I thought I really should write a short blog post about it. 

Most people know that the first digits of pi are \( \pi = 3.141592653 \), and this year using the american format for representing the date we can get the first 9 decimal places on 3/14/15 at 9:26:53 in the morning. As I will be at #mathsconf2015 then I am going to post this post a bit early, and release it on Thursday, as most schools will celebrate pi day on the Friday before.

Since I was at school I have been pretty interested in the computation of pi, I think that this was sparked by my Year 7 maths teacher giving me a book called “The Joy of Pi” by David Blatner when he left the school. 

In March 2014 David Bailey and Jonathan Borwein (famous amongst pi afficionados) wrote an article for The Mathematical Association of America about Pi Day which is well worth a read and Kate Bush even wrote a song about pi! Admittedly she gets some of the decimal digits that she sings worng….

Calculating Pi

People have been trying to calculate pi for thousands of years, the babylonians used the approximation \( \pi \approx 3.125 \) and there is evidence from the Rhind Papyrus that the Egyptian scribe Ahmes took \( \pi \) to be the ratio 256/81, or approximately 3.16049 – this is less than 1% off the true value. Pi also seems to come up in the design of the Great Pyramid at Giza; the ratio of the length of one side to the height is approximately \( \pi / 2 \). 

The ancient greeks seem to have been the first to try and pin down a value of pi by a systematic means. Antiphon and Bryson of Heraclea (around 469-399 BC) used the method of exhaustion to approximate pi. They deduced that if you take a regular polygon, such as a hexagon, and keep doubling the number of sides then the limiting shape is a circle. Antiphon inscribed successive polygons inside a circle and calculated their areas, Bryson then circumscribed polygons around the cicle and compared the areas of the inscribed and circumscribed polygons. This gave an upper and a lower bound on the value of \( \pi \) since the area of a circle with radius 1 is \( \pi \). Archimedes did something similar, but instead found the circumference of inscribed and circumscribed polygons – he bounded pi between the following \( 3\frac{1}{7} < \pi < 3\frac{10}{71} \). An interactive applet of Antiphon’s and Bryson’s construction can be found here where you will see an embedded geogebra app like the following 

As you can see, working out the area of a 512 sided polygon only results in upper and lower bounds that agree to 3 decimal places.  Clearly people needed to find a better method….

Since the ancient greeks many people have tried to improve the number of accurate decimal digits of pi that are known, but until an improvement in the calculation algorithms happened, the number of known decimal places didn’t improve dramatically. Today, the current record was announced on 8th October 2014, where 13,300,000,000,000 decimal places were computed and verified. THe increase in the number of decimal places oer the last 600 years or so can be seen in the plot below (data taken from Wikipedia’s chronology of computation of pi page)

Disclaimer: This is a plot generated quickly, I’m aware that it should be a step function style plot!!

In 1621, the Dutch mathematician Willebrod Snell improved on the polygon method, and derived a better way to approximate the perimeter of a circle using a polygon of fewer sides – he was able to find pi correct to 6 decimal places using a 96 sided polygon. Things really took off though when people moved away from using polygons to calculate pi and embraced calculus. Many power series representations were discovered and employed to increase the number of decimal digits. Maybe I will write about these for pi day next year!! The Aperiodical have produced a video showing a few slowly converging methods to approximate \( \pi \)

I want to briefly examine a more modern method discovered independently by Eugene Salamin and Richard Brent in 1975, known as the Brent-Salamin algorithm. This algorithm works by computing the arithmetic-geometric mean of two specific numbers. The arithmetic mean of two numbers \(a\) and \(b\)  is what people generally know as the mean, namely \(\frac{a+b}{2}\), whereas the geometric mean can be computed as \(\sqrt{ab}\). As an aside, for non-negative real numbers the arithmetic mean is always greater than or equal to the geometric mean – this is a fact we may use in some future posts discussing the analysis of finite element methods. Anyway, back to the arithmetic geometric mean algorithm: The arithmetic geometric mean or \(agm(a,b)\) is computed by repeatedly taking arithmetic and geometric means. You start with \(a_0 = a \) and \(b_0 = b \) then you keep computing the iterates 

\( \begin{align*} a_{n+1} &= \frac{a_n+b_n}{2} \\ b_{n+1} &= \sqrt{a_nb_n} \end{align*} \)

until your values for \(a_n\) and \(b_n\) agree to some accuracy. For example the first few iterations of the computation of the arithmetic-geometric mean of 12 and 17 produce the following

The (very simple) Matlab code to generate these numbers is here. As you can see, after only 3 iterations we have agreement to 8 decimal places, this very fast convergence (technically it is quadratic) is the reason why the agm algorithm for computing pi is so popular. 

To compute \(\pi \) we set \(a = 1 \) and \( b = \frac{1}{\sqrt{2}} \), compute \( agm(a,b) \) but as we do so, in addition to computing \(a_n\) and \(b_n\) we compute \( c_n  = a_{n+1} – a_n \). At the end we can then compute

\( S = \frac{1}{4} – \sum_{n=0}^{N} 2^n c_n^2, \)

where \(N \) is the number of iterations we have used to compute the arithmetic-geometric mean. Finally, we can compute \( \pi \) with the following 

\( \pi = \frac{(agm(a,b))^2}{S} \)

In 2011 Cleve Moler, the creator of Matlab wrote a great blog post on using Matlab’s variable precision arithmetic to generate digits of pi. In this he presented an implementation of the agm algorithm, which I have modified very slighty and used to compute some digits of \( \pi \) on my laptop. The code is available here and I ran it on a mid 2013 Macbook Air with a 1.3GHz Core i5 processor with 8GB of 1600 MHz DDR3 RAM. The table below shows the number of iterations and time taken to compute a certain number of decimal digits.



As can be seen from the table, the time taken rapidly starts to increase even though the number of iterations is growing fairly slowly. Implementing this in Matlab is obviously not the most efficient way, it would be far better (but harder) to implement it in C++ or Fortran using a robust variable precision arithmetic library. Variable precision arithmetic in itself is costly in terms of memory and computation time. As a non-scientific comparison Moler reported that computing 100000 digits took about 2.5 seconds on his laptop of the time.

The original papers of Brent and Salamin are fairly dense reads and include some elliptic integral theory which really isn’t my area. Luckily, a 1984 SIAM Review paper by Borwein and Borwein where they derive a similar iteration based on the arithmetic-geometric mean is much more accessible and is available at this link. The algorithm for computing \( \pi \) is contained in section 5; they also present algorithms for the calculation of other elementary functions.

I’m sure I will return to the problem of computing \( \pi \) on this blog in the future. Happy Pi Day!

Categories
Uncategorized

Math(s) Teachers at Play 83

Earlier this week I was honoured to hear that Stephen Cavadino (@srcav) had featured my post on conics with GeoGebra in Issue 83 of the Math(s) Teachers at Play blog carnival. 

The Teachers at Play blog carnival was started by Denise Gaskins (@letsplaymath) who regularly blogs herself. I can’t believe I didn’t know about the existence of this carnival until this week! There some great posts in this issue, and I have spent a lot of time this weekend reading through some posts from previous editions. 

Please do check out this issue here.

Thanks again for including me. 

Categories
Teaching

Pentominoes

Since starting teaching I’ve noticed that a lot of teachers like to use pentominoes for various activities.
As a way of learning and practicing some Javascript and getting to know the Fabric.js (@fabricjs) canvas library I have produced a pentomino arranging exercise, a screen shot is shown below:

(null)

You can move and rotate the pieces with a mouse (to rotate use the rotation handle that appears when you click on a piece), it should also work on touch devices.

Feel free to have a go here if you aWnt. The objective is simple – rearrange the pentominoes to tile the rectangle on the left hand side of the screen.

Categories
Uncategorized

Mathematician or Educator?

A couple of weeks ago I was at an IMA organised Mathematics and Industry event at Rolls-Royce in Derby. One of the speakers posed the question “Are you a mathematician or educator?”. This has led me to think about where I stand on the related  “Mathematician or educator?” question.

Ultimately I would describe myself as a mathematician who teaches. Whilst I’m passionate about good teaching and teaching concepts in a way that everyone can understand I don’t feel that teaching defines my outlook on life. Whereas being a mathematician in some way seems to define how my brain works and how I look at the world. 

I think it is easy to forget the mathematician in the day-to-day world of teaching but I think I owe it to my students to let them see the mathematician side of me and not just the teacher side of me. 

I’m really interested to see what other maths teachers think, particularly those who didn’t do a maths degree. Please leave a comment or message on Twitter 🙂 

Categories
A Level Software Teaching

Geogebra and Further Maths

This week I had an observed lesson, where the remit was that I do something risky that I perhaps wouldn’t have done otherwise.

My Year 12 Further Maths class had been selected as my observation lesson – I found thinknig of something risky to do with them harder than if it had been any other group. They are used to me doing odd things, that are a bit off the wall with them and they always respond well. In the end I decided to use ICT and try to get them to do some independent discovery work.

We have just started the coordinate geometry section of FP1 (Edexcel) and wer due to look at the parabola this week. I have used GeoGebra a bit in the past but I had never created my own geogebra worksheet before and this seemed like the perfect opportunity.

So, one evening I installed the latest version of GeoGebra on my MacBook, signed up for a GeoGebra Tube account and set about creating a worksheet where students would be able to explore the parametric equations of a parabola and the focus directrix property for themselves. I then uploaded the file to GeoGebra Tube, and got the content ID from the embed option. As I didn’t want to rely on GeoGebra being installed / working on all the computers in my teaching room I decided to upload a html version to my own webpage. The GeoGebra tean have made this really easy by poviding a javascript library that you can just source at the top of your html code and then a really simple API to embed a dynamic worksheet in your webpage. They have provided examples of how to do this.The web apps for the Parabola and Hyperbola that I created are here. On loading the page you should see a screen that looks like this:

I then wrote a sheet with some questions to guide the students’ explorations here, these questions should prompt them to derive the parametric equations of the parabola and notice the focus-directrix property. It is significantly harder to answer the questions concerning the hyperbola – I saw these as hard extension questions.

All of my class seemed to enjoy using these and engaged well with the work. Walking round the room I also saw some great responses to questions. 

To produce the worksheets, upload to GeoGebra Tube and then host on my website took in total about 2 hours which I don’t think is bad for a first time. 

My intention is to use GeoGebra moe across the keystages, any worksheets I create I will share through my website as well as GeoGebra Tube. The original GeoGebra files (in case you want to modify them) are here (parabola) and here (hyperbola). I will also be adding a worksheet for the Ellipse to the webpage later too. 

Some examples of students responses to the questions are shown below:





Update: Please be aware that for the web applets to load there has to be communication with the GeoGebra website, so make sure that is not on your schools block list. 

Categories
Uncategorized

Nottingham NQT Differentiation

On Thursday this week I went to the Nottingham University School of Education NQT session on differentiation. 

I was quite concerned at the beginning when someone presented slides titled “Differentiation by Gender” and “Differentiation by Learning Style” but the subject specific discussion was your interesting. In true ITT style we had to summarise our thoughts on a big piece of paper resulting in this:





The Venn diagram exercise I have used before with KS4+ but I’ve been inspired to try something similar with KS3 now. 

Categories
Problems Teaching

My First @solvemymaths Problem

This morning I woke up to the problem shown below by the excellent @solvemymaths on my Twitter feed.

(null)
I’ve always been very lazy and not properly solved any of his puzzles before, partly because I have a strange irrational fear of geometry. Wanting to conquer this fear I thought I’d have a quick go at this.
It turned out to be quite straight forward really (although I did make a silly mistake and got an original answer that seemed odd). My workings with my mistake are shown below:

(null)

Categories
Books

Classic Maths Books 2 – Numerical Solution of Partial Differential Equations by the Finite Element Method

This book isn’t actually that old, it was first published in 1987, the edition I have is a reprint by Dover Publications.

(null)
For my PhD I studied the application of a particular class of finite element methods for the solution of the neutron transport equation. Finite element methods are a way to numerically solve a partial differential equation – maybe I’ll write more about this in the future. It works by discretising the domain into regions known as elements and then producing an approximate solution on each element. Importantly, these approximate solutions converge to the true solution as the mesh is refined and the elements become smaller.
In the field of finite elements, it is widely regarded as a classic, and is often the first thing that someone new to the area reads, indeed it was the first published book on finite elements that I read. This is due to the relaxed and easy to read style of the book.
There are the following 13 chapters:

  1. Introduction
  2. Introduction to FEM for elliptic problems
  3. Abstract Formulation of the finite element method for elliptic problems
  4. Some finite element spaces
  5. Approximation theory for FEM. Error estimates for elliptic problems
  6. Some applications to elliptic problems
  7. Direct methods for solving linear systems of equations
  8. Minimization algorithms. Iterative methods
  9. FEM for parabolic problems
  10. Hyperbolic problems
  11. Boundary element methods
  12. Mixed finite element methods
  13. Curved elements and numerical integration
  14. Some non-linear problems

A really nice thing about this book is the mix of theoretical analysis and implementation details it provides. After reading this, you would be able to go away and code up a simple two dimensional finite element method. The book is well illustrated which helps with the understanding of concepts such as ‘basis functions’

(null)
As well as discussing finite elements the direct methods for solving linear systems is a fantastic introduction to this important area. The efficient solution of linear systems of equations is vital for any numerical solution of a real life problem that has been modelled by partial differential equations. This chapter serves as a great introduction to this topic (which will be considered more in future posts, and in a future classic books post). The chapters also contain a few stimulating questions, such as these from the linear systems chapter.

(null)
I think it is really nice that this book is written from a computational viewpoint (in addition to being mathematically rigorous) as after reading it, you can go away and code up the discretisation and a solver to try the methods out.

I would recommend this book to anyone who wants to learn about finite element method. The author did write an expanded book after this with some other authors, but it doesn’t read as nicely, and hasn’t generated the wave of good feeling in the finite element community as the original. In fact the sequel it is colloquially referred to as “The Black Death” (supposedly a term coined by one of the authors) as it is so bad!!

Categories
Uncategorized

Towards a Silent Aircraft

A good friend of mine, Ed Hall had told me about a lecture at the University of Leicester this Tuesday (10th February 2015). This lecture was the 17th Annual Industry lecture organised by department of Engineering and was given by Professor Dame Ann Dowling. Professor Dowling is President of the Royal Academy of Engineering and a professor of engineering at the University of Cambridge where she ran the University Gas Turbine partnership with Rolls-Royce between 2001 to 2014. She is a world authority on combustion and aero acoustics and researches efficient, low emission aero turbines and low noise vehicles among other things.

The lecture hall was completely packed, I’m guessing over 200 people were in attendance. Professor Dowling started the lecture by showing how the noise from modern civilian airliners is significantly lower than that from airliners of the early jet age and thar they are also more fuel efficient.

(null)
As you can see from the graph, this decrease in noise has plateaued (is this a word!?) in recent years. Perhaps a reason for this is that environmental concerns have led to an increase in attention paid to improving efficiency, she mentioned that increasing the size of the engines has increased fuel efficiency but increased the noise level (from the large fans).

More recently, during take-off the noise of the rear jet has been balanced by the noise of the fan at the front of the engine (on approach the noise of the airframe becomes significant too, I will be doing a write up of another talk which discussed this in more detail), and so, the noise of the rear facing jet is not the only thing to be controlled.

Below is a section diagram of the Rolls-Royce Trent 1000 (the picture is taken from their excellent infographic which is available here), I have included it here as I will refer to some of the key components.

(null)
The large size of the fan – ~2.8m for the Trent 1000 – contributes to the large noise from the fan, so making this as light as possible can help, for this reason Rolls-Royce now use hollow fan blades with an internal girder like structure. Something, that to me is less obvious, mentioned by Professor Dowling is the noise generated by the wake from the fan impinging on the static stators that are downstream of the fan. This can apparently be improved by designing the stator so that the wake hits them at different points leading to the different frequency components of the noise cancelling out (this is how I understood it anyway – I am not an aero-acoustic engineer!) – this is very cool! Modern jet engines also often have chevrons on the trailing edge of the jet nozzles to reduce noise by smoothing the mixing of hot and cold air, since the source of the noise is the velocity fluctuations in the air coming out of the nozzle. However, these are generally designed empirically since running a full large eddy simulation of a jet flow through a chevron-ed nozzle takes around 4-6 months on a national supercomputer. Professor Dowling’s team developed a far quicker method that was validated experimentally.
She then presented the SAX-40 concept design for a silent aircraft:

(null)
This image is taken from some slides available here. As you can see, this looks very different from todays conventional jets!
As the engines are buried inside the airframe, instead of in nacelles hung below the wings the airframe can be used to shield some of the noise, with more space being given over to the use of acoustic liners to contain the noise. The noise from the engines would also be reflected above the aircraft reducing the noise level when compared to a conventional aircraft even further. The wings of conventional planes reflect the noise below the aircraft and towards the ground. As mentioned earlier, the airframe noise is significant when a plane is coming into land; one factor contributing to this is the use of the flaps and slats on the wings which introduce large holes into the wing surface – the air flowing around these holes creates a lot of noise. For this reason, the concept features a deployable drooping edge.
The noise due to the undercarriage of an aircraft is also significant and Professor Dowling’s researchers looked into this too. To accurately measure the source of the noise from the undercarriage they installed 108 microphones in a section of floor from an aircraft which could then be used in a windtunnel. The undercarriage of modern civilian jets are pretty similar with most having multiple wheels that are exposed. The analysis discovered that having two wheels produced the largest reduction in noise, however this obviously limits the weight that can be born by the undercarriage. So, a design with the rear set of wheels staggered inside of the front, different shaped wheels at the front and rear and a fairing were found to reduce the noise from the undercarriage significantly.

This talk was very interesting and thought provoking. However, I’m not convinced we will ever see a plane like this due to how radical it is!!

It was also nice that there was a buffet reception after the talk where I had some interesting conversations with a retired engineer – you can’t beat free food! I had also been lucky enough to arrive in Leicester early and have time to talk to Ed about upwind fluxes, Runge-Kutta time stepping methods, discontinuous Galerkin methods and the Navier-Stokes equations – all exciting topics which I don’t have much of an opportunity to talk about anymore.

Categories
FMSP Favourite Problems Teaching

FMSP Favourite Problems – Number 2

Here is the second post in my ‘FMSP Favourite Problems’ series looking at the problems selected for the Further Maths Support Programme’s favourite problem series of posters.
This second problem I’m not very keen on as it just seems a bit dull.

(null)
As usual I started with a small sketch, annotated with what I knew – that fact that at every bounce the ball rebounds to a height 75% of the previous bounce.

(null)
As this is repeated for every subsequent bounce you can easily obtain a relation between the height of the initial bounce and the height of the \(nth\) bounce:

(null)
Clearly this is easily solved using logarithms

(null)
The answer above isn’t the full answer, since you don’t have decimals of a bounce, the ball must be on the 9th bounce before it rebounds to less than 10% of the original height.

Unfortunately, the typical GCSE student will not have come across logarithms – though I sort of feel that logarithms should be in the GCSE syllabus – and so couldn’t solve it this way. Unless I have missed something obvious, the only way that they could solve it would be to either calculate the powers of 0.75 until they got the correct value or to plot a graph. Not wanting to plot a graph by hand, I quickly loaded Matlab on my iPad and plotted the following:

(null)
In conclusion, as a problem I don’t find this particularly satisfying, however I think it could be used as an opening to an interesting lesson discussing exponential decay, mathematical modelling, ensuring answers you report are meaningful and interpreting graphs.