I have a mystery function that passes through the points (0,1), (1,2), (2,4), (3,8) and (4,16). I also know the function is continuous and smooth. In other words, you can draw it in a single stroke without any sharp corners or cusps. At this point, you might think this function has to be f(x) = 2^x. But I wouldn’t be too sure of that.
Can you find a continuous, smooth function that passes through those five points, but is decreasing at x=2?
The snarky answer is of course, sure, of course I can, but if pressed I suppose I should have a good idea of how to actually do so. One way to do it is to find a polynomial p(x) (which makes it automatically smooth and continuous) which satisfies p(i)=2i for i=0,1,2,3,4 and such that p′(2)<0. For instance, to make things concrete we can have p′(2)=−1<0. In this case, since we have 6 equations, we should have a 5th degree polynomial p(x)=a0+a1x+a2x2+a3x3+a4x4+a5x5.
Translating the conditions into linear equations with respect to the coefficients a=(a0,…,a5)∈R6 we get the system of equations p(0)=a0+0a1+0a2+0a3+0a4+0a5=1p(1)=a0+a1+a2+a3+a4+a5=2p(2)=a0+2a1+4a2+8a3+16a4+32a5=4p(3)=a0+3a1+9a2+27a3+81a4+243a5=8p(4)=a0+4a1+16a2+64a3+256a4+1024a5=16p′(2)=0a0+a1+4a2+12a3+32a4+192a5=−1 Turning this into matrix form, let P=(10000011111112481632139278124314166425610240141232192) and q=(124816−1), then the coefficients can be determined by Pa=q. Since P is invertible, the coefficients of the polynomial satisfying the system of equations above are given by a=P−1q=(1−263121423−15794811312−1516), that is, equivalently, p(x)=1−26312x+1423x2−157948x3+11312x4−1516x5.
No comments:
Post a Comment