Need help with relatively simple linear programming: minimizing differences

m2017

New member
Joined
Jun 14, 2017
Messages
11
(x1, y1) = (1, 1), (x2, y2) = (3, 2), (x1, y1) = (4, 3)

Suppose that we want to determine a straight line with equation

. . . . .\(\displaystyle y\, =\, f(x)\, =\, ax\, +\, b\)

such that

. . . . .\(\displaystyle c\, =\, \mbox{max}\left\{|f(x_1)\, -\, y_1|,\, |f(x_2)\, -\, y_2|,\, |f(x_3)\, -\, y_3|\right\}\)

is as small as possible. Write down a linear programming model for determining the coefficients a and b.




It seems that question is asking for me to form a straight line that has the smallest gradient? But I kinda doubt this because we wouldn't need linear programming to do that, just a simple gradient calculator could do that.

So far all I can do is substitute each of the 3 coordinates to obtain

a+b=1
3a+b=2
4a+b=3

But this doesn't seem to make much sense.
 

Attachments

  • q1.jpg
    q1.jpg
    17.4 KB · Views: 3
Last edited by a moderator:
(x1, y1) = (1, 1), (x2, y2) = (3, 2), (x1, y1) = (4, 3)

Suppose that we want to determine a straight line with equation

. . . . .\(\displaystyle y\, =\, f(x)\, =\, ax\, +\, b\)

such that

. . . . .\(\displaystyle c\, =\, \mbox{max}\left\{|f(x_1)\, -\, y_1|,\, |f(x_2)\, -\, y_2|,\, |f(x_3)\, -\, y_3|\right\}\)

is as small as possible. Write down a linear programming model for determining the coefficients a and b.




It seems that question is asking for me to form a straight line that has the smallest gradient? But I kinda doubt this because we wouldn't need linear programming to do that, just a simple gradient calculator could do that.
How are you seeing slope (that is, gradient) coming into play?

This exercise is asking you to find the equation of the line f(x) that minimizes the distance between the actual points and the modelling line f(x). You're not finding a straight line through the points; you're finding a line close to the points, such that the largest (vertical) distance between the y-coordinates of the actual points and the y-coordinates of the line's points is as small as possible.

Since you're looking for "smaller than" or "no bigger than", this suggests inequalities, which may relate to a linear programming model.
 
I have spent time thinking about it but still stuck. I know statistics has something called a line of best fit in which the average distance between the points and the line is minimised. But this isn't asking for an average, so I'm still confused.
 
I have spent time thinking about it but still stuck. I know statistics has something called a line of best fit in which the average distance between the points and the line is minimised. But this isn't asking for an average, so I'm still confused.
Yes, the exercise does not ask you for a best-line-of-fit average-minimizing process. It is asking for an absolute minimum of differences. Isn't "linear optimization" all about setting up systems of inequalities in order to minimize things? So can't you get started by creating the three listed minimizations? ;)
 
Top