stuck with a little problem

hokken

New member
Joined
Mar 30, 2014
Messages
4
I am stuck with a little problem:

Based on the following
If X=25 then Y=15
if X=100 then Y = 170

What would be the equation to find the Y value based on any given X ?

Thank you
 
I am stuck with a little problem:

Based on the following
If X=25 then Y=15
if X=100 then Y = 170

What would be the equation to find the Y value based on any given X ?

Thank you

One of the ways to approach this would be:

linear interpolation.

Have you discussed this topic in the class?

Do you know that the equation of a straight-line between (x1, y1) and (x2,y2) is:

\(\displaystyle \dfrac{y - y_1}{y_2 - y_1} \ = \ \dfrac{x - x_1}{x_2 - x_1}\)
 
Thank you for your answer Subhotosh Khan, I am trying to sort out a little programming issue, I am 45 and can't remember learning anything about linear interpolation but I am quick learner :) what would be the exact equation please ? much appreciated.
 
I looked for linear interpolation on google and found the following equation that seems to work well: Y = ( ( X - X1 )( Y2 - Y1) / ( X2 - X1) ) + Y1
 
I looked for linear interpolation on google and found the following equation that seems to work well: Y = ( ( X - X1 )( Y2 - Y1) / ( X2 - X1) ) + Y1

You got the right one....
 
seems to work well: Y = (X - X1) (Y2 - Y1) / (X2 - X1) + Y1

Hi hokken,

Yes, this is the result of solving the equation posted by Subhotosh for Y.

That is, multiplying each side by (Y2-Y1), followed by adding Y1 to each side.

Cheers! :)
 
I think we should point out that just knowing two values for a function- that is, the value of y= f(x) for two values of x, tells us NOTHING certain about the value of the function for other values of x. The simplest thing we can do is assume the graph of the function is a straight line through those points. Given any two points there exist a unique straight line through them. That is what people here did. But there is no guarantee that this assumption is true.
 
Top