thomas49th said:
Thanks for the help,
But I'm not making the mental link
So far I know we can write |a-2b| as 2 inequalities
y ≥ a-2b and y ≥ 2b - a
But I don't see how the equation
yp - yn = a - 2b
comes about, nor why we then go onto maximise yp+yn
Thanks
Thomas
Well, alright. You have already solved the problem one way, so I guess it is OK to supply the details of another way without violating the Forum rules.
The above is just the familiar splitting up of a number into positive and negative parts, then expressing the absolute value as the sum of the parts.
Look at min (p + n), subject to p-n = X, p,n >= 0. If X > 0, one feasible solution is (p,n) = (X,0); another feasible solution is (p,n) = (X+1,1), another is (p,n) = (X+2,2), ... and in general, a feasible solution is (p,n) = (X+t,t) for any t >= 0. However, among all these feasible solutions, the unique one that minimizes the sum p + n is (p,n) = (X,0). Next, suppose X < 0. One feasible solution is (p,n) = (0,-X) (noting that -X = |X| > 0); another is (p,n) = (1,-X+1), another is (p,n) = (2,-X+2), ... . Among these, the unique one that minimizes p+n is (p,n) = (0,-X) = (0,|X|), giving p+n = |X|. So, for the problem min (p+n), st p-n = X, p,n >= 0, we have
(p+n)
min = |X|.
Of course, using min z, s.t. z >= X and z >= -X is another way. One way has fewer variables and more constraints, the other has more variables and fewer constraints. Each method has advantages in certain contexts.
RGV