**Fourier Transform**

The Fourier Transform and the associated Fourier series is one of the most important mathematical tools in physics. Physicist Lord Kelvin remarked in 1867:

*“Fourier’s theorem is not only one of the most beautiful results of modern analysis, but it may be said to furnish an indispensable instrument in the treatment of nearly every recondite question in modern physics.”*

The Fourier Transform deals with time based waves – and these are one of the fundamental building blocks of the natural world. Sound, light, gravity, radio signals, Earthquakes and digital compression are just some of the phenomena that can be understood through waves. It’s not an exaggeration therefore to see the study of waves as one of the most important applications of mathematics in our modern life.

Here are some real life applications in a wide range of fields:

JPEG picture and MP3 sound compression – to allow data to reduced in size.

Analysing DNA sequences – to allow identification of specific regions of genetic code

Apps like Shazam which can recognise a song from a sample of music

Processing mobile phone network data and WIFI data

Signal processing – in everything from acoustic guitar amps or electrical currents through capacitors

Radio telescopes – used to construct images of the night sky

Building’s natural frequencies – architects can design buildings to better withstand earthquakes.

Medical imaging such as MRI scans

There are many more applications – this Guardian article is a good introduction to some others.

So, what is the Fourier Transform? It takes a graph like the graph f(t) = cos(at) below:

and transforms it into:

From the above cosine graph we can see that it is periodic time based function. Time is plotted on the x axis, and this graph will tell us the value of f(t) at any given time. The graph below with 2 spikes represents this same information in a different way. It shows the frequency (plotted on the x axis) of the cosine graph. Now the frequency of a function measures how many times it repeats per second. So for a graph f(t) = cos(at) it can be calculated as the inverse of the period. The period of cos(at) is 2pi/a so it has a frequency of a/2pi.

Therefore the frequency graph for cos(ax) will have spikes at a/2pi and -a/2pi.

But how does this new representation help us? Well most real life waves are much more complicated than simple sine or cosine waves – like this trumpet sound wave below:

But the remarkable thing is that every continuous wave can be modelled as the sum of sine and cosine waves. So we can break-down the very complicated wave above into (say) cos(x) + sin(2x) + 2cos(4x) . This new representation would be much easier to work with mathematically.

The way to find out what these constituent sine and cosine waves are that make up a complicated wave is to use the Fourier Transform. By transforming a function into one which shows the frequency peaks we can work out what the sine and cosine parts are for that function.

For example, this transformed graph above would show which frequency sine and cosine functions to use to model our original function. Each peak represents a sine or cosine function of a specific frequency. Add them all together and we have our function.

The maths behind this does get a little complicated. I’ll try and talk through the method using the function f(t) = cos(at).

So, the function we want to break down into its constituent cosine and sine waves is cos(at). Now, obviously this function can be represented just with cos(at) – but this is a good demonstration of how to use the maths for the Fourier Transform. We already know that this function has a frequency of a/2pi – so let’s see if we can find this frequency using the Transform.

This is the formula for the Fourier Transform. We “simply” replace the f(t) with the function we want to transform – then integrate.

To make this easier we use the exponential formula for cosine. When we have f(t) = cos(at) we can rewrite this as the function above in terms of exponential terms.

We substitute this version of f(t) into the formula.

Next we multiply out the exponential terms in the bracket (remember the laws of indices), and then split the integral into 2 parts. The reason we have grouped the powers in this way is because of the following step.

This is the delta function – which as you can see is very closely related to the integrals we have. Multiplying both sides by pi will get the integral in the correct form. The delta function is a function which is zero for all values apart from when the domain is zero.

So, the integral can be simplified as this above.

So, our function F will be zero for all values except when the delta function is zero. This gives use the above equations.

Therefore solving these equations we get an answer for the frequency of the graph.

This frequency agrees with the frequency we already expected to find for cos(at).

A slightly more complicated example would be to follow the same process but this time with the function f(t) = cos(at) + cos(bt). If the Fourier transform works correctly it should recognise that this function is composed of one cosine function with frequency a/2pi and another cosine function of b/2pi. If we follow through exactly the same method as above (we can in effect split the function into cos(at) and cos(bt) and do both separately), we should get:

This therefore is zero for all values except for when we have frequencies of a/2pi and b/2pi. So the Fourier Transform has correctly identified the constituent parts of our function.

If you want to read more about Fourier Transforms, then the Better Explained article is an excellent start.

]]>**Non Euclidean Geometry – An Introduction**

It wouldn’t be an exaggeration to describe the development of non-Euclidean geometry in the 19th Century as one of the most profound mathematical achievements of the last 2000 years. Ever since Euclid (c. 330-275BC) included in his geometrical proofs an assumption (postulate) about parallel lines, mathematicians had been trying to prove that this assumption was true. In the 1800s however, mathematicians including Gauss started to wonder what would happen if this assumption was false – and along the way they discovered a whole new branch of mathematics. A mathematics where there is an absolute measure of distance, where straight lines can be curved and where angles in triangles don’t add up to 180 degrees. They discovered non-Euclidean geometry.

**Euclid’s parallel postulate (5th postulate)**

Euclid was a Greek mathematician – and one of the most influential men ever to live. Through his collection of books, *Elements, *he created the foundations of geometry as a mathematical subject. Anyone who studies geometry at secondary school will still be using results that directly stem from Euclid’s *Elements* – that angles in triangles add up to 180 degrees, that alternate angles are equal, the circle theorems, how to construct line and angle bisectors. Indeed you might find it slightly depressing that you were doing nothing more than re-learn mathematics well understood over 2000 years ago!

All of Euclid’s results were based on rigorous deductive mathematical proof – if A was true, and A implied B, then B was also true. However Euclid did need to make use of a small number of definitions (such as the definition of a line, point, parallel, right angle) before he could begin his first book He also needed a small number of postulates (assumptions given without proof) – such as: * “(It is possible) to draw a line between 2 points”* and “*All right angles are equal”*

Now the first 4 of these postulates are relatively uncontroversial in being assumed as true. The 5th however drew the attention of mathematicians for centuries – as they struggled in vain to *prove* it. It is:

*If a line crossing two other lines makes the interior angles on the same side less than two right angles, then these two lines will meet on that side when extended far enough. *

This might look a little complicated, but is made a little easier with the help of the sketch above. We have the line L crossing lines L1 and L2, and we have the angles A and B such that A + B is less than 180 degrees. Therefore we have the lines L1 and L2 intersecting. Lines which are not parallel will therefore intersect.

Euclid’s postulate can be restated in simpler (though not quite logically equivalent language) as:

*At most one line can be drawn through any point not on a given line parallel to the given line in a plane.*

In other words, if you have a given line (l) and a point (P), then there is only 1 line you can draw which is parallel to the given line and through the point (m).

Both of these versions do seem pretty self-evident, but equally there seems no reason why they should simply be assumed to be true. Surely they can actually be proved? Well, mathematicians spent the best part of 2000 years trying without success to do so.

**Why is the 5th postulate so important? **

Because Euclid’s proofs in *Elements *were deductive in nature, that means that if the 5th postulate was false, then all the subsequent “proofs” based on this assumption would have to be thrown out. Most mathematicians working on the problem did in fact believe it was true – but were keen to actually prove it.

As an example, the 5th postulate can be used to prove that the angles in a triangle add up to 180 degrees.

The sketch above shows that if A + B are less than 180 degrees the lines will intersect. Therefore because of symmetry (if one pair is more than 180 degrees, then other side will have a pair less than 180 degrees), a pair of parallel lines will have A + B = 180. This gives us:

This is the familiar diagram you learn at school – with alternate and corresponding angles. If we accept the diagram above as true, we can proceed with proving that the angles in a triangle add up to 180 degrees.

Once, we know that the two red angles are equal and the two green angles are equal, then we can use the fact that angles on a straight line add to 180 degrees to conclude that the angles in a triangle add to 180 degrees. But it needs the parallel postulate to be true!

In fact there are geometries in which the parallel postulate is not true – and so we can indeed have triangles whose angles don’t add to 180 degrees. More on this in the next post.

If you enjoyed this you might also like:

Non-Euclidean Geometry II – Attempts to Prove Euclid – The second part in the non-Euclidean Geometry series.

The Riemann Sphere – The Riemann Sphere is a way of mapping the entire complex plane onto the surface of a 3 dimensional sphere.

Circular Inversion – Reflecting in a Circle The hidden geometry of circular inversion allows us to begin to understand non-Euclidean geometry.

]]>**The Telephone Numbers – Graph Theory**

The telephone numbers are the following sequence:

1, 1, 2, 4, 10, 26, 76, 232, 764, 2620, 9496…

(where we start from n=0).

