IB Maths and GCSE Maths Resources from British International School Phuket. Theory of Knowledge (ToK). Maths explorations and investigations.  Real life maths. Maths careers. Maths videos. Maths puzzles and Maths lesson resources.

Screen Shot 2015-01-25 at 8.08.14 PM

British International School Phuket

Welcome to the British International School Phuket’s maths website. My name is Andrew Chambers and I am currently working at BISP.  I am running my site as the school’s maths resources website for both our students and students around the world.

We are a British international school located on the tropical island of Phuket in Southern Thailand. We offer a number of scholarships each year, catering for a number of national and international standard sports stars as well as for academic excellence. You can find out more about our school here.

There are a huge amount of resources to explore – especially for students doing their IAs and for students looking for revision videos.  You may also like to try our school code breaking site – where you can compete with over 10,000 students from around the world who have made it onto our school leaderboard.


Predicting the UK election using linear regression

The above data is the latest opinion poll data from the Guardian.  The UK will have (another) general election on June 8th.  So can we use the current opinion poll data to predict the outcome?

Longer term data trends

Let’s start by looking at the longer term trend following the aftermath of the Brexit vote on June 23rd 2016.  I’ll plot some points for Labour and the Conservatives and see what kind of linear regression we get.  To keep things simple I’ve looked at randomly chosen poll data approximately every 2 weeks – assigning 0 to July 1st 2016, 1 to mid July, 2 to August 1st etc.  This has then been plotted using the fantastic Desmos.


You can see that this is not a very good fit – it’s a very weak correlation.  Nevertheless let’s see what we would get if we used this regression line to predict the outcome in June.  With the x axis scale I’ve chosen, mid June 2017 equates to 23 on the x axis.  Therefore we predict the percentage as

y = -0.130(23) + 30.2

y  = 27%

Clearly this would be a disaster for Labour – but our model is not especially accurate so perhaps nothing to worry about just yet.


As with Labour we have a weak correlation – though this time we have a positive rather than negative correlation.  If we use our regression model we get a prediction of:

y = 0.242(23) + 38.7

y = 44%

So, we are predicting a crushing victory for the Conservatives – but could we get some more accurate models to base this prediction on?

Using moving averages

The Guardian’s poll tracker at the top of the page uses moving averages to smooth out poll fluctuations between different polls and to arrive at an averaged poll figure.  Using this provides a stronger correlation:


This model doesn’t take into account a (possible) late surge in support for Labour but does fir better than our last graph.  Using the equation we get:

y = -0.0764(23) + 28.8

y = 27%


We can have more confidence in using this regression line to predict the election.  Putting in the numbers we get:

y = 0.411(23) + 36.48

y = 46%


Our more accurate models merely confirm what we found earlier – and indeed what all the pollsters are predicting – a massive win for the Conservatives.  Even allowing for a late narrowing of the polls the Conservatives could be on target for winning by over 10% points – which would result in a very large majority.  Let’s see what happens!

This is an example of how an investigation into area optimisation could progress.  The problem is this:

A farmer has 40m of fencing.  What is the maximum area he can enclose?

Case 1:  The rectangle:

Reflection – the rectangle turns out to be a square, with sides 10m by 10m.  Therefore the area enclosed is 100 metres squared.

Case 2:  The circle:

Reflection:  The area enclosed is greater than that of the square – this time we have around 127 metres squared enclosed.

Case 3: The isosceles triangle:

Reflection – our isosceles triangle turns out to be an equilateral triangle, and it only encloses an area of around 77 metres squared.

Case 4, the n sided regular polygon

Reflection:  Given that we found the cases for a 3 sided and 4 sided shape gave us the regular shapes, it made sense to look for the n-sided regular polygon case.  If we try to plot the graph of the area against n we can see that for n ≥3 the graph has no maximum but gets gets closer to an asymptote.  By looking at the limit of this area (using Wolfram Alpha) as n gets large we can see that the limiting case is the circle. This makes sense as regular polygons become closer to circles the more sides they have.

Proof of the limit using L’Hospital’s Rule


Here we can prove that the limit is indeed 400/pi by using L’Hospital’s rule.  We have to use it twice and also use a trig identity for sin(2x) – but pleasingly it agrees with Wolfram Alpha.

So, a simple example of how an investigation can develop – from a simple case, getting progressively more complex and finishing with some HL Calculus Option mathematics.


Cracking ISBN and Credit Card Codes

ISBN codes are used on all books published worldwide. It’s a very powerful and useful code, because it has been designed so that if you enter the wrong ISBN code the computer will immediately know – so that you don’t end up with the wrong book. There is lots of information stored in this number. The first numbers tell you which country published it, the next the identity of the publisher, then the book reference.

Here is how it works:

Look at the 10 digit ISBN number. The first digit is 1 so do 1×1. The second digit is 9 so do 2×9. The third digit is 3 so do 3×3. We do this all the way until 10×3. We then add all the totals together. If we have a proper ISBN number then we can divide this final number by 11. If we have made a mistake we can’t. This is a very important branch of coding called error detection and error correction. We can use it to still interpret codes even if there have been errors made.
If we do this for the barcode above we should get 286. 286/11 = 26 so we have a genuine barcode.

Check whether the following are ISBNs

1) 0-13165332-6
2) 0-1392-4191-4
3) 07-028761-4

Challenge (harder!) :The following ISBN code has a number missing, what is it?
1) 0-13-1?9139-9

Answers in white text at the bottom, highlight to reveal!

Credit cards use a different algorithm – but one based on the same principle – that if someone enters a digit incorrectly the computer can immediately know that this credit card does not exist.  This is obviously very important to prevent bank errors.  The method is a little more complicated than for the ISBN code and is given below from computing site Hacktrix:

creditcard2credit card 4creditcard3credit card 6credit card 5credit card 8credit card 7

credi card 9 You can download a worksheet for this method here. Try and use this algorithm to validate which of the following 3 numbers are genuine credit cards:

1) 5184 8204 5526 6425

2) 5184 8204 5526 6427

3) 5184 8204 5526 6424

Answers in white text at the bottom, highlight to reveal!

1) Yes
2) Yes
3) No
1) 3 – using x as the missing number we end up with 5x + 7 = 0 mod 11. So 5x = 4 mod 11. When x = 3 this is solved.
Credit Card: The second one is genuine

If you liked this post you may also like:

NASA, Aliens and Binary Codes from the Stars – a discussion about how pictures can be transmitted across millions of miles using binary strings.

Cracking Codes Lesson – an example of 2 double period lessons on code breaking

Modelling a Nuclear War 

With the current saber rattling from Donald Trump in the Korean peninsula and the instability of North Korea under Kim Jong Un (incidentally a former IB student!) the threat of nuclear war is once again in the headlines.  Post Cold War we’ve got somewhat used to the peace afforded by the idea of mutually assured destruction – but this peace only holds with rational actors in charge of pushing the buttons.  The closest we have got to a nuclear war between 2 nuclear powers was in the 1962 Cuban missile crisis – and given the enormous nuclear arsenals of the US and the then USSR this could have pretty much ended civilization as we know it.  In that period, modelling of the effects of nuclear war was a real priority.  So let’s have a look at some current modelling  predictions for the effects of a nuclear war.  Those of a nervous disposition may wish to look away!

Nuclear blast radius

The picture at the top of the post is the nuclear blast radius calculated from this site.  It shows the effects of a 100 megaton airburst (equivalent to 100 million tonnes of TNT explosive).  This is the biggest nuclear bomb that the USSR ever tested.  If dropped on London it would have a fireball radius of 6km, an air blast radius of 33 km (destroying most buildings) and a thermal radiation radius of 74km.  The site estimates that this single bomb would cause 6 million deaths and another 6 million injuries.  And remember this is a single bomb – there are collectively around 15,000 nuclear weapons in the world (the majority shared between the US and Russia).

Nuclear Winter

Whilst the effects of a single bomb would be absolutely catastrophic for both a country and also for the global economy, it would not be an extinction event for humanity – however scientists have modelled the consequences of a nuclear war which would effect the climate to such an extent that it could lead to global mass extinctions.

Let’s have a look at one of those papers – the pessimistically titled:

Nuclear winter revisited with a modern climate model and current nuclear arsenals: Still catastrophic consequences.

In this paper the authors look at 2 scenarios – the long term climate effect of (a) the detonation of 1/3 of the world’s arsenal of nuclear weapons and (b) the detonation of the full arsenal of the world’s nuclear weapons.  Let’s leave to the side that this would almost certainly end civilisation as we know it – but what would be in store for those lucky (?) enough to survive such an event?

Changes to global temperature and rainfall

This above graphic is a double line graph – with the red lines relating to changes in temperature and the black line corresponding to the changes in precipitation.  The middle 2 lines relate to case (a) and the bottom 2 lines  relate to case (b).  The y axis relates to years.  You can see from this graph that a large nuclear war where 1/3 of the nuclear arsenal was released would have a significant effect on both global temperatures and rainfall.  5 years after the detonations you would have a global temperature 3-4 degrees lower than normal, and even a decade later it would still be a degree lower than normal.  For the full nuclear arsenal case the effects would be catastrophic – a average global drop in temperature of close to 9 degrees 2-3 years after the event.  To put this in context – the last ice age had global temperatures around 5 degrees lower than present.   Meanwhile the average rainfall would drop by around 1.6mm/day equivalent to a 45% global drop in rainfall.

Localised effects of changes in precipitation 

This above graphic shows the distribution of the effects of precipitation following the detonation of the full nuclear arsenal one year on.  You can see that not all parts of the globe are equally effected. The countries near the equator see a massive drop in rainfall (more than 3.5mm/day) along with large parts of North America and Western Europe

Localised effects in the change in temperatures:

This above graphic shows the distribution of the effects of temperature following the detonation of the full nuclear arsenal one year on.  As with the rainfall, you can see startling changes – parts of North America would be 20-30 degrees colder than average, parts of Russia 30-35 degrees colder.  You can see the misleading nature of global temperature averages here.  The global average temperature drop after 1 year was “only” 5 degree – but the parts where the majority of people live see temperature drops many times this.  The global average is brought up by the relatively small change in global ocean temperatures.

Results of a nuclear winter

These changes to the climate alone would be sufficient to destroy agricultural production for the global food chain for a number of years.  One gloomy assessment in 1986 referenced in the paper is that the majority of people who had somehow survived the nuclear bombs and radiation would in any case die in the following years of starvation as crops failed across the globe.  So in short given have the ability to cause our own extinction event, let’s hope those with their fingers on the nuclear buttons are rational enough never to press them.

I’ve just put together a playlist to help students studying for their IGCSE Cambridge 0580 or Cambridge 0607 Maths exams.

Topics included are:
1. Number
2. Circle Theorems and angles
3. Algebra
4. Volume
5. Statistics
6. Solving equations using graphs
7. Trigonometry
8. Linear graphs and inequalities
9. Transformations
10. Probability and Venn Diagrams
11. Vectors
12. Functions
13. Sequences

For each topic I have chosen a few past paper questions to talk through. Hopefully this should be useful for students sitting their exams in the coming weeks.

NASA, Aliens and Binary Codes from the Star

The Drake Equation was intended by astronomer Frank Drake to spark a dialogue about the odds of intelligent life on other planets. He was one of the founding members of SETI – the Search for Extra Terrestrial Intelligence – which has spent the past 50 years scanning the stars looking for signals that could be messages from other civilisations.

In the following video, Carl Sagan explains about the Drake Equation:

The Drake equation is:


N = the number of civilizations in our galaxy with which communication might be possible (i.e. which are on our current past light cone);
R* = the average number of star formation per year in our galaxy
fp = the fraction of those stars that have planets
ne = the average number of planets that can potentially support life per star that has planets
fl = the fraction of planets that could support life that actually develop life at some point
fi = the fraction of planets with life that actually go on to develop intelligent life (civilizations)
fc = the fraction of civilizations that develop a technology that releases detectable signs of their existence into space
L = the length of time for which such civilizations release detectable signals into space

The desire to encode and decode messages is a very important branch of mathematics – with direct application to all digital communications – from mobile phones to TVs and the internet.

All data content can be encoded using binary strings. A very simple code could be to have 1 signify “black” and 0 to signify “white” – and then this could then be used to send a picture. Data strings can be sent which are the product of 2 primes – so that the recipient can know the dimensions of the rectangle in which to fill in the colours.

If this sounds complicated, an example from the excellent Maths Illuminated handout on codes:


If this mystery message was received from space, how could we interpret it? Well, we would start by noticing that it is 77 digits long – which is the product of 2 prime numbers, 7 and 11. Prime numbers are universal and so we would expect any advanced civilisation to know about their properties. This gives us either a 7×11 or 11×7 rectangular grid to fill in. By trying both possibilities we see that an 11×7 grid gives the message below.


More examples can be downloaded from the Maths Illuminated section on Primes (go to the facilitator pdf).

A puzzle to try:

“If the following message was received from outer space, what would we conjecture that the aliens sending it looked like?”

0011000 0011000 1111111 1011001 0011001 0111100 0100100 0100100 0100100 1100110

Hint: also 77 digits long.

This is an excellent example of the universality of mathematics in communicating across all languages and indeed species. Prime strings and binary represent an excellent means of communicating data that all advanced civilisations would easily understand.

Answer in white text below (highlight to read)

Arrange the code into a rectangular array – ie a 11 rows by 7 columns rectangle. The first 7 numbers represent the 7 boxes in the first row etc. A 0 represents white and 1 represents black. Filling in the boxes and we end up with an alien with 2 arms and 2 legs – though with one arm longer than the other!
If you enjoyed this post you may also like:

Cracking Codes Lesson – a double period lesson on using and breaking codes

Cracking ISBN and Credit Card Codes– the mathematics behind ISBN codes and credit card codes

Sequence Investigation

This is a nice investigation idea from Nrich.  The above screen capture is from their Picture Story puzzle.  We have successive cubes – a 1x1x1 cube, a 2x2x2 cube etc.

The cubes are then rearranged to give the following shape.  The puzzle is then to use this information to discover a mathematical relationship.  This was my first attempt at this:

13 = 12
23 = (1+2)2 – 12
33 = (1+2+3)2 – (1+2)2
43 = (1+2+3+4)2 – (1+2+3)2

n3 = (1+2+3+4+…+n)2 – (1+2+3+…+ (n-1))2

This is not an especially attractive relationship – but nevertheless we have discovered a mathematical relationship using the geometrical figures above. Next let’s see why the RHS is the same as the LHS.


(1+2+3+4+…+n)2 – (1+2+3+…+ (n-1))2

= ([1+2+3+4+…+ (n-1)] + n)2 – (1+2+3+…+ (n-1))2

= (1+2+3+…+ (n-1))2 + n2 + 2n(1+2+3+4+…+ (n-1)) – (1+2+3+…+ (n-1))2

= n2 + 2n(1+2+3+4+…+ (n-1))

next we notice that 1+2+3+4+…+ (n-1) is the sum of an arithmetic sequence first term 1, common difference 1 so we have:

1+2+3+4+…+ (n-1) = (n-1)/2 (1 + (n-1) )

1+2+3+4+…+ (n-1) = (n-1)/2 + (n-1)2/2

1+2+3+4+…+ (n-1) = (n-1)/2 + (n2 – 2n + 1)/2


2n(1+2+3+4+…+ (n-1)) = 2n ( (n-1)/2 + (n2 – 2n + 1)/2 )

2n(1+2+3+4+…+ (n-1)) = n2 -n + n3 – 2n2 + n


n2 + 2n(1+2+3+4+…+ (n-1)) = n2 + n2 -n + n3 – 2n2 + n
n2 + 2n(1+2+3+4+…+ (n-1)) = n3

and we have shown that the RHS does indeed simplify to the LHS – as we would expect.

An alternative relationship

13 = 12
13+23 = (1+2)2
13+23+33  = (1+2+3)2
13+23+33+…n3  = (1+2+3+…+n)2

This looks a bit nicer – and this is a well known relationship between cubes and squares.  Could we prove this using induction?  Well we can show it’s true for n =1.  Then we can assume true for n=k:

13+23+33+…k3  = (1+2+3+…+k)2

Then we want to show true for n = k+1


13+23+33+… k3  + (k+1)3= (1+2+3+…+k + (k+1))2


13+23+33+… k3  + (k+1)3

= (1+2+3+…+k)2 + (k+1)3


(1+2+3+…+k + (k+1))2

= ([1+2+3+…+k] + (k+1) )2

= [1+2+3+…+k]2 + (k+1)2 + 2(k+1)[1+2+3+…+k]

= [1+2+3+…+k]+ (k+1)2 + 2(k+1)(k/2 (1+k))   (sum of a geometric formula)

= [1+2+3+…+k]+ (k+1)2 + 2(k+1)(k/2 (1+k))

= [1+2+3+…+k] + k3+ 3k2 + 3k + 1

= (1+2+3+…+k)2 + (k+1)3

Therefore we have shown that the LHS = RHS and using our induction steps have shown it’s true for all n.  (Write this more formally for a real proof question in IB!)

So there we go – a couple of different mathematical relationships derived from a simple geometric pattern – and been able to prove the second one (the first one would proceed in a similar manner).  This sort of free-style pattern investigation where you see what maths you can find in a pattern could make an interesting maths IA topic.


Benford’s Law – Using Maths to Catch Fraudsters

Benford’s Law is a very powerful and counter-intuitive mathematical rule which determines the distribution of leading digits (ie the first digit in any number).  You would probably expect that distribution would be equal – that a number 9 occurs as often as a number 1.  But this, whilst intuitive, is false for a large number of datasets.   Accountants looking for fraudulant activity and investigators looking for falsified data use Benford’s Law to catch criminals.

The probability function for Benford’s Law is:

benford 5


This clearly shows that a 1 is by far the most likely number to occur – and that you have nearly a 60% chance of the leading digit being 3,2 or 1.   Any criminal trying to make up data who didn’t know this law would be easily caught out.

Scenario for students 1:

You are a corrupt bank manager who is secretly writing cheques to your own account.  You can write any cheques for any amount – but you want it to appear natural so as not to arouse suspicion.  Write yourself 20 cheque amounts.  Try not to get caught!

Look at the following fraudualent cheques that were written by an Arizona manager – can you see why he was caught?   


Scenario for students 2:

Use the formula for the probability density function to find the probability of the respective leading digits.  Look at the leading digits for the first 50 Fibonacci numbers.  Does the law hold?

benford 4

There is also an excellent Numberphile video on Benford’s Law.  Wikipedia has a lot more on the topic, as have the Journal of Accountancy.

If you enjoyed this topic you might also like:

Amanda Knox and Bad Maths in Courts – some other examples of mathematics and the criminal justice system.

Cesaro Summation: Does 1 – 1 + 1 – 1 … = 1/2? – another surprising mathematical result.

Screen Shot 2017-03-15 at 10.32.24 PM

IB Standard Level Revision Videos

With the IB SL Maths exams fast approaching here are some video resources to help with revision:

Algebra, Functions, Trigonometry past paper questions

This is a playlist with past paper questions covering:

1) Algebra:arithmetic and geometric sequences and series, logs, binomial expansion,
2) functions: Inverses, completing the square, sketching quadratics and transformations,
3) Trigonometry: triangles, solving trig equations, double angle formulae and transforming trig graphs.

Below are also some great overview videos which cover each of the units in the course. (Note matrices are no longer in the syllabus).

SL Algebra Revision:

SL Functions Revision:

SL Trigonometry Revision:

SL Vectors Revision (skip straight to around 23 mins)

SL Probability and Statistics Revision:

SL Calculus Review part 1:

SL Calculus Review part 2:

SL GDC Calculator skills for Paper 2 Using Ti-84:

traffic simulation

Simulations -Traffic Jams and Asteroid Impacts

This is a really good online Java app which has been designed by a German mathematician to study the mathematics behind traffic flow.  Why do traffic jams form?  How does the speed limit or traffic lights or the number of lorries on the road affect road conditions?   You can run a number of different simulations – looking at ring road traffic, lane closures and how robust the system is by applying an unexpected perturbation (like an erratic driver).

There is a lot of scope for investigation – with some prompts on the site.  For example, just looking at one variable – the speed limit – what happens in the lane closure model?  Interestingly, with a homogenous speed of 80 km/h there is no traffic congestion – but if the speed is increased to 140km/h then large congestion builds up quickly as cars are unable to change lanes.   This is why reduced speed limits  are applied on motorways during lane closures.

Another investigation is looking at how the style of driving affects the models.  You can change the politeness of the drivers – do they change lanes recklessly?  How many perturbations (erratic incidents) do you need to add to the simulation to cause a traffic jam?

This is a really good example of mathematics used in a real life context – and also provides some good opportunities for a computer based investigation looking at the altering one parameter at a time to note the consequences.


Another good simulation is on the Impact: Earth page.  This allows you to investigate the consequences of various asteroid impacts on Earth – choosing from different parameters such as diameter, velocity, density and angle of impact.  It then shows a detailed breakdown of thee consequences – such as crater size and energy released.   You can also model some famous impacts from history and see their effects.   Lots of scope for mathematical modelling – and also for links with physics.  Also possible discussion re the logarithmic Richter scale – why is this useful?

Student Handout

Asteroid Impact – Why is this important?
Comets and asteroids impact with Earth all the time – but most are so small that we don’t even notice. On a cosmic scale however, the Earth has seen some massive impacts – which were they to happen again today could wipe out civilisation as we know it.

The website Impact Earth allows us to model what would happen if a comet or asteroid hit us again. Jay Melosh professor of Physics and Earth Science says that we can expect “fairly large” impact events about every century. The last major one was in Tunguska Siberia in 1908 – which flattened an estimated 80 million trees over an area of 2000 square km. The force unleashed has been compared to around 1000 Hiroshima nuclear bombs. Luckily this impact was in one of the remotest places on Earth – had the impact been near a large city the effects could be catastrophic.

Jay says that, ”The biggest threat in our near future is the asteroid Apophis, which has a small chance of striking the Earth in 2036. It is about one-third of a mile in diameter.”

Task 1: Watch the above video on a large asteroid impact – make some notes.

Task 2:Research about Apophis – including the dimensions and likely speed of the asteroid and probability of collision. Use this data to enter into the Impact Earth simulation and predict the damage that this asteroid could do.

Task 3: Investigate the Tunguska Event. When did it happen? What was its diameter? Likely speed? Use the data to model this collision on the Impact Earth Simulation. Additional: What are the possible theories about Tunguska? Was it a comet? Asteroid? Death Ray?

Task 4: Conduct your own investigation on the Impact Earth Website into what factors affect the size of craters left by impacts. To do this you need to change one variable and keep all the the other variables constant.  The most interesting one to explore is the angle of impact.  Keep everything else the same and see what happens to the crater size as the angle changes from 10 degrees to 90 degrees.  What angle would you expect to cause the most damage?  Were you correct?  Plot the results as a graph.

If you enjoyed this post you might also like:

Champagne Supernovas and the Birth of the Universe – some amazing photos from space.

Fractals, Mandelbrot and the Koch Snowflake – using maths to model infinite patterns.

Website Stats


Recent Posts

Follow IB Maths Resources from British International School Phuket on WordPress.com