Solve Equation f for (0,80) (2,64) (4,54) (6,48) (8,44)

  • Thread starter Thread starter autodidude
  • Start date Start date
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
22 replies · 4K views
autodidude
Messages
332
Reaction score
0

Homework Statement


Find the equation for (0, 80) (2, 64) (4, 54) (6, 48) (8,44)


Homework Equations





The Attempt at a Solution



I used the finite differences method and the stepped cell equations:

a0 = 80
a1 + a2 + a3 = -16
2a2 + 6a3 = 6
6a3 = -2

y = -(1/3)x^3 - 2x^2 - 13(2/3)x + 80


The answer I get from plugging in x into the equation is always off by 10. The finite differences/stepped cell equations is the only method presented in my book (other than using a graphics calculator). Also, how would you find y given x?
 
Physics news on Phys.org
autodidude said:

Homework Statement


Find the equation for (0, 80) (2, 64) (4, 54) (6, 48) (8,44)


Homework Equations





The Attempt at a Solution



I used the finite differences method and the stepped cell equations:

a0 = 80
a1 + a2 + a3 = -16
2a2 + 6a3 = 6
6a3 = -2

y = -(1/3)x^3 - 2x^2 - 13(2/3)x + 80


The answer I get from plugging in x into the equation is always off by 10. The finite differences/stepped cell equations is the only method presented in my book (other than using a graphics calculator). Also, how would you find y given x?
Since you have 5 data points your general polynomial fit will be of degree 4; that is, it will be of the form y = a + b*x + c*x^2 + d*x^3 + e*x^4. This has 5 unknown parameters a,b,c,d,e to match with the 5 data items.

RGV
 
Ray Vickson said:
Since you have 5 data points your general polynomial fit will be of degree 4; that is, it will be of the form y = a + b*x + c*x^2 + d*x^3 + e*x^4. This has 5 unknown parameters a,b,c,d,e to match with the 5 data items.

But the finite differences method is used to reduce the degree of the polynomial, I thought. Using this method results in a cubic, meaning that you only need to solve a 4x4 system. But since one of the data points is the y-intercept, that reduces the system further into a 3x3. Much easier than a 5x5.

@autodidude: I don't know what you mean by "stepped cell equations," but it looks like to me a variation of the triangular form. Assuming that this is the case, then I'm not getting what you have. This is what I get:

8a3 + 4a2 + 2a1 = -16
48a3 + 8a2 = 6
48a3 = -2
 
Last edited:
^ Yeah I looked it up and couldn't find it anywhere else

That's what I got too, but then you use that information to find a0, a1, a2, and a3 where a0 is the constant, a1 is the first degree variable etc.
 
eumyang said:
But the finite differences method is used to reduce the degree of the polynomial, I thought. Using this method results in a cubic, meaning that you only need to solve a 4x4 system. But since one of the data points is the y-intercept, that reduces the system further into a 3x3. Much easier than a 5x5.

@autodidude: I don't know what you mean by "stepped cell equations," but it looks like to me a variation of the triangular form. Assuming that this is the case, then I'm not getting what you have. This is what I get:

8a3 + 4a2 + 2a1 = -16
483 + 8a2 = 6
483 = -2

The Lagrange interpolation method (or direct fitting of f(0), f(2),... to the data, by solving the equations for the coefficients) results in a cubic, but ACCIDENTALLY; that is, the coefficient e of x^4 just happens to be zero. If we changed one item of data---for example, to f(8) = 45 instead of f(8) = 44---we would get a true 4th degree polynomial: we would have f = 80-239/24*x+107/96*x^2-7/96*x^3+1/384*x^4 in that case (courtesy of Maple).

RGV
 
autodidude said:
^ Lagrange interpolation?
Google is your friend.

RGV
 
What level math is numerical analysis? High school? First year college?
 
autodidude said:
What level math is numerical analysis? High school? First year college?

no no no

Numerical analysis generally isn't introduced until you get into junior/senior year of college (at least that's how it is where I went).
 
^ Ah ok...

Are there any other methods for finding the equation (high school level)? I'm still not sure why the finite differences/stepped cell eq. didn't work
 
autodidude said:
^ Ah ok...

Are there any other methods for finding the equation (high school level)? I'm still not sure why the finite differences/stepped cell eq. didn't work

The finite differences/stepped cell equations worked for me. You originally wrote that you got these:
a0 = 80
a1 + a2 + a3 = -16
2a2 + 6a3 = 6
6a3 = -2

While I said that those were wrong. Show us how you got the equations above, because I got these:
a0 = 80
8a3 + 4a2 + 2a1 = -16
48a3 + 8a2 = 6
48a3 = -2
 
a0 = 80
a1 + a2 + a3 = -16
2a2 + 6a3
6a3 = -2

a3/6 = -2/6
a3 = -1/3

2a2 + - 2 = 6
2a2 = 8
a2 = 4

a1 + 4 + -1/3 = -16
a1 = -20 + 1/3
a1 = 19.66666667

-1/3x^3 + 4x^2 - 19.66666667x + 80

I just realized the equation in the original post is wrong, it's ^. But that's the one that's off by 10
 
No, no, I'm asking how you got these equations:
a0 = 80
a1 + a2 + a3 = -16
2a2 + 6a3
6a3 = -2

... not the work to find a0, a1, a2 & a3. Because I think the equations above are wrong from the start.
 
eumyang said:
No, no, I'm asking how you got these equations:
a0 = 80
a1 + a2 + a3 = -16
2a2 + 6a3
6a3 = -2

... not the work to find a0, a1, a2 & a3. Because I think the equations above are wrong from the start.
The correct equations, in detail, are (courtesy of Maple 9.5):
a0=80
a1 + a2 + a3 + a4 = -16
2a2 + 6a3 + 14a4 = 6
6a3 + 36a4 = -2
24a4 = 0.

So, putting a4 = 0 gives the equations that you say are incorrect.

RGV
 
Ray Vickson said:
The correct equations, in detail, are (courtesy of Maple 9.5):
a0=80
a1 + a2 + a3 + a4 = -16
2a2 + 6a3 + 14a4 = 6
6a3 + 36a4 = -2
24a4 = 0.

So, putting a4 = 0 gives the equations that you say are incorrect.

I have to admit, I'm still not sure what "stepped cell equations" mean. I took a guess and thought that it is similar to the triangular form. If you use the equations I came up with:
a0 = 80
8a3 + 4a2 + 2a1 = -16
48a3 + 8a2 = 6
48a3 = -2

... you'll come up with a cubic:
[tex]y = -\frac{1}{24}x^3 + x^2 - \frac{59}{6}x + 80[/tex]
... the curve of which fits the original data points. This cubic also matches the "CubicReg" function I used on the TI-84.
 
eumyang said:
No, no, I'm asking how you got these equations:
a0 = 80
a1 + a2 + a3 = -16
2a2 + 6a3
6a3 = -2

... not the work to find a0, a1, a2 & a3. Because I think the equations above are wrong from the start.

Oh my bad. They were given in the example in the book

EDIT: How did you come up with those equations?
 
Last edited:
I used the first 4 points of (0, 80) (2, 64) (4, 54) (6, 48) (8,44) at the start:

Eq1: a3(0)^3 + a2(0)^2 + a1(0) + a0 = 80
Eq2: a3(2)^3 + a2(2)^2 + a1(2) + a0 = 64
Eq3: a3(4)^3 + a2(4)^2 + a1(4) + a0 = 54
Eq4: a3(6)^3 + a2(6)^2 + a1(6) + a0 = 48

... OR:
Eq1: a0 = 80
Eq2: 8a3 + 4a2 + 2a1 + a0 = 64
Eq3: 64a3 + 16a2 + 4a1 + a0 = 54
Eq4: 216a3 + 36a2 + 6a1 + a0 = 48

Then I used linear combinations to eliminate the a0 variable in Eq2, a0 & a1 in Eq3, and a0, a1 & a2 in Eq4. To start, if you perform this operation:
-1*Eq1 + Eq2 -> Eq2
(Multiply Eq1 by negative 1, add it to Eq2 to make the new Eq 2), then you get
Eq1: a0 = 80
Eq2: 8a3 + 4a2 + 2a1 = -16
Eq3: 64a3 + 16a2 + 4a1 + a0 = 54
Eq4: 216a3 + 36a2 + 6a1 + a0 = 48

I'll leave it for you to figure out the rest, but eventually, you'll get
Eq1: a0 = 80
Eq2: 8a3 + 4a2 + 2a1 = -16
Eq3: 48a3 + 8a2 = 6
Eq4: 48a3 = -2
 
You also use rref on a graphing calculator to solve the system of equations:smile:
 
eumyang said:
I used the first 4 points of (0, 80) (2, 64) (4, 54) (6, 48) (8,44) at the start:

Eq1: a3(0)^3 + a2(0)^2 + a1(0) + a0 = 80
Eq2: a3(2)^3 + a2(2)^2 + a1(2) + a0 = 64
Eq3: a3(4)^3 + a2(4)^2 + a1(4) + a0 = 54
Eq4: a3(6)^3 + a2(6)^2 + a1(6) + a0 = 48

... OR:
Eq1: a0 = 80
Eq2: 8a3 + 4a2 + 2a1 + a0 = 64
Eq3: 64a3 + 16a2 + 4a1 + a0 = 54
Eq4: 216a3 + 36a2 + 6a1 + a0 = 48

Then I used linear combinations to eliminate the a0 variable in Eq2, a0 & a1 in Eq3, and a0, a1 & a2 in Eq4. To start, if you perform this operation:
-1*Eq1 + Eq2 -> Eq2
(Multiply Eq1 by negative 1, add it to Eq2 to make the new Eq 2), then you get
Eq1: a0 = 80
Eq2: 8a3 + 4a2 + 2a1 = -16
Eq3: 64a3 + 16a2 + 4a1 + a0 = 54
Eq4: 216a3 + 36a2 + 6a1 + a0 = 48

I'll leave it for you to figure out the rest, but eventually, you'll get
Eq1: a0 = 80
Eq2: 8a3 + 4a2 + 2a1 = -16
Eq3: 48a3 + 8a2 = 6
Eq4: 48a3 = -2

Thanks, I'm going to save this page and try to make sense of it when I get home. Again, what level math is this (? Should be able to solve solving this without a graphics calculator be expected at a high school level? (Yr 11)
 
autodidude said:
Thanks, I'm going to save this page and try to make sense of it when I get home. Again, what level math is this (? Should be able to solve solving this without a graphics calculator be expected at a high school level? (Yr 11)

In Precalculus, I've taught the concept of putting a system of equations into what I call triangular form (it looks like triangular form = stepped cell equations?). In my school (this is high school in the US) Precalculus students are mostly in gr. 11-12 (though this school I have 3 students in gr. 10).
 
eumyang said:
In Precalculus, I've taught the concept of putting a system of equations into what I call triangular form (it looks like triangular form = stepped cell equations?). In my school (this is high school in the US) Precalculus students are mostly in gr. 11-12 (though this school I have 3 students in gr. 10).

:bugeye: At our school, we learn/teach Precalculus at 10 grade (for accelerated, not especially smart). Anyways, triangular form/stepped cell equations are Gaussian Elimination? Is it not?
 
Yes, that is Gaussian elimination.

The year that students take "pre-calculus" varies. (To me, pre-calculus = college algebra + trigonometry + analytic geometry + ...) I teach at a private high school, and in our school, in other private schools in the area, and in the local county public school system, the "normal," "college prep" math sequence is
Gr. 9: Algebra 1
Gr. 10: Geometry
Gr. 11: Algebra 2
Gr. 12: Precalculus

Students in honors/accelerated tracks can, of course, take Algebra 1 earlier, allowing them to reach Calculus.
 
eumyang said:
Yes, that is Gaussian elimination.

The year that students take "pre-calculus" varies. (To me, pre-calculus = college algebra + trigonometry + analytic geometry + ...) I teach at a private high school, and in our school, in other private schools in the area, and in the local county public school system, the "normal," "college prep" math sequence is
Gr. 9: Algebra 1
Gr. 10: Geometry
Gr. 11: Algebra 2
Gr. 12: Precalculus

Students in honors/accelerated tracks can, of course, take Algebra 1 earlier, allowing them to reach Calculus.

Same with our school, but this is the most basic math path. For our accelrated math students:

Gr. 9 Geometry
Gr. 10 Precalculus
Gr. 11 AP Calc AB
Gr. 12 AP Calc BC