Article 6MRWV Approximation by prime powers

Approximation by prime powers

by
John
from John D. Cook on (#6MRWV)

The well-known Weierstrass approximation theorem says that polynomials are dense in C[0, 1]. That is, given any continuous function f on the unit interval, and any > 0, you can find a polynomial P such that f and P are never more than apart.

This means that linear combinations of the polynomials

1, x, x^2, x^3, ...

are dense in C[0, 1].

Do you need all these powers of x? Could you approximate any continuous function arbitrarily well if you left out one of these powers, say x7? Yes, you could.

You cannot omit the constant polynomial 1, but you can leave out any other power of x. In fact, you can leave out a lot of powers of x, as long as the sequence of exponents doesn't thin out too quickly.

Muntz approximation theorem

Herman Muntz proved in 1914 that a necessary and sufficient pair of conditions on the exponents of x is that the first exponent is 0 and that the sum of the reciprocals of the exponents diverges.

In other words, the sequence of powers of x

x0, x1, x2, ...

with

0 < 1 < 2

is dense in C [0, 1] if and only if 0 = 0 and

1/1 + 1/2 + 1/3 + ... =

Prime power example

Euler proved in 1737 that the sum of the reciprocals of the primes diverges, so the sequence

1, x2, x3, x5, x7, x11, ...

is dense in C [0, 1]. We can find a polynomial as close as we like to any particular continuous function if we combine enough prime powers.

Let's see how well we can approximate |x - | using prime exponents up to 11.

prime_power_fit.png

The polynomial above is

0.4605 - 5.233 x2 + 7.211 x3 + 0.9295 x5 - 4.4646 x7 + 1.614 x11.

This polynomial is not the best possible uniform approximation: it's the least squares approximation. That is, it minimizes the 2-norm and not the -norm. That's because it's convenient to do a least squares fit in Python using scipy.optimize.curve_fit.

Incidentally, the Muntz approximation theorem holds for the 2-norm as well.

Related postsThe post Approximation by prime powers first appeared on John D. Cook.
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments