mscroggs.co.uk
mscroggs.co.uk

subscribe

Blog

Archive

Show me a random blog post
 2019 
 2018 
 2017 
 2016 
 2015 
 2014 
 2013 
 2012 

Tags

machine learning golden ratio folding paper craft sound fractals dataset sorting curvature captain scarlet binary manchester science festival coins aperiodical big internet math-off christmas stickers draughts national lottery news wool nine men's morris rugby hats dragon curves the aperiodical video games go dates chalkdust magazine polynomials cross stitch sport pythagoras game of life statistics golden spiral twitter final fantasy pizza cutting gerry anderson mathsteroids tennis football latex bubble bobble royal baby london radio 4 bodmas books countdown game show probability frobel propositional calculus puzzles platonic solids european cup london underground people maths trigonometry reddit harriss spiral weather station programming menace chess speed interpolation arithmetic estimation a gamut of games games hexapawn flexagons python ternary graph theory php geometry data map projections approximation braiding world cup rhombicuboctahedron light javascript folding tube maps reuleaux polygons pac-man matt parker christmas card oeis noughts and crosses plastic ratio misleading statistics logic error bars mathslogicbot asteroids palindromes electromagnetic field martin gardner manchester accuracy realhats inline code raspberry pi triangles chebyshev probability

Archive

Show me a random blog post
▼ show ▼
 2018-09-13 

Runge's Phenomenon

This is a post I wrote for round 2 of The Aperiodical's Big Internet Math-Off 2018. As I went out in round 1 of the Big Math-Off, you got to read about the real projective plane instead of this.
Polynomials are very nice functions: they're easy to integrate and differentiate, it's quick to calculate their value at points, and they're generally friendly to deal with. Because of this, it can often be useful to find a polynomial that closely approximates a more complicated function.
Imagine a function defined for \(x\) between -1 and 1. Pick \(n-1\) points that lie on the function. There is a unique degree \(n\) polynomial (a polynomial whose highest power of \(x\) is \(x^n\)) that passes through these points. This polynomial is called an interpolating polynomial, and it sounds like it ought to be a pretty good approximation of the function.
So let's try taking points on a function at equally spaces values of \(x\), and try to approximate the function:
$$f(x)=\frac1{1+25x^2}$$
Polynomial interpolations of \(\displaystyle f(x)=\frac1{1+25x^2}\) using equally spaces points
I'm sure you'll agree that these approximations are pretty terrible, and they get worse as more points are added. The high error towards 1 and -1 is called Runge's phenomenon, and was discovered in 1901 by Carl David Tolmé Runge.
All hope of finding a good polynomial approximation is not lost, however: by choosing the points more carefully, it's possible to avoid Runge's phenomenon. Chebyshev points (named after Pafnuty Chebyshev) are defined by taking the \(x\) co-ordinate of equally spaced points on a circle.
Eight Chebyshev points
The following GIF shows interpolating polynomials of the same function as before using Chebyshev points.
Nice, we've found a polynomial that closely approximates the function... But I guess you're now wondering how well the Chebyshev interpolation will approximate other functions. To find out, let's try it out on the votes over time of my first round Big Internet Math-Off match.
Scroggs vs Parker, 6-8 July 2018
The graphs below show the results of the match over time interpolated using 16 uniform points (left) and 16 Chebyshev points (right). You can see that the uniform interpolation is all over the place, but the Chebyshev interpolation is very close the the actual results.
Scroggs vs Parker, 6-8 July 2018, approximated using uniform points (left) and Chebyshev points (right)
But maybe you still want to see how good Chebyshev interpolation is for a function of your choice... To help you find out, I've written @RungeBot, a Twitter bot that can compare interpolations with equispaced and Chebyshev points. Just tweet it a function, and it'll show you how bad Runge's phenomenon is for that function, and how much better Chebysheb points are.
A list of constants and functions that RungeBot understands can be found here.

Similar posts

Mathsteroids
realhats
Harriss and other spirals
Christmas (2018) is over

Comments

Comments in green were written by me. Comments in blue were not written by me.
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

Allowed HTML tags: <br> <a> <small> <b> <i> <s> <sup> <sub> <u> <spoiler> <ul> <ol> <li>
To prove you are not a spam bot, please type "quotient" in the box below (case sensitive):
© Matthew Scroggs 2019