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) = 2^i$ for $i = 0, 1, 2, 3, 4$ and such that $p^\prime(2) \lt 0.$ For instance, to make things concrete we can have $p^\prime(2) = -1 \lt 0.$ In this case, since we have $6$ equations, we should have a $5$th degree polynomial $$p(x) = a_0 + a_1 x + a_2 x^2 + a_3 x^3 + a_4 x^4 + a_5 x^5.$$
Translating the conditions into linear equations with respect to the coefficients $a = (a_0, \dots, a_5) \in \mathbb{R}^6$ we get the system of equations \begin{align*} p(0) &= a_0 + 0 a_1 + 0 a_2 + 0 a_3 + 0 a_4 + 0 a_5 &= 1\\ p(1) &= a_0 + a_1 + a_2 + a_3 + a_4 + a_5 &= 2\\ p(2) &= a_0 + 2 a_1 + 4 a_2 + 8 a_3 + 16 a_4 + 32 a_5 &= 4\\ p(3) &= a_0 + 3 a_1 + 9 a_2 + 27 a_3 + 81 a_4 + 243 a_5 &= 8\\ p(4) &= a_0 + 4 a_1 + 16 a_2 + 64 a_3 + 256 a_4 + 1024 a_5 &= 16\\ p^\prime(2) &= 0 a_0 + a_1 + 4 a_2 + 12 a_3 + 32 a_4 + 192 a_5 &= -1\\ \end{align*} Turning this into matrix form, let $$P = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 2 & 4 & 8 & 16 & 32 \\ 1 & 3 & 9 & 27 & 81 & 243 \\ 1 & 4 & 16 & 64 & 256 & 1024 \\ 0 & 1 & 4 & 12 & 32 & 192 \end{pmatrix} \,\, \text{ and } \,\, q = \begin{pmatrix} 1 \\ 2 \\ 4 \\ 8 \\ 16 \\ -1\end{pmatrix},$$ 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^{-1} q = \begin{pmatrix} 1 \\ -\frac{263}{12} \\ \frac{142}{3} \\ -\frac{1579}{48} \\ \frac{113}{12} \\ -\frac{15}{16}\end{pmatrix},$$ that is, equivalently, $$p(x) = 1 -\frac{263}{12} x + \frac{142}{3} x^2 -\frac{1579}{48} x^3 + \frac{113}{12} x^4 -\frac{15}{16} x^5.$$
No comments:
Post a Comment