This pattern describes the total number of ways which a telephone exchange with n telephones can place a connection between pairs of people.

To illustrate this idea, the graph below is for n=4. This is when we have 10 telephones:

Each red line represents a connection. So the first diagram is for when we have no connections (this is counted in our sequence). The next five diagrams all show a single connection between a pair of phones. The last three diagrams show how we could have 2 pairs of telephones connected at the same time. Therefore the 4th telephone number is 10. These numbers get very large, very quickly.

**Finding a recursive formula**

The formula is given by the recursive relationship:

**T(n) = T(n-1) + (n-1)T(n-2)**

This means that to find (say) the 5th telephone number we do the following:

**T(5) = T(5-1) + (5-1)T(5-2)**

**T(5) = T(4) + (4)T(3)**

**T(5) = 10 + (4)4**

**T(5) = 26**

This is a quick way to work out the next term, as long as we have already calculated the previous terms.

**Finding an nth term formula
**

The telephone numbers can be calculated using the nth term formula:

This is going to be pretty hard to derive! I suppose the first step would start by working out the total number of connections possible between n phones – and this will be the the same as the graphs below:

These clearly follow the same pattern as the triangular numbers which is 0.5(n² +n) when we start with n = 1. We can also think of this as n choose 2 – because this gives us all the ways of linking 2 telephones from n possibilities. Therefore n choose 2 also generates the triangular numbers.

But then you would have to work out all the permutations which were allowed – not easy!

Anyway, as an example of how to use the formula to calculate the telephone numbers, say we wanted to find the 5th number:

We have n = 5. The summation will be from k = 0 and k = 2 (as 5/2 is not an integer).

Therefore T(5) = 5!/(2^{0}(5-0)!0!) + 5!/(2^{1}(5-2)!1!) + 5!/(2^{2}(5-4)!2!)

T(5) = 1 + 10 + 15 = 26.

**Finding telephone numbers through calculus**

Interestingly we can also find the telephone numbers by using the function:

y = e^{0.5x2+x}

and the nth telephone number (starting from n = 1) is given by the nth derivative when x = 0.

For example,

So when x = 0, the third derivative is 4. Therefore the 3rd telephone number is 4.

The fifth derivative of the function is:

So, when x =0 the fifth derivative is 26. Therefore the 5th telephone number is 26.

If you liked this post you might also like:

Fermat’s Theorem on the Sum of two Squares – A lesser known theorem from Fermat – but an excellent introduction to the idea of proof.

Unbelievable: 1+2+3+4…. = -1/12 ? A result that at first glance looks ridiculous – and yet can be shown to be correct. How?

]]>**Happy Numbers**

Happy numbers are defined by the rule that you start with any positive integer, square each of the digits then add them together. Now do the same with the new number. Happy numbers will eventually spiral down to a number of 1. Numbers that don’t eventually reach 1 are called unhappy numbers.

As an example, say we start with the number 23. Next we do 2²+3² = 13. Now, 1²+3² = 10. Now 1²+o² = 1. 23 is therefore a happy number.

There are many things to investigate. What are the happy numbers less than 100? Is there a rule which dictates which numbers are happy? Are there consecutive happy numbers? How about prime happy numbers? Can you find the infinite cycle of sadness?

Nrich has a discussion on some of the maths behind happy numbers. You can use an online tool to test if numbers are happy or sad.

Perfect numbers are numbers whose proper factors (factors excluding the number itself) add to the number. This is easier to see with an example.

6 is a perfect number because its proper factors are 1,2,3 and 1+2+3 = 6

8 is not a perfect number because its proper factors are 1,2,4 and 1+2+4 = 7

Perfect numbers have been known about for about 2000 years – however they are exceptionally rare. The first 4 perfect numbers are 6, 28, 496, 8128. These were all known to the Greeks. The next perfect number wasn’t discovered until around 1500 years later – and not surprisingly as it’s 33,550,336.

The next perfect numbers are:

8,589,869,056 (discovered by Italian mathematician Cataldi in 1588)

137,438,691,328 (also discovered by Cataldi)

2,305,843,008,139,952,128 (discovered by Euler in 1772).

and they keep getting bigger. The next number to be discovered has 37 digits are was discovered over 100 years later. Today, even with vast computational power, only a total of 48 perfect numbers are known. The largest has 34,850,340 digits.

There are a number of outstanding questions about perfect numbers. Are there an infinite number of perfect numbers? Is there any odd perfect number?

