Dave's Free Press: Journal

violence, pornography, and rude words for the web generation


Recent posts


Recently commented posts


Journals what I read

geeky politics rant silly religion meta music perl weird drinking culture london language transport sport olympics hacking media maths web photography etiquette spam amazon film bastards books bryar holidays palm telecoms cars travel yapc bbc clothes rsnapshot phone whisky security home radio lolcats deafness environment curry art work privacy iphone linux unix go business engineering kindle gps economics latin anglo-saxon money bramble cars environment electronics
Fri, 25 Sep 2009

Combining functions

There was a great programme on Radio 4 yesterday about Newton and Leibnitz. I'm not sure why, but it inspired me to consider the curve that is constructed from y = x2 when x <= 0, and y = x when x > 0 . I want to reduce that to a single function.

It can obviously be done.

Consider that to fit a curve to any* three points, you can do it with a curve y = a + bx + cx2. Figuring out the three constants a, b and c is trivial, you just solve three simultaneous equations. Similarly, for four points, you fit y = a + bx + cx2 + dx3, and so on. To accurately fit the curve I described at the beginning, you need an infinite number of points, thus an infinite number of constants.

I'm sure that this can be done - obviously you can't actually calculate an infinite number of constants, but I'm sure that with a bit of integration it could be done. And it can be done for any such pair of functions which meet at a point. However, on further reflection I'm not entirely convinced that it can be done in the general case - you have that pesky discontinuous yes/no conditional in the middle: "is x <= n?".

* not strictly true - consider (0,0), (0,1), (1,0).

Posted at 00:54 by David Cantrell
keywords: geeky | maths
Permalink | 3 Comments

It's a bit early in the morning to be discussing maths, so I'll just ask whether by 'curve' or 'function' you mean 'polynomial'. There's a big difference!

Posted by Chunter on Fri, 25 Sep 2009 at 04:05:45

You already have a single function. It's perfectly valid to define a function with different polynomials which apply to different ranges of the function's domain. See http://en.wikipedia.org/wiki/Piecewise_function for the standard notation etc.

A function is just a mapping from one set (the domain), to another (the image, which can be the same set). How you define such a function is pretty much up to you, so long as a reader can understand it.

Posted by Piers Cawley on Fri, 25 Sep 2009 at 07:28:24

I'm not sure it can be done, actually. It certainly can't be done for the join of two continuous functions in general, even if it's smooth everywhere.

The "infinite polynomial" you're looking for is called a power series, and a real function represented by a power series is called "analytic". Sadly not all nice functions are analytic, including ones quite like the one you mention; see, for example, http://en.wikipedia.org/wiki/Non-analytic_smooth_function

(Actually, the definition of analyticity is slightly stronger than I've suggested, but I'm almost sure that everything hangs together. Not really my field, though.)

I think the flaw in your reasoning is that your infinite number of constants is a countable infinitiy, and your infinite number of points is of course uncountable.

Posted by Dr Rick on Sat, 10 Oct 2009 at 17:20:52

Sorry, this post is too old for you to comment on it.