Make an equation satisfying the data given

34 Views Asked by At

\begin{array}{c|lcr} x & y\\ \hline 1 & 20\\ 2 & 16\\ 3 & 13\\ 4 & 11\\ 5 & 10 \end{array}

How do you start a solution when you have these type of problem? I was used to given an equation but not like all just numbers. It was state that the answer is $y=\frac{1}{2}x^2$ -$\frac{11}{2}x$ $+25$ how do you even generate that?

2

There are 2 best solutions below

0
On

We can use a Least Squares fit and will use the example on page $3$ of these notes as a guide. We setup the system of equations to fit a parabola $a x^2 + b x + c$ as

$$\begin {align} a(1)^2 + b(1) + c &= 20 \\ a(2)^2 + b(2) + c &= 16 \\ a(3)^2 + b(3) + c &= 13 \\ a(4)^2 + b(4) + c &= 11 \\ a(5)^2 + b(5) + c &= 10 \\ \end {align}$$

This gives us

$$A = \begin{bmatrix} 1 & 1 & 1 \\ 4 & 2 & 1 \\ 9 & 3 & 1 \\ 16 & 4 & 1 \\ 25 & 5 & 1 \end{bmatrix}, ~~b = \begin{bmatrix} 20 \\ 16 \\ 13 \\ 11 \\ 10 \end{bmatrix}$$

Using Least Squares, we have

$$\begin{bmatrix} a \\ b \\ c \end{bmatrix}= (A^T A)^{-1} A^T ~ b = \begin{bmatrix}~~~\dfrac{1}{2} \\ -\dfrac{11}{2} \\ ~~~25 \end{bmatrix}$$

So, the final result is

$$y = \dfrac{1}{2}x^2 -\dfrac{11}{2}x + 25$$

If the theory is not clear, you can refer to these notes and look at another example starting on page $5$.

0
On

Since you have found out that it's a parabola (even if you've only guessed). Let $f(x)=ax^2+bx+c$. Then, any $3$ points not all colinear will determine a unique parabola. So, try some of the points and you'll be able to solve for $a,b,c$. If the $6$ points don't all satisfy the equation, then it won't actually be a parabola: \begin{align*} f(1)=20=a+b+c\\ f(2)=16=4a+2b+c\\ f(3)=13=9a+3b+c \end{align*} So, we need to solve this system of equations. You can do this with just algebra or matrix row operations, etc. Eventually, you should get $a=\frac{1}{2}$ and $b=-\frac{11}{2}$ and $c=25$ so that $f(x)=\frac{1}{2}x^2-\frac{11}{2}x+25$. To see if this is the actual curve wanted, test all of the other points given (they do in this case).