Euclid in around 300BC proved that that 2^{p−1}(2^{p}−1) is an even perfect number whenever 2^{p}−1 is prime. Euler (a rival with Euclid for one of the greatest mathematicians of all time), working on the same problem about 2000 years later went further and proved that this formula will provide *every* even perfect number.

This links perfect numbers with the search for Mersenne Primes – which are primes in the form 2^{p}−1. These are themselves very rare, but every new Mersenne Prime will also yield a new perfect number.

The first Mersenne Primes are

(2^{2}−1) = 3

(2^{3}−1) = 7

(2^{5}−1) = 31

(2^{7}−1) = 127

Therefore the first even perfect numbers are:

2^{1}(2^{2}−1) = 6

2^{2}(2^{3}−1) = 28

2^{4}(2^{5}−1) = 496

2^{6}(2^{7}−1) = 8128

**Friendly Numbers**

Friendly numbers are numbers which share a relationship with other numbers. They require the use of σ(a) which is called the divisor function and means the addition of all the factors of a. For example σ(7) = 1 + 7 = 8 and σ(10) = 1 +2 +5 + 10 = 18.

Friendly numbers therefore satisfy:

σ(a)/a = σ(b)/b

As an example (from Wikipedia)

σ(6) / 6 = (1+2+3+6) / 6 = 2,

σ(28) / 28 = (1+2+4+7+14+28) / 28 = 2

σ(496)/496 = (1+2+4+8+16+31+62+124+248+496)/496 = 2

Therefore 28 and 6 are friendly numbers because they share a common relationship. In fact all perfect numbers share the same common relationship of 2. This is because of the definition of perfect numbers above!

Numbers who share the same common relationship are said to be in the same club. For example, 30,140, 2480, 6200 and 40640 are all in the same club – because they all share the same common relationship 12/5.

(eg. σ(30) /30 = (1+2+3+5+6+10+15+30) / 30 = 12/5 )

Are some clubs of numbers infinitely big? Which clubs share common integer relationships? There are still a number of unsolved problems for friendly numbers.

**Solitary Numbers**

Solitary numbers are numbers which don’t share a common relationship with any other numbers. All primes, and prime powers are solitary.

Additionally all number that satisfy the following relationship:

HCF of σ(a) and a = 1.

are solitary. All this equation means is that the highest common factor (HCF) of σ(a) and a is 1. For example lets choose the number 9.

σ(9)= 1+3+9 = 13. The HCF of 9 and 13 = 1. So 9 is solitary.

However there are some numbers which are not prime, prime powers or satisfy HCF (σ(a) and a) = 1, but which are still solitary. These numbers are much harder to find! For example it is believed that the following numbers are solitary:

10, 14, 15, 20, 22, 26, 33, 34, 38, 44, 46, 51, 54, 58, 62, 68, 69, 70, 72, 74, 76, 82, 86, 87, 88, 90, 91, 92, 94, 95, 99

But no-one has been able to prove it so far. Maybe you can!

]]>**Give your university applications a headstart on other students with Coursera. **

Applying for university as an international student is incredibly competitive – for the top universities you’ll be competing with the best students from around the world, and so giving yourself a competitive advantage to make your university application stand out is really important. One way to do this is by completing a course run by some of the world’s top Universities.

**Universities offering courses:**

Examples of the top universities offering courses include: The University of Tokyo, Caltec, University of Manchester, Imperial College London, Duke, Stanford, Yale, University of Sydney, National University of Singapore, amongst many others, alongside major companies such as IBM, Google, Intel and Goldman Sachs.

**Courses on offer**

You can sign up for free and access modules run by these universities and companies, with the possibility of obtaining a certificate at the end of the course which can then go towards your university application.

Some of the courses on offer include:

Biological science courses such as Genetics and Evolution from Duke University, Understaning the brain from the University of Chicago, Astrobiology and the search for Extraterrestrial life from Edinburgh University and Medical Neuroscience from Duke University,

Business courses such as Business foundations from University of Pennsylvania, Digital Marketing from the University of Illinois, Viral Marketing and How to Create Contagious Content with the University of Pennsylvania, the Math Behind Moneyball with the University of Houston and studying the Global Financial Crisis with Yale University.

Physical science courses such as Welcome to Game Theory with Tokyo University, Science Literacy with Erasmus University Rotterdam and The Journey of the Universe with Yale University.

