A computer science problem by Christian Daang

Maximize z = 2 x 1 4 x 2 + 5 x 3 6 x 4 z = 2x_{1} - 4x_{2} + 5x_{3} - 6x_{4} given the following conditions: { x 1 + 4 x 2 2 x 3 + 8 x 4 2 x 1 + 2 x 2 + 3 x 3 + 4 x 4 1 x 1 , x 2 , x 3 , x 4 0 \begin{cases} x_{1} + 4x_{2} - 2x_{3} + 8x_{4} \le 2 \\ -x_{1} + 2x_{2} + 3x_{3} + 4x_{4} \le 1 \\ x_{1}, x_{2}, x_{3}, x_{4} \ge 0 \end{cases} .


The answer is 31.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Christian Daang
Nov 20, 2016

Standard form of z: 2 x 1 + 4 x 2 5 x 3 + 6 x 4 = 0 -2x_{1} + 4x_{2} - 5x_{3} + 6x_{4} = 0

Standard form of conditions: { x 1 + 4 x 2 2 x 3 + 8 x 4 + x 5 = 2 x 1 + 2 x 2 + 3 x 3 + 4 x 4 + x 6 = 1 \begin{cases} x_{1} + 4x_{2} - 2x_{3} + 8x_{4} + x_{5} = 2 \\ -x_{1} + 2x_{2} + 3x_{3} + 4x_{4} + x_{6} = 1 \end{cases}

x 1 , x 2 , x 3 , x 4 0 x_{1} , x_{2} , x_{3}, x_{4} \ge 0

x 5 x_{5} and x 6 x_6 are basic variables while the rest x are non-basic variable.

. x 1 x_{1} x 2 x_{2} x 3 x_{3} x 4 x_{4} x 5 x_{5} x 6 x_{6} RHS .
z -2 4 -5 6 0 0 0 Ratio
x 5 x_{5} 1 4 -2 8 1 0 2 -1
x 6 x_{6} -1 2 3 4 0 1 1 1 3 \frac{1}{3}

Process involving the 1st table

-5 is the most negative from the coefficients of z.

Negative Ratio is not allowed.

automatic, choose 3, intersection of column x 3 x_{3} and row x 6 x_{6} and make it 1 in the 2nd table.

x 3 \rightarrow x_{3} enters the basic variable, x 6 x_{6} leaves the basic variable.

Make row z, column x 3 x_{3} and row x 5 x_{5} , column x 3 x_{3} zero in the 2nd table.

. x 1 x_{1} x 2 x_{2} x 3 x_{3} x 4 x_{4} x 5 x_{5} x 6 x_{6} RHS .
z 11 3 -\frac{11}{3} 22 3 \frac{22}{3} 0 38 3 \frac{38}{3} 0 5 3 \frac{5}{3} 5 3 \frac{5}{3} Ratio
x 5 x_{5} 1 3 \frac{1}{3} 16 3 \frac{16}{3} 0 32 3 \frac{32}{3} 1 2 3 \frac{2}{3} 8 3 \frac{8}{3} 8
x 3 x_{3} 1 3 -\frac{1}{3} 2 3 \frac{2}{3} 1 4 3 \frac{4}{3} 0 1 3 \frac{1}{3} 1 3 \frac{1}{3} -1

Process involving the 2nd table

11 3 -\frac{11}{3} is most negative.

5*(row x 3 x_{3} in the 2nd table) + row z in the 1st table to obtain the results of row z in the 2nd table.

2*(row x 3 x_{3} in the second table) + row x 5 x_{5} in the 1st table to obtain the results of row x 5 x_{5} in the 2nd table.

Negative ratio is not allow, then, automatically, choosing the intersection of row x 5 x_{5} and column x 1 x_{1} and make it one in the 3rd table.

x 1 \rightarrow x_{1} enters the basic variable, x 5 x_{5} leaves the basic variable.

Make row z, column x 1 x_{1} and row x 3 x_{3} , column x 1 x_{1} zero in the 3rd table.

. x 1 x_{1} x 2 x_{2} x 3 x_{3} x 4 x_{4} x 5 x_{5} x 6 x_{6} RHS
z 0 66 0 130 11 9 31
x 1 x_{1} 1 16 0 32 3 2 8
x 3 x_{3} 0 6 1 12 1 1 3

Process involving the 3rd table

11*(row x 5 x_{5} in the 2nd table) + row z in the 2nd table to obtain the results of row z in the 3rd table.

row x 5 x_{5} in the 2nd table + row x 3 x_{3} in the 2nd table to obtain the result of row x 3 x_{3} in the 3rd table.

max x 1 \rightarrow \text {max} \ x_{1} that make z max is 8

max x 3 \rightarrow \text{max} \ x_{3} that make z max is 3

max z = 31 , x 1 = 8 , x 3 = 3 , x 2 = x 4 = 0 \rightarrow \boxed{\text{max} \ z = 31 , x_{1} = 8, x_{3} = 3, x_{2} = x_{4} = 0 } .

Sabhrant Sachan
Nov 20, 2016

Relevant wiki: Linear Programming

For max z , x 2 and x 4 should be minimum and x 1 and x 3 should be maximum For the Given constraints x 2 = x 4 = 0 The question transforms into a linear optimization problem Now the new conditions are : x 1 2 x 3 2 3 x 3 x 1 1 x 1 , x 3 0 Drawing a graph between x 1 and x 3 will give us a enclosed area One of the corner points of feasible area gives us the max value of z \text{For max } z , x_2 \text{ and } x_4 \text{ should be minimum and } x_1 \text{ and } x_3 \text{ should be maximum } \\ \text{For the Given constraints } x_2=x_4=0 \\ \text{The question transforms into a linear optimization problem}\\ \text{Now the new conditions are : } \\ x_1-2x_3\le 2\\ 3x_3-x_1\le 1 \\ x_1,x_3 \ge 0 \\ \text{Drawing a graph between } x_1 \text{ and } x_3 \text{will give us a enclosed area } \\ \text{One of the corner points of feasible area gives us the max value of } z

Enclosed area is a quadrilateral with points ( 0 , 0 ) , ( 8 , 3 ) , ( 0 , 1 3 ) , ( 2 , 0 ) Point x 1 = 8 and x 3 = 3 Gives us the Maximum z z = 16 + 15 = 31 \text{Enclosed area is a quadrilateral with points } (0,0) , (8,3) , (0,\frac{1}{3}),(2,0) \\ \text{Point } x_1=8 \text{ and } x_3=3 \text{ Gives us the Maximum } z \\ z=16+15 = \boxed{31}

I disagree with the first line, or at least it needs to be elaborated further. Why can't we increase x 2 x_2 slightly, which results in a greater increase in x 1 , x 3 x_1, x_3 to make z z larger?

Calvin Lin Staff - 4 years, 6 months ago

Log in to reply

z = 2 x 1 4 x 2 + 5 x 3 6 x 4 . z = 2x_1-4x_2+5x_3-6x_4 . If we increase x 2 x_2 slightly , x 1 x_1 also slightly increases but the net increase is negative , because coefficient of x 2 x_2 is greater than x 1 x_1 . The same applies to x 3 x_3 and x 4 x_4 . So the best option to maximize z z is to put x 2 = x 4 = 0 x_2 = x_4 =0 .

Sabhrant Sachan - 4 years, 6 months ago
Alex Burgess
Mar 27, 2019

Let A = x 1 + 4 x 2 2 x 3 + 8 x 4 2 A = x_1 + 4x_2 - 2x_3 + 8x_4 \leq 2 ,

B = x 1 + 2 x 2 + 3 x 3 + 4 x 4 1 B = -x_1 + 2x_2 +3x_3 + 4x_4 \leq 1 .

z = 11 A + 9 B 66 x 2 130 x 4 22 + 9 + 0 + 0 = 31 z = 11A + 9B - 66x_2 - 130x_4 \leq 22 + 9 + 0 + 0 = 31 .

Maximised when ( x 1 , x 2 , x 3 , x 4 ) = ( 8 , 0 , 3 , 0 ) (x_1, x_2, x_3, x_4) = (8,0,3,0) .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...