Sei sulla pagina 1di 3

COMP 360 - Winter 2008 Assignment 3 Solutions

Question 1
Dene the following variables. xKC = amount of duckwheat transported from Kansas to California. xM C = amount of duckwheat transported from Mexico to California. xKN = amount of duckwheat transported from Kansas to New York. xM N = amount of duckwheat transported from Mexico to New York. The linear program formulation of the problem is as follows. min 3xKC + xM C + 4xM N + 2xKN con1: con2: con3: con4: xKC + xKN 15 xM N + xM C 8 xKC + xM C 13 xKN + xM N 10 xKC , xM C , xM N , xKN 0 Using lpsolve, one can see that the optimum value is 43 and the dual solution is (0,-2,3,2). To prove that 43 is indeed the optimal value, we look at (2 con2) + (3 con3) + (2 con4) which is 0xM N + xM C + 3xKC + 2xKN 43. The objective function 3xKC + xM C + 4xM N + 2xKN is greater than or equal to the LHS and thus it has to be at least 43.

Question 2
We are given seven points, which we denote by (xi , yi ) for i = 1, 2, . . . , 7. We want to nd the line that minimize the maximum absolute error. So we dene a new variable z that represents this error. Therefore we want to minimize z . By denition, the maximum absolute error must be greater than or equal to the error at each point. So we have the following formulation of the problem. min z

s.t. |axi + byi c| z i {1, 2, . . . , 7} Observe that when z is minimized, it will be equal to |axi + byi c| for some i, i.e. it will indeed be the maximum absolute error. There is a slight problem with this formulation since the solution you would get for it would be a = 0, b = 0, c = 0. Of course this does not represent a line so you want to avoid this. A line ax + by = c can be represented in innitely many ways. Pick your favorite number d = 0. Then multiplying the equation by d would give dax + dby = dc, which is the same line as ax + by = c. So what is important is not the actual values of a, b and c but the relationship between them. By observation, we can see that the best line for our particular problem will not be a vertical line, i.e. we can assume b = 0. Thus the line ax + by = c is the same as (a/b)x + y = c/b. So in order to ensure that in our program we do not get the solution a = b = c = 0, we can simply set b to be 1. The value of z depends on the choice of a, b and c so is not really important. With these observations and the fact that |n| = max{n, n}, we get the following formulation of the problem. min s.t. z axi + byi c z b=1 Plug this into lpsolve and the answer will be y = 1.71429x + 1.85714. One can show the proof of optimality as in question 1. i {1, 2, . . . , 7} (axi + byi c) z i {1, 2, . . . , 7}

Question 3
See the vineyard example in Fukudas notes. This is very similar to part b. 2

Question 4
The system has no non-negative solution. Suppose there was. Add inequalities 1, 2 and 4. This gives us 3x1 + x3 + 6x4 1. So the solution must also satisfy this inequality. But since the solution is non-negative, the LHS of the inequality would be non-negative and therefore cannot be less than or equal to -1.

Potrebbero piacerti anche