Arts and humanities courses such as Creative writing from Wesleyan University, Graphics design from Californian Institute of Arts, Music Production from Berklee College of Music, Introduction to Philosophy from the University of Edinburgh.

Overall there are over 3000 courses from 170 universities and partners – so almost certainly there’ll be something worth investigating. Have a look and give your University application a boost over everyone else!

]]>**Statistics to win penalty shoot-outs**

With the World Cup upon us again we can perhaps look forward to yet another heroic defeat on penalties by England. England are in fact the worst country of any of the major footballing nations at taking penalties, having won only 1 out of 7 shoot-outs at the Euros and World Cup. In fact of the 35 penalties taken in shoot-outs England have missed 12 – which is a miss rate of over 30%. Germany by comparison have won 5 out of 7 – and have a miss rate of only 15%.

With the stakes in penalty shoot-outs so high there have been a number of studies to look at optimum strategies for players.

**Shoot left when ahead
**

One study published in Psychological Science looked at all the penalties taken in penalty shoot-outs in the World Cup since 1982. What they found was pretty incredible – goalkeepers have a subconscious bias for diving to the right when their team is behind.

As is clear from the graphic, this is not a small bias towards the right, but a very strong one. When their team is behind the goalkeeper apparently favours his (likely) strong side 71% of the time. The strikers’ shot meanwhile continues to be placed either left or right with roughly the same likelihood as in the other situations. So, this built in bias makes the goalkeeper much less likely to help his team recover from a losing position in a shoot-out.

**Shoot high**

Analysis by Prozone looking at the data from the World Cups and European Championships between 1998 and 2010 compiled the following graphics:

The first graphic above shows the part of the goal that scoring penalties were aimed at. With most strikers aiming bottom left and bottom right it’s no surprise to see that these were the most successful areas.

The second graphic which shows where penalties were saved shows a more complete picture – goalkeepers made nearly all their saves low down. A striker who has the skill and control to lift the ball high makes it very unlikely that the goalkeeper will save his shot.

The last graphic also shows the risk involved in shooting high. This data shows where all the missed penalties (which were off-target) were being aimed. Unsurprisingly strikers who were aiming down the middle of the goal managed to hit the target! Interestingly strikers aiming for the right corner (as the goalkeeper stands) were far more likely to drag their shot off target than those aiming for the left side. Perhaps this is to do with them being predominantly right footed and the angle of their shooting arc?

**Win the toss and go first**

The Prozone data also showed the importance of winning the coin toss – 75% of the teams who went first went on to win. Equally, missing the first penalty is disastrous to a team’s chances – they went on to lose 81% of the time. The statistics also show a huge psychological role as well. Players who needed to score to keep their teams in the competition only scored a miserable 14% of the time. It would be interesting to see how these statistics are replicated over a larger data set.

**Don’t dive**

A different study which looked at 286 penalties from both domestic leagues and international competitions found that goalkeepers are actually best advised to stay in the centre of the goal rather than diving to one side. This had quite a significant affect on their ability to save the penalties – increasing the likelihood from around 13% to 33%. So, why don’t more goalkeepers stay still? Well, again this might come down to psychology – a diving save looks more dramatic and showcases the goalkeeper’s skill more than standing stationary in the centre.

**So, why do England always lose on penalties?**

There are some interesting psychological studies which suggest that England suffer more than other teams because English players are inhibited by their high public status (in other words, there is more pressure on them to perform – and hence that pressure is harder to deal with). One such study noted that the best penalty takers are the ones who compose themselves prior to the penalty. England’s players start to run to the ball only 0.2 seconds after the referee has blown – making them much less composed than other teams.

However, I think you can put too much analysis on psychology – the answer is probably simpler – that other teams beat England because they have technically better players. English footballing culture revolves much less around technical skill than elsewhere in Europe and South America – and when it comes to the penalty shoot-outs this has a dramatic effect.

As we can see from the statistics, players who are technically gifted enough to lift their shots into the top corners give the goalkeepers virtually no chance of saving them. England’s less technically gifted players have to rely on hitting it hard and low to the corner – which gives the goalkeeper a much higher percentage chance of saving them.

**Test yourself**

You can test your penalty taking skills with this online game from the Open University – choose which players are best suited to the pressure, decide what advice they need and aim your shot in the best position.

If you liked this post you might also like:

Championship Wages Predict League Position? A look at how statistics can predict where teams finish in the league.

Premier League Wages Predict League Positions? A similar analysis of Premier League teams.

]]>This carries on the previous investigation into Farey sequences, and is again based on the current Nrich task Ford Circles. Below are the Farey sequences for F_{2}, F_{3} and F_{4}. You can read about Farey sequences in the previous post.

This time I’m going to explore the link between Farey sequences and circles. First we need the general equation for a circle:

This has centre (p,q) and radius r. Therefore

**Circle 1:**

has centre:

and radius:

**Circle 2:**

has centre:

and radius:

Now we can plot these circles in Geogebra – and look for the values of a,b,c,d which lead to the circles touching at a point.

**When a = 1, b = 2, c = 2, d = 3:**

Do we notice anything about the numbers a/b and c/d ? a/b = 1/2 and c/d = 2/3 ? These are consecutive terms in the F_{3 }sequence. So do other consecutive terms in the Farey sequence also generate circles touching at a point?

**a = 1, b = 1, c = 2, d = 3**

Again we can see that the fractions 1/1 and 2/3 are consecutive terms in the F_{3 }sequence. So by drawing some more circle we can graphically represent all the fractions in the F_{3 }sequence:

So these four circles represent the four non-zero fractions of in the F_{3 }sequence!

and this is the visual representation of the non-zero fractions of in the F_{4 }sequence. Amazing!

**Modelling more Chaos**

This post was inspired by Rachel Thomas’ Nrich article on the same topic. I’ll carry on the investigation suggested in the article. We’re going to explore chaotic behavior – where small changes to initial conditions lead to widely different outcomes. Chaotic behavior is what makes modelling (say) weather patterns so complex.

**f(x) = sin(x)**

This time let’s do the same with f(x) = sin(x).

**Starting value of x = 0.2**

**Starting value of x = 0.2001**

**Both graphs superimposed **

This time the graphs do not show any chaotic behavior over the first 40 iterations – a small difference in initial condition has made a negligible difference to the output. Even after 200 iterations we get the 2 values x = 0.104488151 and x = 0.104502319.

**f(x) = tan(x)**

Now this time with f(x) = tan(x).

**Starting value of x = 0.2**

**Starting value of x = 0.2001**

**Both graphs superimposed **

This time both graphs remained largely the same up until around the 38th data point – with large divergence after that. Let’s see what would happen over the next 50 iterations:

Therefore we can see that tan(x) is much more susceptible to small initial state changes than sin(x). This makes sense by considering the graphs of tan(x) and sin(x). Sin(x) remains bounded between -1 and 1, whereas tan(x) is unbounded with asymptotic behaviour as we approach pi/2.

]]>This is a mini investigation based on the current Nrich task Farey Sequences.

As Nrich explains:

I’m going to look at Farey sequences (though I won’t worry about rearranging them in order of size). Here are some of the first Farey sequences. The missing fractions are all ones which simplify to a fraction already on the list (e.g. 2/4 is missing because this is the same as 1/2)

You should be able to notice that the next Farey sequence always contains the previous Farey sequence, so the problem becomes working out which of the new fractions added will not cancel down to something already on the list.

**Highest Common Factors**

Fractions will not cancel down (simplify) if the numerator and denominator have a highest common factor (HCF) of 1. For example 2/4 simplifies because the highest common factor of 2 and 4 is 2. Therefore both top and bottom can be divided by 2. 4/5 does not simplify because the HCF of 4 and 5 is 1.

We call 2 numbers which have a HCF of 1 **relatively prime.**

for example for the number 4: 1 and 3 are both relatively prime (HCF of 1 and 4 =1, HCF of 3 and 4 = 1).

**Relatively prime numbers**

2: 1

3: 1,2

4: 1,3

5: 1,2,3,4

6: 1,5

7: 1,2,3,4,5,6

8: 1,3,5,7

9: 1,2,4,5,7,8

You might notice that these give the required numerators for any given denominator – i.e when the denominator is 9, we want a numerator of 1,2,4,5,7,8.

**Euler totient function**

Euler’s totient function is a really useful function in number theory – which counts the number of relatively prime numbers a given number has. For example from our list we can see that 9 has 6 relatively prime numbers.

Euler’s totient function is defined above – it’s not as complicated as it looks! The strange symbol on the right hand side is the product formula – i.e we multiply terms together. It’s easiest to understand with some examples. To find Euler’s totient function we first work out the prime factors of a number. Say we have the number 8. The prime factors of 8 are 2^{3}. Therefore the only unique prime factor is 2.

