You are currently browsing the category archive for the ‘Real life maths’ category.

**Spotting Asset Bubbles**

Asset bubbles are formed when a service, product or company becomes massively over-valued only to crash, taking with it most of its investors’ money. There are many examples of asset bubbles in history – the Dutch tulip bulb mania and the South Sea bubble are two of the most famous historical examples. In the tulip mania bubble of 1636-37, the price of tulip bulbs became astronomically high – as people speculated that the rising prices would keep rising yet further. At its peak a single tulip bulb was changing hands for around 10 times the annual wage of a skilled artisan, before crashing to become virtually worthless.

More recent bubble include the Dotcom crash of the early 2000s – where investors piled in trying to spot in what ways the internet would revolutionise businesses. Huge numbers of internet companies tried to ride this wave by going public with share offerings. This led to massive overvaluation and a crash when investors realised that many of these companies were worthless. Pets.com is often given as an example of this exuberance – its stock collapsed from $11 to $0.19 in just 6 months, taking with it $300 million of venture capital.

Therefore spotting the next bubble is something which economists take very seriously. You want to spot the next bubble, but equally not to miss out on the next big thing – a difficult balancing act! The graph at the top of the page is given as a classic bubble. It contains all the key phases – an initial slow take-off, a steady increase as institutional investors like banks and hedge funds get involved, an exponential growth phase as the public get involved, followed by a crash and a return to its long term mean value.

**Comparing the Bitcoin graph to an asset bubble**

The above graph is charting the last year of Bitcoin growth. We can see several similarities – so let’s try and plot this on the same axis as the model. The orange dots represent data points for the initial model – and then I’ve fitted the Bitcoin graph over the top:

It’s not a bad fit – if this was going to follow the asset bubble model then it would be about to crash rapidly before returning to the long term mean of around $4000. Whether that happens or it continues to rise, you can guarantee that there will be thousands of economists and stock market analysts around the world doing this sort of analysis (albeit somewhat more sophisticated!) to decide whether Bitcoin really will become the future of money – or yet another example of an asset bubble to be studied in economics textbooks of the future.

**The Remarkable Dirac Delta Function**

This is a brief introduction to the Dirac Delta function – named after the legendary Nobel prize winning physicist Paul Dirac. Dirac was one of the founding fathers of the mathematics of quantum mechanics, and is widely regarded as one of the most influential physicists of the 20th Century. This topic is only recommended for students confident with the idea of limits and was inspired by a Quora post by Arsh Khan.

Dirac defined the delta function as having the following 2 properties:

The first property as defined above is that the delta function is 0 for all values of t, except for t = 0, when it is infinite.

The second property defined above is that the integral of the delta function – and the area of the graph between 2 points (either side of 0) is 1. We can take the bottom integral where we integrate from negative to positive infinity as this will be more useful later.

The delta function (technically not a function in a normal sense!) can be represented as the following limit:

Whilst this looks a little intimidating, it just means that we take the limit of the function as epsilon (ε) approaches 0. Given this definition of the delta function we can check that the 2 properties outlined above hold.

For the first limit above we set t not equal to 0. Then, because it is a continuous function when t is not equal to 0, we can effectively replace epsilon with 0 in the first limit above to get a limit of 0. In the second limit when t = 0 we get a limit of infinity. Therefore the first property holds.

To show that the second property holds, we start with the following integral identity from HL Calculus:

Hopefully this will look similar to the function we are interested in. Let’s play a little fast and loose with the mathematics and ignore the limit of the function and just consider the following integral:

Therefore (using the fact that the graph of arctanx has horizontal asymptotes at positive and negative pi/2 for the final part) :

So we have shown above that the integral of every function of this form will have an integral of 1, regardless of the value of epsilon, thus satisfying our second property.

**The use of the Dirac Function**

So far so good. But what is so remarkable about the Dirac function? Well, it allows objects to be described in terms of a single zero width (and infinitely high) spike, but despite having zero width, this spike still has an area of 1. This then allows the representation of elementary particles which have zero size but finite mass (and other finite properties such as charge) to be represented mathematically. With the area under the curve = 1 it can also be thought of in terms of a probability density function – i.e representing the quantum world in terms of probability wave functions.

**A graphical representation:**

This is easier to understand graphically. Say for example we choose a value epsilon (ε) and gradually make it smaller (i.e we find the limit as ε approaches 0). When ε = 5 we have the following:

When ε = 1 we have the following:

When ε = 0.1 we have the following:

When ε = 0.01 we have the following:

You can see that as ε approaches 0 we get a function which is close to 0 everywhere except for a spike at zero. The total area under the function remains at 1 for all ε.

Therefore we can represent the Dirac Delta function with the above graph. In it we have a point with zero width but with infinite height – and still with an area under the curve of 1!

**The Rise of Bitcoin**

Bitcoin is in the news again as it hits $10,000 a coin – the online crypto-currency has seen huge growth over the past 1 1/2 years, and there are now reports that hedge funds are now investing part of their portfolios in the currency. So let’s have a look at some regression techniques to predict the future price of the currency.

Here the graph has been inserted into Desmos and the scales aligned. 1 on the y axis corresponds to $1000 and 1 on the x axis corresponds to 6 months. 2013 is aligned with (0,0).

Next, I plot some points to fit the curve through.

Next, we use Desmos’ regression for y = ae^{bx}+d. This gives the line above with equation:

y = 5.10 x 10^{-7 }e^{1.67x }+ 0.432.

I included the vertical translation (d) because without it the graph didn’t fit the early data points well.

So, If I want to predict what the price will be in December 2019, I use x = 12

y = 5.10 x 10^{-7 }e^{1.67(12) }+ 0.432 = 258

and as my scale has 1 unit on the y axis equal to $1000, this is equal to $258,000.

So what does this show? Well it shows that Bitcoin is currently in a very steep exponential growth curve – which if sustained even over the next 12 months would result in astronomical returns. However we also know that exponential growth models are very poor at predicting long term trends – as they become unfeasibly large very quickly. The two most likely scenarios are:

- continued growth following a polynomial rather than exponential model
- a price crash

Predicting which of these 2 outcomes are most likely is probably best left to the experts! If you do choose to buy bitcoins you should be prepared for significant price fluctuations – which could be down as well as up. I’ll revisit this post in a few months and see what has happened.

If you are interested in some more of the maths behind Bitcoin, you can read about the method that is used to encrypt these currencies (a method called elliptical curve cryptography).

This is a quick example of how using Tracker software can generate a nice physics-related exploration. I took a spring, and attached it to a stand with a weight hanging from the end. I then took a video of the movement of the spring, and then uploaded this to Tracker.

**Height against time**

The first graph I generated was for the height of the spring against time. I started the graph when the spring was released from the low point. To be more accurate here you can calibrate the y axis scale with the actual distance. I left it with the default settings.

You can see we have a very good fit for a sine/cosine curve. This gives the approximate equation:

y = -65cos10.5(t-3.4) – 195

(remembering that the y axis scale is x 100).

This oscillating behavior is what we would expect from a spring system – in this case we have a period of around 0.6 seconds.

**Momentum against velocity**

For this graph I first set the mass as 0.3kg – which was the weight used – and plotted the y direction momentum against the y direction velocity. It then produces the above linear relationship, which has a gradient of around 0.3. Therefore we have the equation:

p = 0.3v

If we look at the theoretical equation linking momentum:

p = mv

(Where m = mass). We can see that we have almost perfectly replicated this theoretical equation.

**Height against velocity**

I generated this graph with the mass set to the default 1kg. It plots the y direction against the y component velocity. You can see from the this graph that the velocity is 0 when the spring is at the top and bottom of its cycle. We can then also see that it reaches its maximum velocity when halfway through its cycle. If we were to model this we could use an ellipse (remembering that both scales are x100 and using x for vy):

If we then wanted to develop this as an investigation, we could look at how changing the weight or the spring extension affected the results and look for some general conclusions for this. So there we go – a nice example of how tracker can quickly generate some nice personalised investigations!

**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:

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!

ISBN:

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

**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:

where:

*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

**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:

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? *

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.

**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.

**Time Travel and the Speed of Light**

This is one of my favourite videos from the legendary Carl Sagan. He explains the consequences of near to speed of light travel.

This topic fits quite well into a number of mathematical topics – from graphing, to real life uses of equations, to standard form and unit conversions. It also challenges our notion of time as we usually experience it and therefore leads onto some interesting questions about the nature of reality. Below we can see the time dilation graph:

which clearly shows that for low speeds there is very little time dilation, but when we start getting to within 90% of the speed of light, that there is a very significant time dilation effect. For more accuracy we can work out the exact dilation using the formula given – where v is the speed traveled, c is the speed of light, t is the time experienced in the observer’s own frame of reference (say, by looking at his watch) and t’ is the time experienced in a different, stationary time frame (say on Earth) . Putting some numbers in for real life examples:

1) A long working air steward spends a cumulative total of 5 years in the air – flying at an average speed of 900km/h. How much longer will he live (from a stationary viewpoint) compared to if he had been a bus driver?

2) Voyager 1, launched in 1977 and now currently about 1.8×10^10 km away from Earth is traveling at around 17km/s. How far does this craft travel in 1 hour? What would the time dilation be for someone onboard since 1977?

3) I built a spacecraft capable of traveling at 95% the speed of light. I said goodbye to my twin sister and hopped aboard, flew for a while before returning to Earth. If I experienced 10 years on the space craft, how much younger will I be than my twin?

**Scroll to the bottom for the answers**

Marcus De Sautoy also presents an interesting Horizon documentary on the speed of light, its history and the CERN experiments last year that suggested that some particles may have traveled faster than light:

There is a lot of scope for extra content on this topic – for example, looking at the distance of some stars visible in the night sky. For example, red super-giant star Belelgeuse is around 600 light years from Earth. (How many kilometres is that?) When we look at Betelgeuse we are actually looking 600 years “back in time” – so does it make sense to use time as a frame of reference for existence?

**Answers**

1) Convert 900km/h into km/s = 0.25km/s. Now substitute this value into the equation, along with the speed of light at 300,000km/s….and even using Google’s computer calculator we get a difference so negligible that the denominator rounds to 1.

2) With units already in km/s we substitute the values in – and using a powerful calculator find that denominator is 0.99999999839. Therefore someone traveling on the ship for what their watch recorded as 35 years would actually have been recorded as leaving Earth 35.0000000562 years ago. Which is about 1.78seconds! So still not much effect.

3) This time we get a denominator of 0.3122498999 and so the time experienced by my twin will be 32 years. In effect my sister will have aged 22 years more than me on my return. Amazing!

If you enjoyed this topic you might also like:

Michio Kaku – Universe in a Nutshell

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

**Even Pigeons Can Do Maths**

This is a really interesting study from a couple of years ago, which shows that even pigeons can deal with numbers as abstract quantities – in the study the pigeons counted groups of objects in their head and then classified the groups in terms of size. From the New York Times Article:

*“Given groups of six and nine, they could pick, or peck, the images in the right order. This is one more bit of evidence of how smart birds really are, and it is intriguing because the pigeons’ performance was so similar to the monkeys’. “I was surprised,” Dr. Scarf said.*

*He and his colleagues wrote that the common ability to learn rules about numbers is an example either of different groups — birds and primates, in this case — evolving these abilities separately, or of both pigeons and primates using an ability that was already present in their last common ancestor.*

*That would really be something, because the common ancestor of pigeons and primates would have been alive around 300 million years ago, before dinosaurs and mammals. It may be that counting was already important, but Dr. Scarf said that if he had to guess, he would lean toward the idea that the numerical ability he tested evolved separately. “I can definitely see why both monkeys and pigeons could profit from this ability,” he said.”*

To find mathematical ability amongst both monkeys and pigeons therefore raises two equally interesting possibilities. Perhaps basic numeracy is a rare trait, but such a fundamentally important skill for life that it emerged hundreds of millions of years ago. Or perhaps basic numeracy is a relatively common trait – which can evolve independently in different species.

Either way, it is clear that there must be an evolutionary benefit for being able to process abstract quantities – most likely in terms of food. A monkey who can look at two piles of coconuts and count 5 in one pile and 6 in the other and know that 6 is a bigger quantity than 5 can then choose the larger pile to sit alongside and eat. Perhaps this evolutionary benefit is the true origin of our ability to do maths.

Another similar experiment looked at the ability of chimpanzees to both count numbers, and also demonstrated their remarkable photographic memory.

On the screen the monkeys are given a flash of 10 number for a fraction of a second, before the numbers are covered up, and they then proceed to correctly show the position of all numbers from 1-10. They are much better at this task than humans. This is a good task to try at school using the online game here and would also make a good IB investigation. Can you beat the chimps?

This all ties into the question about where mathematical ability comes from. If there had been no evolutionary ability for such abstract abilities with numbers, then perhaps today our brains would be physically incapable of higher level mathematical thinking.

If you enjoyed this post you might also like: