SplendidSnail wrote:
This has been bugging me a lot today for no good reason, and I feel like I should be able to figure this out, because the pattern is obvious.
When x = 0, y = 0
When x = 1, y = 50
When x = 2, y = 75
When x = 3, y = 87.5
I'm looking for an equation whereby by plugging in an arbitrary value for x, I can calculate y without having to first calculate all previous Y values leading up to it.
For what it's worth, given any such finite set of pairs of numbers with distinct x values, it is trivial to come up with a function that hits each pair exactly.
Since you used x and y above, I'll use w as my variable here:
f(w)=a*w^3+b*w^2+c*w+d.
SInce f(0)=0, d=0.
We then get a system of three linear equations in three unknowns:
f(1)=a+b+c=50
f(2)=8a+4b+2c=75
f(3)=27a+9b+3c=87.5
and solve for a, b, and c.
The problem is that you end up with a polynomial of degree 3 that meets the values for 0, 1, 2, 3 precisely, but anything else is all over the place.
I remember encountering this problem in high school. Without understand the consequences of using an nth degree polynomial, I used a chart of speeds through a quarter mile for a motorcycle from a motorcycle magazine and expected to get a simple equation that would show the speed at any time between the points as well. For example, the speed at 1.75 seconds. Once I got the equation and plotted it out (by hand -- no computers available in 1969 to do it) it quickly became obvious that the result was useless after all that work. It couldn't predict any speed at any time other than on those given initially.
So just giving a set of points on a curve and asking for the curve that meets those points is kind of useless. Of course, the latter explanation of where you are getting those numbers narrows down what you are looking for.