Page 1 Math 141-copyright Joe Kahlig, 10C Section 4.1: The simplex method solves linear programming problems that can not be solved by the method of corners, i.e. graphing method. The simplex method only work with standard maximum linear programming problems. Standard Maximum Linear Programming Problem: 1) Objective function is maximized. 2) All variables are non-negative. 3) All constraints are in the form: ax + by + ...... ≤ c with c ≥ 0 Example: Which of these problems will work with the Simplex Method? Example 1: max f = 2x + y x+y ≤5 2x + 4y ≤ 2 Example 2: max f= 2x + 5y x+y ≤5 2x − 4y ≤ 2 x, y ≥ 0 Example 3: max f = 2x − 6y x − 3y ≥ −4 3x + 5y ≤ 7 x, y ≥ 0 The different parts of the Simplex Method Slack equations: The constraints are converted to equations by by adding a different variable to each inequality, called a slack variable. The only constraints that are not made into slack equations are the x ≥ 0,.... Example: Give the slack equations for these inequalities. Constraints: x+y ≤5 2x + y ≤ 6 x, y ≥ 0 8 Shaded area is the feasible region. 7 Analysis of the slack variables: E 6 D A B C D E F G 5 x 0 1 2 0 5 1 3 4 y 2 2 0 5 0 6 4 3 s1 2 s2 1 G A B C 1 2 F 3 4 5 6 7 8 9 Page 2 Math 141-copyright Joe Kahlig, 10C Basic and Non-Basic variables: In the simplex matrix, the variables that have a unit column are called basic variables. The variables that are not a unit column are called non-basic variables. A unit column is a column that is all zeros except for a single one. Example: Which variables are the basic variables and which are the non-basic variables? Give the solution for this matrix. x 1 2 y 1 1 s1 1 0 s2 0 1 5 6 Example: Give the solution for this matrix. x 1 1 y 1 0 s1 1 −1 s2 0 1 5 1 Smallest Quotient Rule: 1. Divide all positive numbers in the pivot column into the answer column(last column of the matrix). 2. The row that has the smallest non-negative quotient, i.e. is ≥ 0, will be called the pivot row. If there is a tie for the smallest non-negative quotient then you can use either of the rows as the pivot row. 3. The number where the pivot row and pivot column intersect is the pivot element. Example: Assume the first column is the pivot column. Find the location of the pivot element. x 1 −1 2 y 1 3 −1 s1 1 0 0 s2 0 1 0 s3 0 0 1 6 0 6 Example 2: Assume the second column is the pivot column. Find the location of the pivot element. x 1 −1 2 y 1 3 −1 s1 1 0 0 s2 0 1 0 s3 0 0 1 6 0 6 Math 141-copyright Joe Kahlig, 10C Page 3 Example: Set up the simplex matrix: f = 2x + 3y max x+y ≤8 3x + 5y ≤ 30 x ≥ 0, y ≥ 0 Simplex Method. 1. Set up the initial simplex matrix. 2. Find the smallest negative number in the bottom row. This is the pivot column. If there is a tie, then it is your choice as to which column is the pivot column. 3. Do the smallest quotient rule to find the pivot element. 4. Pivot on the pivot element by either using the Gauss-Jordan row operations or the Simplex program on the calculator. 5. If there are still negative numbers in the bottom row, then go back to step 2 otherwise goto the next step. 6. Simplex process is done. read off the solution. Example: Solve this problem using the simplex method. max f = 2x + 3y x+y ≤8 3x + 5y ≤ 30 x ≥ 0, y ≥ 0 Page 4 Math 141-copyright Joe Kahlig, 10C Example: Solve the linear programming problem. P = 6x + 5y + 4z max x + y + z ≤ 20 4x + 3y + 2z ≤ 42 3y + 2z ≤ 30 x, y, z ≥ 0 Example: The matrix represents the solution to this linear programming problem. Discuss the solution. f = 18x + 24y max 3x + 4y ≤ 48 x + 2y ≤ 22 3x + 2y ≤ 42 x, y ≥ 0 x 1 0 0 0 y 0 1 0 0 s1 1 s2 −2 −1 2 3 2 −2 6 3 0 s3 0 0 1 0 P 0 0 0 1 4 9 12 288 Page 5 Math 141-copyright Joe Kahlig, 10C Example: The psychology department at state U buys mice, rats and snakes for experimental purposes. Each mouse costs $3, each rat $5, and each snake $16. The department budget requires no more than $400 be spent on such purchases. Each mouse requires 1.5 square foot of living space, each rat requires 2 square feet of living space, each snake requires 6 square feet of living space with there being a total of 90 square feet for the animals. The department has set the upper limit of the number of snakes to be 10, the upper limit of rats to be 15 and the upper limit of mice to be 32. How many mice, rats, and snakes should be purchased in order to get the largest number of animals. T = x + y + z max 3x + 5y + 16z ≤ 400 (money) 1.5x + 2y + 6z ≤ 90 (space) z ≤ 10 y ≤ 15 x ≤ 32 x, y, z ≥ 0 x = the number of mice purchased. y = the number of rats purchased. z = the number of snakes purchased. x 3 1.5 0 0 1 −1 y 5 2 0 1 0 −1 z 16 6 1 0 0 −1 s1 1 0 0 0 0 0 s2 0 1 0 0 0 0 s3 0 0 1 0 0 0 s4 0 0 0 1 0 0 s5 0 0 0 0 1 0 T 0 0 0 0 0 1 400 90 10 15 32 0 Quotient 400/3 ≈ 133.333 90/1.5 = 60 ———— ———— 32/1= 32 Pivot col = 1 Pivot row = 5 x 0 0 0 0 1 0 y 5 2 0 1 0 −1 z 16 6 1 0 0 −1 s1 1 0 0 0 0 0 s2 0 1 0 0 0 0 s3 0 0 1 0 0 0 s4 0 0 0 1 0 0 s5 −3 −3 2 0 0 1 1 T 0 0 0 0 0 1 304 42 10 15 32 32 Quotient 304/5 = 60.8 42/2 = 21 ———— 15/1 = 15 ———— Pivot col = 2 Pivot row = 4 x 0 0 0 0 1 0 y 0 0 0 1 0 0 z 16 6 1 0 0 −1 Pivot col = 3 Pivot row = 2 s1 1 0 0 0 0 0 s2 0 1 0 0 0 0 s3 0 0 1 0 0 0 s4 −5 −2 0 1 0 1 s5 −3 −3 2 0 0 1 1 T 0 0 0 0 0 1 229 12 10 15 32 47 Quotient 229/16 = 14.3125 12/6 = 2 10/1 = 10 ———— ———— Slack equations: 3x + 5y + 16z + s1 = 400 1.5x + 2y + 6z + s2 = 90 z + s3 = 10 y + s4 = 15 x + s5 = 32 −x − y − z + T = 0 Page 6 Math 141-copyright Joe Kahlig, 10C x 0 0 0 0 1 0 y 0 0 0 1 0 0 z 0 1 0 0 0 0 s1 1 0 0 0 0 0 s2 −8 3 1 6 −1 6 0 0 1 6 s3 0 0 1 0 0 0 s4 s5 1 1 3 −1 3 1 3 −1 4 1 4 1 0 0 1 2 3 3 4 T 0 0 0 0 0 1 197 2 8 15 32 49 Question: Will there be any money left over? How much? Question: Will there be a surplus of living space for the animals? How much? Example: Your umbrella company makes three models: the Sprinkle, the Storm, and the Hurricane. The amounts of cloth, metal, and wood used in making each model are given in the table. Cloth (square yard) metal (pounds) wood (pounds) profit Sprinkle 1 2 1 1 Storm 2 1 3 1 Hurricane 2 3 6 3 x 1 2 1 −1 y 2 1 3 −1 z 2 3 6 −3 s1 1 0 0 0 s2 0 1 0 0 x = the number of Sprinkle umbrellas y = the number of Storm umbrellas z = the number of Hurricane umbrellas P = profit. The last simplex matrix is The first simplex matrix: Available 310 550 610 s3 0 0 1 0 P 0 0 0 1 310 550 610 0 x 1 0 0 0 y 1.5 −2.75 0.25 1.25 z 0 0 1 0 s1 1.5 −2.25 −0.25 0.75 s2 0 1 0 0 s3 −0.5 0.25 0.25 0.25 P 0 0 0 1 160 5 75 385 A) After maximizing the profit, is there any inventory left over? If yes, then list the left over resource(s) and their amounts. B) Determine the profit will the company make if its supply of cloth increases to 350 square yards and its supply of wood increased to 680 lbs. C) Determine the profit will the company make if its supply of cloth increases by 20 square yards, and its supply of metal increases by 25 lbs, and its supply of wood decreases by 90 lbs.