Finite Mathematics MAT 141: Chapter 4 Notes The Simplex Method David J. Gisch Slack Variables and the Pivot Simplex Method and Slack Variables We saw in the last chapter that we can use linear programming to solve a practical problems. The only issue is that the scope of linear programming is very limited. To tackle more complicated problems, and therefore more realistic, we need to introduce the simplex method and slack variables. Slack Variables We use a slack variable to turn an inequality into an equality. For example let us look at 10 We change this equation into an equality by adding a nonnegative variable. 10 Here we know that 10, so if 3and 4, then 3. We call a slack variable as it picks up the slack of the inequality to make an equality. 1
Simplex Method The Farmer Example: A farmer has 100 acres of land on which he wishes to plant a mixture of potatoes, corn, and cabbage. The amounts and constraints are given in the following table. Because we are using several variables it is not convenient to use x, y, z etc. Thus, we use, read x sub one, and so forth so we are not limited by the letters of the alphabet. (a) Write the objective function using subscripted variables. 120 40 60 The Farmer a) Write the constraints as inequalities. b) Write the constraints as inequalities. 100 400 160 180 20,000 10 4 7 500 Simplified c) Write each inequality as an equality using a different slack variable for each. + + + 100 10 +4 +7 + 500 The Farmer (a) (b) (c) Write the constraints as inequalities. Basdkashflka asjflhaljf (d) Now add the objective function with all variables moved to the left. 100 10 4 7 500 120 40 60 0 (e) Turn this into an augmented matrix. 1 1 1 1 0 0 100 10 4 7 0 1 0 500 120 40 60 0 0 1 0 The objective function always goes on the bottom. This augmented matrix is called the Simplex Tableau. 2
Bicycles Bicycles Example: A manufacturer of bicycles builds racing, touring, and mountain models. The bicycles are made of both aluminum and steel. The company has available 91,800 units of steel and 42,000 units of aluminum. The racing, touring, and mountain models need 17, 27, and 34 units of steel, and 12, 21, and 15 units of aluminum, respectively. How many of each type of bicycle should be made in order to maximize profit if the company makes $8 per racing bike, $12 per touring bike, and $22 per mountain bike? What is the maximum possible profit? (a) Write the objective function using subscripted variables. (b) Write the constraints as inequalities and turn them into equalities by including slack variables. (c) Take these equalities and the objective function and include them in a simplex tableau. The Pivot Method How do we take the simplex tableau and find a solution? We use Gauss-Jordan to pivot about elements. Pivot about the highlighted variable. 1 1 1 1 0 0 100 10 ` 4 7 0 1 0 500 120 40 60 0 0 1 0 1 1 1 1 0 0 100 1 2 5 7 10 0 0 50 120 40 60 0 0 1 0 120 0 1 1 10 0 50 1 2 5 7 10 0 0 50 0 8 24 0 12 1 6000 You have zeros above and below. The pivot is complete. The Pivot Method Read the solution from the result? 0 1 1 10 0 50 1 2 5 7 10 0 0 50 0 8 24 0 12 1 6000 1 0 0 0 1 0 0 0 1 This tells us that with 50and 50we have a maximum profit of $6000. This means we should plant 50 acres of potatoes, no corn, and no cabbage. Thus, we end up leaving 50 acres unplanted (represented by the slack variable). It seems weird but it is actually optimal. Check it out. Acres Cost Profit 40 $16,000 $4,800 $4,000 Left 50 $20,000 $6,000 60 $24,000 $7,200 Out of Money 3
The Pivot Method Example: Pivot about the indicated number and state the resulting solution. The Pivot Method Example: Pivot about the indicated number and state the resulting solution. 2 2 1` 1 0 0 0 12 1 2 3 0 1 0 0 45 3 1 1 0 0 1 0 20 2 1 3 0 0 0 1 0 2 2` 3 1 0 0 0 500 4 1 1 0 1 0 0 300 7 2 4 0 0 1 0 700 3 4 2 0 0 0 1 0 Steps to the Simplex Method Maximization Problems 4
Find the Pivot Example: Find the Pivot for the tableau. Find the Pivot Example: Find the Pivot for the tableau. 2 2 1 1 0 0 0 12 1 2 3 0 1 0 0 45 3 1 1 0 0 1 0 20 2 1 3 0 0 0 1 0 12 1 12 45 3 15 20 1 20 Smallest nonnegative number. 4 2 3 1 0 0 0 22 2 2 5 0 1 0 0 28 1 3 2 0 0 1 0 45 3 2 4 0 0 0 1 0 22 3 7.33 28 5 5.6 45 2 22.5 Smallest nonnegative number. Most negative indicator. Most negative indicator. Quick Review Find the Pivot Example: Find the Pivot for the tableau and perform the pivot. 2 1 2 1 0 0 0 25 4 3 2 0 1 0 0 40 3 1 6 0 0 1 0 60 4 2 3 0 0 0 1 0 4) 5
Put it all together. Example: Use the simplex method to solve the linear programming problem. Maximize: Subject to: 8 3 6 8 118 5 10 220 6
1 6 8 1 0 0 118 1 5 10 0 1 0 220 8 3 1 0 0 1 0 8 1 6 8 1 0 0 118 0 1 2 1 1 0 2 0 45 63 8 0 1 994 Remember to check that all the indicators are positive! Put it all together. Example: Use the simplex method to solve the linear programming problem. Maximize: Subject to: 2 5 5 2 30 4 3 6 72 Optimal solution is 118, 0, and 0which gives you a maximum of 994. Put it all together. Example: Big Dave s Fancy Widget Emporium makes three products. The distribution of labor and the profits are give in the table below. Create a simplex tableau and solve to maximize profit. Department Production Hours by Product Department Capacity for Hours A B C Assembling 2 3 2 30,000 Painting 1 2 2 38,000 Finishing 2 3 1 28,000 (PROFIT) $2 $5 $4 7
Widgets Continued Toy Manufacturer Example: A small toy manufacturing firm has 200 squares of felt, 600 oz of stuffing, and 90 ft of trim available to make two types of toys, a small bear and a monkey. The bear requires 1 square of felt and 4 oz of stuffing. The monkey requires 2 squares of felt, 3 oz of stuffing, and 1 ft of trim. The firm makes $1 profit on each bear and $1.50 profit on each monkey. (a) Set up the linear programming problem to maximize profit. (b) Solve the linear programming problem. Toy Manufacturer Minimization Problems 8
Transposition Of Matrices Taking a matrix and interchanging its row for its columns is known as the transposition of a matrix, denoted. 2 3 1 2 0 0 1 4, 3 1 1 4 Note that if has size, then has size. Example: Find the transposition of the given matrix. 3 2 0 1 4 6 3 0 5 Minimization Problems To minimize a linear programming problem you transpose its matrix of equations and treat it as a maximization problem. Minimize: Subject to: 7 5 8 3 2 10 4 5 25 3 2 1 10 4 5 0 25 7 5 8 0 Duals Transpose Maximize: Subject to: 3 4 7 2 5 5 1 0 8 10 25 0 10 25 3 4 7 2 5 5 8 This idea of transposing the matrices is also known as stating the dual problem. Minimization Example: Use the simplex method to solve the linear programming problem. Minimize: 4 Subject to: 2 3 115 2 8 200 50 Maximize: Subject to: 115 200 50 2 1 2 2 3 8 4 1 2 3 115 2 1 8 200 1 0 1 50 1 2 4 0 1 2 1 1 2 1 0 2 3 8 1 4 115 200 50 0 9
Minimization Example: A biologist must make a nutrient of her algae. The nutrient must contain the three basic elements D, E, and F, and must contain at least 10 kg of D, 12 kg of E, and 20 kg of F. The nutrient is made from three ingredients I, II, and III. The quantity of D, E, and F in one unit of each of the ingredients is given in the chart below. How many units of each ingredient are required to meet the biologists needs at minimum cost? Example 4.3.3 Continued What s up? Monday (10-21) Review for Test. All the cool kids will be there. Wednesday (10-23) Test 2: Chapters 3 & 4 Long problems so very few questions but with multiple parts on the test. So if you can t get past the first part you are toast!!!! Practice! I ll try to give you well-behaved problems but that does not mean fractions will not occur. 10