Therefore the Euler totient function tells me to simply do 8 (1 – 1/2) = 4. This is how many relatively prime numbers 8 has.

Let’s look at another example – this time for the number 10. 10 has the prime factorisation 5 x 2. Therefore it has 2 unique primes, 2 and 5. Therefore the Euler totient function tells me to do 10(1-1/2)(1-1/5) = 4.

One more example, this time with the number 30. This has prime factorisation 2 x 3 x 5. This has unique prime factors 2,3,5 so I will do 30(1 -1/2)(1-1/3)(1-1/5) =8.

**An equation for the number of fractions in the Farey sequence**

Therefore I can now work out how many fractions will appear in a given Farey sequence. I notice that for (say) F_{5} I will add Euler’s totient for n = 2, n = 3, n = 4 and n = 5. I then add 2 to account for 0/1 and 1/1. Therefore I have:

For example to find F_{6}

There are lots of things to investigate about Farey functions – could you prove why all Farey sequences have an odd number of terms? You can also look at how well the Farey sequence is approximated by the following equation:

For example when n = 10 this gives:

and when n = 1000 this gives:

These results compare reasonably well as an estimation to the real answers of 33 and 304,193 respectively.

]]>

**Modelling Chaos**

This post was inspired by Rachel Thomas’ Nrich article on the same topic. I’ll carry on the investigation suggested in the article. We’re going to explore chaotic behavior – where small changes to initial conditions lead to widely different outcomes. Chaotic behavior is what makes modelling (say) weather patterns so complex.

Let’s start as in the article with the function:

**f(x) = 4x(1-x)**

We can then start an iterative process where we choose an initial value, calculate f(x) and then use this answer to calculate a new f(x) etc. For example when I choose x = 0.2, f(0.2) = 0.64. I then use this value to find a new value f(0.64) = 0.9216. I used a spreadsheet to plot 40 iterations for the starting values of x = 0.2 and x = 0.2001. This generated the following spreadsheet (cut to show the first 10 terms):

I then imported this table into Desmos to map how the change in the starting value from 0.2 to 0.2001 affected the resultant graph.

**Starting value of x = 0.2**

**Starting value of x = 0.2001**

**Both graphs superimposed **

We can see that for the first 10 terms the graphs are virtually the same – but then we get a wild divergence, before the graphs seem to synchronize more closely again. One thing we notice is that the data is bounded between 0 and 1. Can we prove why this is?

If we start with a value of x such that:

0<x<1.

then when we plot f(x) = 4x – 4x^{2} we can see that the graph has a maximum at x = 1/2:

.

Therefore any starting value of x between 0 and 1 will also return a new value bounded between 0 and 1. Starting values of x > 1 and x < -1 will tend to negative infinity because x^{2} grows much more rapidly than x.

**f(x) = ax(1-x)**

Let’s now explore what happens as we change the value of a whilst keeping our initial starting values of x = 0.2 and x = 0.2001

a = 0.8

both graphs are superimposed but are identical at the scale we are using. We can see that both values are attracted to 0 (we can say that 0 is an **attractor** for our system).

a = 1.2

Again both graphs are superimposed but are identical at the scale we are using. We can see that both values are attracted to 1/6 (we can say that 1/6 is an **attractor** for our system).

In general, for f(x) = ax(1-x) with -1≤x≤1, the attractors are given by x = 0 and x = 1 – 1/a, but it depends on the starting conditions as to whether we will end up being attracted to this point.

**f(x) = 0.8x(1-x)**

So, let’s look at f(x) = 0.8x(1-x) for different starting values 1≤x≤1. Our attractors are given by x = 0 and x = 1 – 1/0.8 = -0.25.

When our initial value is x = 0 we remain at the point x = 0.

When our initial value is x = -0.25 we remain at the point x = -0.25.

When our initial value is x < -0.25 we tend to negative infinity.

When our initial value is -0.25 < x ≤ 1 we tend towards x = 0.

**Starting value of x = -0.249999:**

Therefore we can say that x = 0 is a **stable attractor**, initial values close to x = 0 will still tend to 0.

However x = -0.25 is a **fixed point** rather than a stable attractor**, **as

x = -0.250001 will tend to infinity very rapidly,

x = -0.25 stays at x = -0.25.

x = -0.249999 will tend towards 0.

Therefore there is a stable equilibria at x = 0 and an unstable equilibria at x = -0.25.

]]>