95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-1 Linear Programming 12 Continued Linear programming was invented in the 1940s by George Dantzig as a result of a military research project on planning how to distribute men, weapons, and supplies efficiently to the various fronts during World War II. (Here, the word programming means creating a plan that solves a problem; it is not a reference to computer programming.) Many businesses, industries, and government agencies use linear programming successfully. • Airlines use it to schedule flights in a way that minimizes costs without overloading a pilot or crew with too many hours. • Ecological organizations and government agencies use it to determine the best way to keep our water and air clean. continued © British Retail Photography / Alamy W HAT WE WILL DO I n T h i s C h a p t e r • You may well find yourself working in a small business. Over half of the American workforce does, according to the U.S. Small Business Administration. Small businesses have limited resources, and how they allocate their resources can make or break the business. We will look at how businesses can use linear programming to find the best way to do this. • Starbucks stores and smaller local coffee shops seem to be everywhere. They blend coffee beans from different parts of the world. Like them, many businesses sell a product that involves blending resources. These businesses have many factors to consider: the desired quality of the blend, the availability of the raw materials, and the cost. We will investigate how linear programming is used do this. • Many businesses use the same resources to make different products. A craftsman uses the same wood to make different tables and chairs. A fashion designer uses the same fabrics to make different garments. We will learn how linear programming is used to find the best way to allocate resources to different products. 12-1 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-2 12-2 CHAPTER 12 Linear Programming • Businesses use it to find the best way to assign personnel to jobs. • Supermarket chains use it to determine which warehouses should ship which products to which stores. • Investment companies use it to create portfolios with the best mix of stocks and bonds. • Refineries use it to decide what crude oil to buy and to determine what products to produce with the oil. 12.2 Introduction to the Simplex Method Objective • Be able to set up a linear programming problem as a matrix problem rather than a geometry problem With the simplex method of linear programming, you start by modeling the problem in the same way that you do with the geometric method from Section 12.1. Then, instead of graphing the region of solutions, you • convert the constraints to equations • convert the problem to a matrix problem • find the possible solution that corresponds to that matrix Finally, you solve the matrix problem, as we will show in Section 12.3. We’ll use the craftsman problem from Section 12.1, summarized below, to introduce the procedure and explain why it works. Here’s the model, from Section 12.1: Independent Variables x1 number of coffee tables x2 number of end tables Constraints C1: 6x1 5x2 40 C2: 200x1 100x2 1,000 C3: x1 0 C4: x2 0 the time constraint the money constraint Objective Function z 240x1 160x2 z measures profit We’ve labeled the constraints C1 through C4, for reference. Because there are frequently more than two variables, the simplex method uses x1, x2, and so on rather than x and y to represent the variables. Converting the Constraints to Equations Recall that the constraint C1: 6x1 5x2 40 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-3 12.2 Introduction to the Simplex Method 12-3 was derived from (coffee table hours) (end table hours) 40 If the total number of hours is less than 40, then some “slack” or unused hours are left, and we could say (coffee table hours) (end table hours) (unused hours) 40 C1 can be rewritten as C1: 6x1 5x2 s1 40 where s1 measures unused hours and s1 0. The variable s1 is called a slack variable because it “takes up the slack” between the hours used (which can be less than 40) and the hours available (which are exactly 40). The introduction of slack variables converts the constraint inequalities to equations, allowing us to use matrices to solve the problem. The constraint C2: 200x1 100x2 1,000 was derived from (coffee table money) (end table money) 1,000 This could be rephrased as (coffee table money) (end table money) (unused money) 1,000 Thus, C2 can be rewritten as C2: 200x1 100x2 s2 1,000 where s2 is a slack variable that measures unused money and s2 0. This new variable “takes up the slack” between the money used (which can be less than $1,000) and the money available (which is exactly $1,000). Constraints C3: x1 0 and C4: x2 0 remind us that variables x1 and x2 count things that cannot be negative (coffee tables and end tables, respectively). The simplex method requires that all variables are nonnegative, and we do not convert these constraints to equations. We have rewritten our model: Independent Variables x1 number of coffee tables x2 number of end tables (x1, x2, s1, s2 0) Slack Variables s1 unused hours s2 unused money Constraints C1: 6x1 5x2 s1 40 C2: 200x1 100x2 s2 1,000 the time constraint the money constraint Objective Function z 240x1 160x2 z measures profit Converting the Problem to a Matrix Problem We rewrite the constraints so that each includes all of the variables (x1, x2, s1, s2, and z). The first constraint: C1: 6x1 5x2 s1 40 using the variables x1, x2, and s1 C1: 6x1 5x2 1s1 0s2 0z 40 using all of the variables 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-4 12-4 CHAPTER 12 Linear Programming This equation becomes the first row of our matrix: [6 5 1 0 0 40] The second constraint: C1: 200x1 100x2 0s1 1s2 0z 1,000 using all of the variables [200 the matrix’s second row 100 0 1 0 1,000] We rewrite the objective function with all of the variables on the left side of the equation. the objective function z 240x1 160x2 moving all of the variables 240x1 160x2 0s1 0s2 1z 0 to the left side the matrix’s third row [240 160 0 0 1 0] The resulting matrix is x1 x2 6 5 £ 200 100 240 160 s1 1 0 0 s2 z 0 0 40 1 0 1,000 § 0 1 0 We call this matrix the first simplex matrix. Finding the Possible Solution That Corresponds to the Matrix Some of the columns in our first simplex matrix contain a single 1 and several 0’s (the s1, s2, and z columns). We find the value of the variable heading each of these columns by reading down the column, turning right at the 1, and stopping at the end of the row. Other columns (the x1 and x2 columns) do not contain a single 1 and several 0’s. The value of the variables heading these columns is zero. x1 x2 6 5 £ 200 100 240 160 x1 0 x2 0 s1 1 0 0 s2 0 1 0 z S s1 40 0 40 0 1,000 § S s2 1,000 S z0 1 0 The possible solution that corresponds to the matrix is (x1, x2, s1, s2) (0, 0, 40, 1,000) with z 0 Why do the numbers read from the matrix in this manner yield a possible solution? Clearly, (x1, x2) (0, 0) satisfies all four constraints, so it is a possible solution. If we substitute this solution into C1 and C2 and the objective function, we get the following: C1: 6x1 5x2 s1 40 C2: 200x1 100x2 s2 1,000 200 0 100 0 s2 1,000 6 0 5 0 s1 40 s2 1,000 s1 40 z 240x1 160x2 240 0 160 0 0 Thus, (x1, x2, s1, s2) (0, 0, 40, 1,000) with z 0 satisfies all the constraints and the objective function and is a possible solution. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-5 12.2 Introduction to the Simplex Method 12-5 The possible solution means “make no coffee tables, make no end tables, have 40 unused hours and 1,000 unused dollars, and make no profit.” When we solved this same problem with the geometric method in Section 12.1, one of the corner points was (0, 0) (see Figure 12.34). We have just found that corner point with the simplex method rather than the geometric method (the geometric method does not find values of the slack variables). y P2 (0, 8) P3 ( 5 2, 5) P4 (5, 0) x P1 (0, 0) FIGURE 12.34 The first simplex matrix yields a corner point. As we will see in the next section, the simplex method requires us to explore a series of matrices, just as the geometric method requires us to explore a series of corner points. Each simplex matrix will provide us with a corner point of the region of possible solutions, without our actually graphing that region. The last simplex matrix will provide us with the optimal corner point, that is, the point that solves the problem. SIMPLEX METHOD STEPS Step 1 Model the problem. a. List the independent variables. b. List the constraints, and translate them into linear inequalities. c. Find the objective, and translate it into a linear equation. Step 2 Convert each constraint from an inequality to an equation. a. Use one slack variable for each constraint. b. Determine what each slack variable measures. Step 3 Rewrite the objective function with all variables on the left side. Step 4 Make a matrix out of the rewritten constraints and the rewritten objective function. This is the first simplex matrix. The constraints go in the first rows, and the objective function goes in the last row. Step 5 Determine the possible solution that corresponds to the matrix. a. Columns containing only a 1 and 0’s: turn at 1. b. Other columns: the value of the variable is 0. The remaining steps, which build on this work to find the maximal solution, will be discussed in Section 12.3. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-6 12-6 CHAPTER 12 Linear Programming EXAMPLE 1 SETTING UP A SIMPLEX METHOD PROBLEM AS A MATRIX PROBLEM Find the first simplex matrix and the corresponding solution for the objective function 1 z x1 x2 2 subject to the constraints C1: 2x1 x2 15 C2: x1 x2 10 C3: x1 0 C4: x2 0 SOLUTION Step 1 Model the problem. No modeling needs to be done, because the problem is stated in the language of mathematics rather than as a real-world problem. Step 2 Convert each constraint from an inequality to an equation. C1: 2x1 x2 15 S 2x1 x2 s1 15 C2: x1 x2 10 S x1 x2 s2 10 Rewrite the objective function with all the variables on the left side. 1 1 z x1 x2 S x1 x2 z 0 2 2 Step 3 Step 4 Make a matrix out of the rewritten constraints and the rewritten objective function. x2 s1 s2 z x1 2 1 1 0 0 15 S s1 15 £ 1 1 0 1 0 10 § S s2 10 Sz0 1>2 1 0 0 1 0 x1 0 Step 5 x2 0 Determine the possible solution that corresponds to the matrix. The s1, s2, and z columns contain zeros and a single 1, so we find the values of those variables by reading down the column and turning at 1. The x1 and x2 columns are not that type of column, so the value of those variables is zero. The possible solution is (x1, x2, s1, s2) (0, 0, 15, 10), and z 0. Remember that this is only a possible solution. In the next section, we will see how to build on this work to find the maximal solution. 12.2 Exercises In Exercises 1– 4, convert the linear inequality to a linear equation by introducing a slack variable. In Exercises 5–10, (a) translate the information into a linear inequality, (b) convert the linear inequality into a linear equation by introducing a slack variable, and (c) determine what each variable (including the slack variable) measures. 1. 3x1 2x2 5 2. 512x1 339x2 254 5. 3. 3.41x1 9.20x2 6.16x3 45.22 4. 99.52x1 21.33x2 102.15x3 50.14 Selected exercises available online at www.webassign.net/brookscole A shopper has $42.15 in cash. She wants to purchase meat at $6.99 a pound, cheese at $3.15 a pound, and bread at $1.98 a loaf. The shopper must pay for these items in cash. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-7 12.2 6. A sharp dresser is at his favorite store, where everything is on sale. His budget will allow him to spend up to $425. Shirts are on sale for $19.99 each, slacks for $74.98 a pair, and sweaters for $32.98 each. 7. A plumber is starting an 8-hour day. Laying pipe takes her 5 minutes per foot, and installing elbows takes her 4 minutes per elbow. 8. An electrician is starting a 7 1/2-hour day. Installing conduit takes him 2.5 minutes per foot, connecting lines takes him 1 minute per connection, and installing circuit breakers takes him 4.5 minutes per circuit breaker. 9. A mattress warehouse has 50,000 cubic feet of space. Twin beds are 24 cubic feet, double beds are 36 cubic feet, queen-size beds are 56 cubic feet, and king-size beds are 72 cubic feet. 10. A nursery has 1000 square feet of outdoor display space. Trees need 16 square feet each, shrubs need 10 square feet each, and flowering plants need 1 square foot each. In Exercises 11–16, find the possible solution that corresponds to the given matrix. x1 x2 s1 s2 5 0 3 1 11. £ 3 0 19 0 21 1 48 0 x1 1 12. £ 0 0 x2 s1 31 0 0 0 1 1 x1 1.9 3.2 13. ≥ 5.5 2.1 14. x1 0 0 ≥ 1 0 s2 9 15 0 z 0 1 0 7.4 4.9 § 20 s1 0 0 1 0 s2 0 1 0 0 s3 1 0 0 0 s2 s3 0 62 0 5 0 0 1 1 z 0 1 0 0 x2 0.3 0.7 0.8 3.2 x2 s1 1 7 0 5 0 0 0 9 x1 x2 s1 s2 s3 15. 1 0 ≥0 0 0 0 0 0 1 0 6 8 3 4 4 z 0 12 1 22 § 0 19 0 0 1 0 0 0 1 0 0 0 z 0 0 0 1 0.5 9.3 ¥ 7.8 9.6 0.5 9.3 ¥ 7.8 9.6 s4 z 76 13 50 9 12 0 0 0 0 1 25 46 32 ¥ 73 63 x1 32 7 16. E10 65 24 x2 s1 0 1 0 0 0 0 1 0 0 0 s2 s3 s4 0 0 7 0 1 3 1 0 5 0 0 9 0 0 2 z 0 0 0 0 1 Exercises 12-7 25 46 32U 73 44 In Exercises 17–22, find the first simplex matrix and the possible solution that corresponds to it. 17. Objective function: 18. Objective function: z 2x1 4x2 z 2.4x1 1.3x2 Constraints: Constraints: 3x1 4x2 40 6.4x1 x2 360 4x1 7x2 50 x1 9.5x2 350 x1 0 x1 0 x2 0 x2 0 19. Objective function: 20. Objective function: z 12.10x1 43.86x2 z 3.52x 1 4.72x 2 Constraints: Constraints: 112x1 3x2 370 2x1 4x2 7,170 x1 x2 70 32x1 19x2 1960 47x1 19x2 512 x1 5 x1 0 x1 0 x2 0 x2 0 21. Objective function: z 4x1 7x2 9x3 Constraints: 5x1 3x2 9x3 10 12x1 34x2 100x3 10 52x1 7x2 12x3 10 x1 0 x2 0 x3 0 22. Objective function: z 9.1x1 3.5x2 8.22x3 Constraints: x1 16x2 9.5x3 1210 72x1 3.01x2 50x3 1120 57x1 87x2 742x3 309 x1 0 x2 0 x3 0 In Exercises 23–28, find the first simplex matrix and the possible solution that corresponds to it. Do not try to solve the problem. 23. Five friends, each of whom is an experienced baker, form a company that will make bread and cakes and sell them to local restaurants and specialty stores. Each loaf of bread requires 50 minutes of labor and ingredients costing $0.90 and can be sold for a $1.20 profit. Each cake requires 30 minutes of labor and ingredients costing $1.50 and can be sold for a $4.00 profit. The partners agree that no one will work more than 8 hours a day. Their financial resources do not 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-8 12-8 CHAPTER 12 Linear Programming allow them to spend more than $190 per day on ingredients. How many loaves of bread and how many cakes should they make each day to maximize their profit? 24. A craftswoman produces two products: floor lamps and table lamps. Production of one floor lamp requires 75 minutes of her labor and materials that cost $25. Production of one table lamp requires 50 minutes of labor and materials that cost $20. The craftswoman wants to work no more than 40 hours each week, and her financial resources allow her to pay no more than $900 for materials each week. If she can sell as many lamps as she can make and if her profit is $40 per floor lamp and $32 per table lamp, how many floor lamps and how many table lamps should she make each week to maximize her weekly profit? 25. Pete’s Coffees sells two blends of coffee beans: Yusip Blend and Exotic Blend. Yusip Blend is one-half Costa Rican beans and one-half Ethiopian beans, and Exotic Blend is one-quarter Costa Rican beans and threequarters Ethiopian beans. Profit on the Yusip Blend is $3.50 per pound, while profit on the Exotic Blend is $4 per pound. Each day, the shop can obtain 200 pounds of Costa Rican beans and 330 pounds of Ethiopian beans, and it uses those beans only in the two blends. If it can sell all that it makes, how many pounds of Yusip Blend and of Exotic Blend should Pete’s Coffees prepare each day to maximize profit? 26. Pete’s Coffees sells two blends of coffee beans: Morning Blend and South American Blend. Morning Blend is one-third Mexican beans and two-thirds Colombian beans, and South American Blend is twothirds Mexican beans and one-third Colombian beans. Profit on the Morning Blend is $3 per pound, while profit on the South American Blend is $2.50 per pound. Each day, the shop can obtain 100 pounds of Mexican beans and 80 pounds of Colombian beans, and it uses those beans only in the two blends. If it can sell all that it makes, how many pounds of Morning Blend and of 12.3 South American Blend should Pete’s Coffees prepare each day to maximize profit? 27. A furniture-manufacturing firm makes sofas and chairs, each of which is available in several styles. Each sofa, regardless of style, requires 8 hours in the upholstery shop and 4 hours in the carpentry shop and can be sold for a profit of $450. Each chair requires 6 hours in the upholstery shop and 3.5 hours in the carpentry shop and can be sold for a profit of $375. There are nine people working in the upholstery shop and five in the carpentry shop, each of whom can work no more than 40 hours per week. How many sofas and how many chairs should the firm make each week to maximize its profit? What is that maximum profit? Would this leave any extra time in the upholstery shop or the carpentry shop? If so, how much? 28. City Electronics Distributors handles two lines of televisions: the Packard and the Bell. The company purchases up to $57,000 worth of television sets from the manufacturers each month, which it stores in its 9,000-cubic-foot warehouse. The Packards come in 36-cubic-foot packing crates, and the Bells come in 30-cubic-foot crates. The Packards cost City Electronics $200 each and can be sold to a retailer for a $200 profit, while the Bells cost $250 each and can be sold for a $260 profit. How many sets should City Electronics order each month to maximize profit? What is that maximum profit? Would this leave any unused storage space or money? If so, how much? Answer the following questions using complete sentences and your own words. • Concept Questions 29. 30. Why does the simplex method exist? That is, why do we not use the geometric method for all linear programming problems? What do the simplex method and the geometric method have in common? The Simplex Method: Complete Problems Objectives • • Understand the row operations Be able to use the row operations to solve a linear programming problem In Section 12.2, we saw how to convert a linear programming problem to a matrix problem. In this section, we will see how to use the simplex method to solve a linear programming problem. We’ll start by continuing where we left off with the 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-9 12.3 The Simplex Method: Complete Problems 12-9 craftsman problem. We have modeled the problem, introduced slack variables, and rewritten the objective function so all variables are on the left side. Independent Variables Slack Variables x1 number of coffee tables x2 number of end tables (x1, x2, s1, s2 0) s1 unused hours s2 unused money Constraints C1: 6x1 5x2 s1 40 C2: 200x1 100x2 s2 1,000 the time constraint the money constraint Objective Function 240x1 160x2 0s1 0s2 1z 0 z measures profit We have also made a matrix out of the rewritten constraints and the rewritten objective function (the “first simplex matrix”) and determined the possible solution that corresponds to that matrix. The first simplex matrix was as follows: x1 x2 s1 s2 z 6 5 1 0 0 40 d C1 £ 200 100 0 1 0 1,000 § d C2 d objective function 240 160 0 0 1 0 The corresponding possible solution was (x1, x2, s1, s2) (0, 0, 40, 1,000) with z 0 This solution is a corner point of the region of possible solutions (see Figure 12.35); it is point P1 (0, 0) (the geometric method does not find values of the slack variables). However, it is not the optimal corner point; it is a possible solution but not the maximal solution. Our goal in the remaining steps of the simplex method is to find the maximal solution. This process is called pivoting. y P2 (0, 8) P3 ( 5 2, 5) P4 (5, 0) x P1 (0, 0) FIGURE 12.35 The possible solution (x1, x2, s1, s2) (0, 0, 40, 1,000) is the corner point P1 (0, 0). Deciding Where to Pivot Step 1 Look at the last row, the objective function row. Select the most negative entry in that row. The column containing that entry is the pivot column. If the last row contains no negative entries, then no pivoting is necessary; the possible solution 95057_12_ch12_web_p001-028.qxd 9/29/10 8:02 PM Page 12-10 12-10 CHAPTER 12 Linear Programming that corresponds to the matrix is the maximal solution. x1 6 £ 200 240 x2 s1 5 1 100 0 160 0 s2 0 1 0 z 0 40 0 1,000 § d objective function 1 0 The only negative entries in the last row are 240 and 160; the most negative is 240. This entry is in the first column, so our pivot column is the first column. We will pivot on one of the entries of the pivot column. x1 x2 s1 6 5 1 £ 200 100 0 240 160 0 c Pivot column Step 2 s2 0 1 0 z 0 40 0 1,000 § 1 0 Divide the last entry in each constraint row by the corresponding entry in the pivot column, if that entry is positive. The row that yields the smallest nonnegative such quotient is the pivot row. 6 5 £ 200 100 240 160 c Pivot column 1 0 0 0 1 0 0 0 1 40 1,000 § 0 d 40>6 6.67 d 1,000>200 5 d not a constraint row Our quotients are 6.67 and 5; the smallest nonnegative quotient is 5, which is in row two. Our pivot row is the second row. Step 3 Pivot on the entry in the pivot row and pivot column. 6 5 1 0 0 40 £ 200 100 0 1 0 1,000 § 240 160 0 0 1 0 c Pivot column d pivot row We will pivot on the entry “200.” The Row Operations Remember, each of the matrix’s rows represents an equation. And the entire matrix is just a different way of writing a system of equations. When you solve a system of equations with the elimination method, you are allowed to do things like adding multiples of equations together. When you pivot on a matrix with the simplex method, you are allowed to do things like adding multiples of rows together. These actions are called the row operations. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-11 12.3 The Simplex Method: Complete Problems 12-11 THE ROW OPERATIONS 1. Multiply or divide a row by any number (except 0). This is equivalent to multiplying or dividing an equation by a number, when using the elimination method. 2. Add one row to another row, or add a multiple of one row to another row. This is equivalent to adding one equation to another equation or adding a multiple of an equation to another equation. 3. Interchange any two rows. This is equivalent to interchanging two equations. Pivoting 1. Use the row operations to make the pivot entry a 1. The pivot entry is 200. We’ll turn it into a 1 by dividing row 2 by 200. (This is row operation 1 in the above list.) This gives us 6 5 1 0 0 40 £ 200>200 100>200 0>200 1>200 0>200 1000>200 § 240 160 0 0 1 0 d dividing row 2 by 200 6 5 1 0 0 40 £ 1 0.5 0 0.005 0 5 § 240 160 0 0 1 0 Use the row operations to make each of the other entries in the pivot column 0. The other entries in the pivot column are 6 and 240. First, we will turn the 6 into a 0 by adding –6 times row 2 to row 1. (This is row operation 2 in the above list.) This gives us 2. 6 # 1 6 1 £ 240 6 # 0.5 5 0.5 160 6 # 0 1 0 0 0 2 1 .03 £ 1 0.5 0 0.005 240 160 0 0 0 0 1 6 # 0.005 0 6 # 0 0 0.005 0 0 1 d 6 row 2 row 1 10 6 # 5 40 5 § 0 5 § 0 Now we’ll turn the –240 into a 0 by adding 240 times row 2 to row 3. (This is row operation 2 in the above list.) This gives us 0 £ 1 # 240 1 12402 0 £1 0 2 0.5 # 240 0.5 1160 2 2 1 .03 0.5 0 0.005 40 0 1.2 0 0 1 1 0 # 240 0 0 10 5 § 1200 .03 0.005 # 240 0.005 0 0 0 # 240 0 1 10 5 § # 240 5 0 d 240 row 2 row 3 The above matrix is called the second simplex matrix. It marks the end of our first pivot. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-12 12-12 CHAPTER 12 Linear Programming The simplex method requires us to explore a series of matrices, just as the geometric method requires us to explore a series of corner points. Each simplex matrix provides us with a corner point of the region of possible solutions. The final simplex matrix will provide us with the optimal corner point, the point that solves the problem. The second simplex matrix x1 x2 s1 s2 z 0 2 1 0.03 0 10 £ 1 0.5 0 0.005 0 5 § 0 40 0 1.2 1 1,200 provides us with the corner point: (x1, x2, s1, s2) (5, 0, 10, 0) with z 1,200 This is corner point P4 (see Figure 12.36). y P2 (0, 8) P3 ( 5 2 , 5) P4 (5, 0) x P1 (0, 0) FIGURE 12.36 The simplex method produced corner point P4 (5, 0) as a possible solution. Because x1 is the number of coffee tables, x2 is the number of end tables, s1 is the number of unused hours, and s2 is the amount of unused money, this possible solution means “make five coffee tables and no end tables, have ten unused hours and no unused money, and make a profit of $1,200.” When to Stop Pivoting Is (5, 0, 10, 0) the optimal corner point, the point that solves the craftsman’s problem? We answer this question by determining whether it is possible to pivot again. 1. Select the most negative entry in the last row, the objective function row. The column containing that entry is the pivot column. If the last row contains no negative entries, then no pivoting is necessary; the possible solution that corresponds to the matrix is the maximal solution. s2 z x1 x2 s1 0 2 1 0.03 0 10 £ 1 0.5 0 0.005 0 5 § 0 40 0 1.2 1 1,200 d objective function 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-13 12.3 The Simplex Method: Complete Problems 12-13 Because there is a negative entry in the objective function row, we must pivot again. This negative entry is in the “x2” column, so our pivot column is the “x2” column. x1 x2 s1 s2 z 0 2 1 0.03 0 10 £ 1 0.5 0 0.005 0 5 § 0 40 0 1.2 1 1,200 c pivot column 2. Divide the last entry in each constraint row by the corresponding entry in the pivot column if that entry is positive. The row that yields the smallest nonnegative such quotient is the pivot row. 0 2 £ 1 0.5 0 40 1 0.03 0 0.005 0 1.2 0 10 0 5 § 1 1,200 d 10>2 5 d 5>0.5 10 d not a constraint row c pivot column Our quotients are 5 and 10; the smallest nonnegative quotient is 5, which is in row one. Our pivot row is the first row. 3. Pivot on the entry in the pivot row and pivot column. 0 2 1 0.03 0 10 £ 1 0.5 0 0.005 0 5 § 0 40 0 1.2 1 1,200 c pivot column d pivot row We will pivot on the entry “2.” Pivoting Again 1. Use the row operations to make the pivot entry a 1. 0 £1 0 2. 1 0.5 0.5 0 40 0 0.015 0 5 0.005 0 5 § 1.2 1 1,200 d row 1 2 Use the row operations to make each of the other entries in the pivot column 0. x1 0 £1 0 x2 s1 s2 1 0.5 0.015 0 0.25 0.0125 0 20 0.6 z 0 5 0 2.5 § d 0.5 row 1 row 2 1 1,400 d 40 row 1 row 3 This matrix is our third and last simplex matrix, because it is not possible to pivot further—the bottom row contains no negative entries. The solution that corresponds to this matrix is the optimal corner point: (x1, x2, s1, s2) (2.5, 5, 0, 0) with z 1,400 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-14 12-14 CHAPTER 12 Linear Programming meaning “each week make 2.5 coffee tables and 5 end tables, have no unused hours and no unused money, and make a profit of $1,400.” See Figure 12.37. y P2 (0, 8) P3 ( 25 , 5) P4 (5, 0) x P1 (0, 0) FIGURE 12.37 The simplex method produced corner point P3(52, 5) as the optimal solution. Why the Simplex Method Works In the craftsman problem, our first simplex matrix was x1 6 £ 200 240 x2 s1 5 1 100 0 160 0 s2 0 1 0 z 0 40 0 1,000 § 1 0 and its corresponding possible solution was (x1, x2, s1, s2) (0, 0, 40, 1,000) with z 0 This means “make no tables and generate no profit.” We selected the first column as our pivot column because it was the column with the most negative number in the bottom. Why do we select the column with the most negative number in the bottom? The possible solution corresponding to the first simplex matrix involves no profit (z 0). Certainly, the profit can be increased by making some tables. If the craftsman were to make only one type of table, which table would be best? Coffee tables generate more profit per table ($240 versus $160), so the craftsman would be better off making coffee tables. This choice of coffee tables over end tables or of $240 over $160 was made in the pivoting process when we chose the first column as the pivot column. That choice was made because 240 is larger than 160. After selecting the pivot column, we selected the second row as our pivot row because 5 is the smallest nonnegative quotient. Why do we select the row with the smallest nonnegative quotient? 6 £ 200 240 5 1 0 0 100 0 1 0 160 0 0 1 40 1,000 § 0 d 40>6 6 23 d 1000>200 5 d not a constraint row 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-15 12.3 The Simplex Method: Complete Problems 12-15 If the craftsman were to make only coffee tables, he should make the largest amount allowed by the constraints when 0 is substituted for x2 (that is, when no end tables are made). Time Constraint Money Constraint C1: 6x1 5x2 40 6x1 5 0 40 6x1 40 x C2: 200x1 100x2 1,000 200x1 100 0 1,000 200x1 1,000 2 40 20 6 3 3 6 x1 1,000 5 200 The time constraint will not be violated as long as x1 6 32 ; the money constraint will not be violated as long as x1 5. The craftsman can make at most x1 5 coffee tables and not violate either constraint. This choice of 5 over 6 23 was made in the pivoting process when we chose the second row as the pivot row. That choice was made because 5 is less than 6 23 . We have just used logic to determine that if the craftsman makes only one type of table, he should make coffee tables, and that he could make at most five coffee tables without violating his constraints. The simplex method leads to the same conclusion. The second simplex matrix was s2 z x1 x2 s1 0 2 1 0.03 0 10 £ 1 0.5 0 0.005 0 5 § 0 40 0 1.2 1 1,200 and its corresponding possible solution was (x1, x2, s1, s2) (5, 0, 10, 0) with z 1,200 This does suggest that the craftsman make five coffee tables and no end tables. This matrix was not the final simplex matrix, so this possible solution was not the optimal solution. That is, the craftsman will increase his profit if he makes more than one type of table. The last row of this matrix, the objective function row, is 0 40 0 1.2 1 1,200 We pivoted again because of the presence of a negative number in this row. This pivoting resulted in an increased profit. Why does the presence of a negative number imply that if we pivot again, the profit will be increased? The last row represents the equation 0x1 (40x2) 0s1 1.2s2 1z 1,200 which can be rewritten as z 1,200 40x2 1.2s2 by solving for z. According to this last equation, the profit is z 1,200 if x2 and s2 are both zero. If x2 is positive, then the profit could be larger than 1,200. Thus, it is possible to achieve a larger profit by changing x2 from zero to a positive number. Because x2 measures the number of end tables, this means that the craftsman should make some end tables. Our last pivot did in fact result in his making some end tables. The following list of steps includes those steps developed in Section 12.2, as well as those developed in this section. Notice that you can check your work at step 7; if you have made an arithmetic error during your pivot, catch it here before you go any further. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-16 12-16 CHAPTER 12 Linear Programming SIMPLEX METHOD STEPS 1. Model the problem. a. List the independent variables. b. List the constraints and translate them into linear inequalities. c. Find the objective and translate it into a linear equation. 2. Convert each constraint from an inequality to an equation. a. Use one slack variable for each constraint. b. Determine what each slack variable measures. 3. Rewrite the objective function with all variables on the left side. 4. Make a matrix out of the rewritten constraints and the rewritten objective function. This is the first simplex matrix. 5. Determine the possible solution that corresponds to the matrix. a. Columns with zeros and a single one—turn at 1. b. Other columns—the value of the variable is zero. 6. Pivot to find a better possible solution. a. The pivot column is the column with the most negative entry in the last row. In case of a tie, choose either. b. Divide the last entry of each constraint row by the entry in the pivot column, if that entry is positive. The pivot row is the row with the smallest nonnegative such quotient. In case of a tie, choose either. c. Pivot on the selected row and column; that is, use the row operations to transform the selected column into a column with 1 in the pivot row and 0’s in all other rows. This gives a new simplex matrix. 7. Determine the possible solution that corresponds to the matrix (as in step 5). ✔ Check your work by seeing whether the solution substitutes into the objective function and constraints. 8. Determine whether the current possible solution maximizes the objective function. a. If the last row of the new simplex matrix has no negative entries, then the problem is solved, and the current solution is the maximal solution. b. If the last row of the new simplex matrix has one or more negative entries, then pivot again. Return to step 6. 9. Interpret the final solution. Express the solution in words, as a solution to a real-world problem rather than a mathematical problem. EXAMPLE 1 THE LEATHER FACTORY AND RESOURCE ALLOCATION The Leather Factory has one sewing machine with which it makes coats and vests. Each coat requires 50 minutes on the sewing machine and uses 12 square feet of leather. Each vest requires 30 minutes on the sewing machine and uses 8 square feet of leather. The sewing machine is available 8 hours a day, and the Leather Factory can obtain 118 square feet of leather a day. The coats sell for $175 each, and the vests sell for $100 each. Find the daily production level that would yield the maximum revenue. SOLUTION 1. Model the problem. Independent Variables x1 number of coats made each day x2 number of vests made each day 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-17 12.3 The Simplex Method: Complete Problems 12-17 Constraints C1: sewing machine hours 8 hours (coat sewing time) (vest sewing time) time number time number ° per ¢ · ° of ¢ ° per ¢ · ° of ¢ coat coats vest vests 30 x2 50 x1 C2: leather used 118 square feet (coat leather) (vest leather) 480 minutes 480 minutes 480 minutes 480 minutes 118 square feet leather number leather number ° per ¢ · ° of ¢ ° per ¢ · ° of ¢ 118 square feet coat coats vest vests 8 x2 118 12 x1 Objective Function maximize z revenue coat revenue vest revenue price number price number z ° per ¢ · ° of ¢ ° per ¢ · ° of ¢ coat coats vest vests 175 x1 100 x2 2. Convert each constraint from an inequality to an equation. C1: 50x1 30x2 480 50x1 30x2 s1 480 where s1 unused sewing machine time C2: 12x1 8x2 118 12x1 8x2 s2 118 where s2 unused leather 3. Rewrite the objective function with all variables on the left side. z 175x1 100x2 175x1 100x2 0s1 0s2 1z 0 4. 5. 6. Make a matrix out of the rewritten constraints and the rewritten objective function. The first simplex matrix is as follows: x1 x2 s1 s2 z 50 30 1 0 0 480 £ 12 8 0 1 0 118 § 175 100 0 0 1 0 Determine the possible solution that corresponds to the first simplex matrix. The solution is (x1, x2, s1, s2) (0, 0, 480, 118) with z 0. This means “make no product and make no profit.” Pivot to find a better possible solution. x1 x2 s1 s2 z 50 30 1 0 0 480 £ 12 8 0 1 0 118 § 175 100 0 0 1 0 c pivot column 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-18 12-18 CHAPTER 12 Linear Programming Our pivot column is the first column, because 175 is the most negative entry in the bottom row. To select the pivot row, divide the last entry in each constraint row by the entry in the pivot column, if that entry is positive, and select the row with the smallest nonnegative such quotient. 50 £ 12 175 d 480>50 9.6 30 1 0 0 480 8 0 1 0 118 § 100 0 0 1 0 d 118>12 9.8333 d not a constraint row Because 9.6 is the smallest nonnegative quotient, our pivot row is the first row. 50 30 1 0 0 480 £ 12 8 0 1 0 118 § 175 100 0 0 1 0 c pivot column d pivot row We will pivot on the 50. 1 0.6 £ 12 8 175 100 s1 x1 x2 1 0.6 0.02 £ 0 0.8 0.24 0 5 3.5 7. 0.02 0 0 s2 0 1 0 0 0 9.6 1 0 118 § 0 1 0 z 0 9.6 0 2.8 § 1 1,680 d row 1 50 d 12 row 1 row 2 d 175 row 1 row 3 Determine the possible solution that corresponds to the matrix. The possible solution is (x1, x2, s1, s2) (9.6, 0, 0, 2.8) with z 1,680. Check your work by seeing if the solution substitutes into the objective function and constraints: C 1: 50x1 30x2 s1 50 · 9.6 30 · 0 0 480 C 2: 12x1 8x2 s2 12 · 9.6 8 · 0 2.8 118 Objective function: z 175x1 100x2 175 · 9.6 100 · 0 1,680 If any of these substitutions failed, we would know to stop and find our error. 8. Determine whether the current possible solution maximizes the objective function. The last row contains no negative entries, so we don’t need to pivot again, and the problem is finished. Some linear programming problems involve only one pivot, some involve two, and some involve more. This problem involved only one pivot. 9. Interpret the final solution. Recall that x1 measures the number of coats made per day, x2 measures the number of vests, s1 measures the number of slack machine hours, and s2 measures the amount of unused leather. Thus, the Leather Factory should make 9.6 coats per day and no vests. (If workers spend all day making coats, they will make 9.6 coats. They’ll finish the tenth coat the next day.) This will result in no unused machine hours and 2.8 square feet of unused leather and will generate a maximum revenue of $1,680 per day. These profit considerations indicate that the Leather Factory should increase the cost of its leather vests if it wants to sell vests. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-19 12.3 Exercises In Exercises 1–4, determine where to pivot. 1. 2. 3. 4. x1 x2 s1 s2 z 5 0 3 1 0 £ 3 0 19 0 10 21 1 48 0 0 x1 1 £0 0 x2 s1 s2 31 0 9 20 0 15 1 1 0 x1 19 32 ≥ 55 21 x1 0 0 ≥ 1 0 z 0 7.4 1 4.9 § 0 20 x2 s1 s2 s3 3 0 0 1 7 0 1 0 8 1 0 0 32 0 0 0 x2 s1 1 7 0 5 0 0 0 9 12 22 § 19 z 0 0 0 1 5 93 ¥ 8 96 s2 s3 z 0 62 0 5 1 5 0 93 ¥ 0 0 0 78 1 1 1 96 In Exercises 5–8, (a) determine where to pivot, (b) pivot, and (c) determine the solution that corresponds to the resulting matrix. 5. 6. 7. 8. x1 x2 s1 1 2 1 £ 4 1 0 6 4 0 s2 z 0 0 3 1 0 2§ 0 1 0 x1 x2 s1 s2 8 2 1 0 £ 5 1 0 1 2 4 0 0 z 0 0 1 x1 x2 s1 s2 1 1 5 0 £ 3 0 1 1 6 0 2 0 x1 x2 s1 s2 0 2 1 5 £1 3 0 9 0 4 0 2 4 3§ 0 z 0 3 0 12 § 1 6 z 0 0 2 8 6 § 12 Use the simplex method to solve Exercises 9–16. (Some of these exercises were started in Section 12.2.) 9. Five friends, all of whom are experienced bakers, form a company that will make bread and cakes and sell them to local restaurants and specialty stores. Each loaf of bread requires 50 minutes of labor and ingredients costing $0.90 and can be sold for $1.20 profit. Each cake requires 30 minutes of labor and ingredients costing $1.50 and can be sold for $4.00 profit. The partners agree that no one will work more than eight hours a day. Their financial resources do not allow them to spend more than $190 per day on ingredients. How many loaves of bread and how many cakes should they make each day to maximize their profit? What is the maximum profit? Will this leave any extra time or money? If so, how much? 10. A craftswoman produces two products: floor lamps and table lamps. Production of one floor lamp requires 75 minutes of her labor and materials that cost $25. Production of one table lamp requires 50 minutes of labor and materials that cost $20. The craftswoman wants to work no more than 40 hours each week, and her financial resources allow her to pay no more than $900 for materials each week. If she can sell as many lamps as she can make and if her profit is $40 per floor lamp and $32 per table lamp, how many floor lamps and how many table lamps should she make each week to maximize her weekly profit? What is that maximum profit? Will this leave any unused time or money? If so, how much? 11. A furniture manufacturing firm makes sofas and chairs, each of which is available in several styles. Each sofa, regardless of style, requires eight hours in the upholstery shop and four hours in the carpentry shop and can be sold for a profit of $450. Each chair requires six hours in the upholstery shop and 3.5 hours in the carpentry shop and can be sold for a profit of $375. There are nine people working in the upholstery shop and five in the carpentry shop, each of whom can work no more than 40 hours per week. How many sofas and how many chairs should the firm make each week to maximize its profit? What is that maximum profit? Would this leave any extra time in the upholstery shop or the carpentry shop? If so, how much? 12. City Electronics Distributors handles two lines of televisions: the Packard and the Bell. The company purchases up to $57,000 worth of television sets from the manufacturers each month, which it stores in its 9,000-cubic-foot warehouse. The Packards come in 36-cubic-foot packing crates, and the Bells come in 30cubic-foot crates. The Packards cost City Electronics $200 each and can be sold to a retailer for a $200 profit, while the Bells cost $250 each and can be sold for a $260 profit. How many sets should City Electronics order each month to maximize profit? What is that maximum profit? Would this leave any unused storage space or money? If so, how much? Selected exercises available online at www.webassign.net/brookscole 12-19 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-20 12-20 CHAPTER 12 Linear Programming 13. J & M Winery makes two jug wines: House White and Premium White, which it sells to restaurants. House White is a blend of 75% French colombard grapes and 25% sauvignon blanc grapes, and Premium White is 75% sauvignon blanc grapes and 25% French colombard grapes. J & M also makes a Sauvignon Blanc, which is 100% sauvignon blanc grapes. Profit on the House White is $1.00 per liter, profit on the Premium White is $1.50 per liter, and profit on the Sauvignon Blanc is $2.00 per liter. This season, J & M can obtain 30,000 pounds of French colombard grapes and 20,000 pounds of sauvignon blanc grapes. It takes 2 pounds of grapes to make 1 liter of wine. If J & M can sell all that it makes, how many liters of House White, of Premium White, and of Sauvignon Blanc should J & M prepare to maximize profit? What is that maximum profit? Would this leave any extra grapes? If so, what amount? 14. J & M Winery makes two jug wines: House Red and Premium Red, which it sells to restaurants. House Red is a blend of 20% cabernet sauvignon grapes and 80% gamay grapes. Premium Red is 60% cabernet sauvignon grapes and 40% gamay grapes. J & M also makes a Cabernet Sauvignon, which is 100% cabernet sauvignon grapes. Profit on the House Red is $0.90 per liter, profit on the Premium Red is $1.60 per liter, and profit on the Cabernet Sauvignon is $2.50 per liter. This season, J & M can obtain 30,000 pounds of gamay grapes and 22,000 pounds of cabernet sauvignon grapes. It takes 2 pounds of grapes to make 1 liter of wine. If J & M can sell all that it makes, how many liters of House Red, of Premium Red, and of Cabernet Sauvignon should J & M prepare to maximize profit? What is that maximum profit? Would this leave any extra grapes? If so, what amount? 15. Pete’s Coffees sells two blends of coffee beans: Smooth Sipper and Kona Blend. Smooth Sipper is composed of equal amounts of Kona, Colombian, and Arabian beans, and Kona Blend is one-half Kona beans and one-half Colombian beans. Profit on the Smooth Sipper is $3 per pound, while profit on the Kona Blend is $4 per pound. Each day, the shop can obtain 100 pounds of Kona beans, 200 pounds of Colombian beans, and 200 pounds of Arabian beans. It uses those beans only in the two blends. If it can sell all that it makes, how many pounds of Smooth Sipper and of Kona Blend should Pete’s Coffees prepare each day to maximize profit? What is that maximum profit? Would this leave any extra beans? If so, what amount? 16. Pete’s Coffees sells two blends of coffee beans: African Blend and Major Thompson’s Blend. African Blend is one-half Tanzanian beans and one-half Ethiopian beans, and Major Thompson’s Blend is one- quarter Tanzanian beans and three-quarters Colombian beans. Profit on the African Blend is $4.25 per pound, while profit on Major Thompson’s Blend is $3.50 per pound. Each day, the shop can obtain 300 pounds of Tanzanian beans, 200 pounds of Ethiopian beans, and 450 pounds of Colombian beans. It uses those beans only in the two blends. If it can sell all that it makes, how many pounds of African Blend and of Major Thompson’s Blend should Pete’s Coffees prepare each day to maximize profit? What is that maximum profit? Would this leave any extra beans? If so, what amount? • Concept Questions 17. Do Exercise 11 with the geometric method. Which of the geometric method’s corner points were found with the simplex method? 18. Do Exercise 12 with the geometric method. Which of the geometric method’s corner points were found with the simplex method? Answer the following questions with complete sentences and your own words. 19. Why does the simplex method exist? That is, why do we not use the geometric method for all linear programming problems? 20. Compare and contrast the geometric method of linear programming with the simplex method of linear programming. Be sure to discuss both their similarities and their differences. Also give advantages and disadvantages of each. 21. Explain how the maximal value of the objective function can be found without looking at the number in the lower right corner of the final simplex matrix. 22. Explain why the entries in the last row have had their signs changed but the entries in all of the other rows have not had their signs changed. 23. Choose one of Exercises 9–16, and explain why the simplex method works in that exercise. Base your explanation on the discussion in this section titled “Why the Simplex Method Works.” • History Question 24. Who invented the simplex method of linear programming? 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-21 TECHNOLOGY AND THE SIMPLEX METHOD One of the simplex method’s advantages over the geometric method is that the simplex method is amenable to the use of a computer or graphing calculator. In the real world, linear programming problems have too many constraints and variables to do the work by hand. Instead, they are always done with a computer. In fact, George Dantzig, the inventor of linear programming, has stated that he had to delay his invention until computers became sufficiently advanced. The Row Operations on a Graphing Calculator Many graphing calculators will perform the row operations. We will illustrate this process with the craftsman problem from earlier in this section. The first simplex matrix is 6 £ 200 240 5 100 160 1 0 0 0 1 0 0 0 1 40 1,000 § 0 We will discuss how to enter this matrix into the calculator and how to perform the first two row operations on it. ENTERING A MATRIX To enter the above matrix on a TI, select “EDIT” from the “MATRIX” menu and then matrix A from the “EDIT” menu, as described below. TI-83/84 • • • • Press MATRX ( 2nd MATRIX on a TI-84). Use the ➤ button to highlight “EDIT”. Highlight option 1 “[A]”. Press ENTER . Casio • • • • Press MENU . Use the arrow buttons to highlight “MAT”. Press EXE . Use the arrow buttons to highlight “Mat A”. Our matrix has three rows and six columns. Enter these dimensions by typing 3 ENTER 6 ENTER as shown in Figure 12.38. Enter the matrix’s elements by typing FIGURE 12.38 Entering the matrix on a TI-83/84. 6 ENTER 5 ENTER 1 ENTER 0 ENTER Continue in this manner until you have entered all of the matrix’s elements. See Figure 12.38. When you’re done entering, type 2nd QUIT . 12-21 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-22 12-22 CHAPTER 12 Linear Programming VIEWING A MATRIX To view a previously entered matrix, do the following. TI-8384 • • • • • Press MATRX ( 2nd MATRIX on a TI-84). Highlight “NAMES”. Highlight option 1 “[A]”. Press ENTER . Once “[A]” is on the screen, press ENTER . Casio • • • • Press MENU . Use the arrow buttons to highlight “MAT” and press EXE . Use the arrow buttons to highlight “Mat A”. Press EXE , and the matrix will appear on the screen. Use the ➤ button to view the right side of the matrix. See Figure 12.39. MULTIPLYING OR DIVIDING A ROW BY A NUMBER Our first pivot is to divide row 2 by 200. On a graphing calculator, we can’t divide a row; instead, we multiply it by 1200. To do this, make the screen read “*row(1200,[A],2)” FIGURE 12.39 Viewing the matrix on a TI-83/84. TI-83/84 Type 1 200 , . • Press MATRX ( 2nd MATRIX on a TI-84). • Highlight “NAMES”. • Highlight option 1 “[A]”. • Press ENTER . Type , 2 ) ENTER . This makes “*row(” or “multR(” appear on the screen. This makes “1200,” appear on the screen. This makes “[A]” or “A” appear on the screen This makes “,2)” appear on the screen. ➤ • Press MATRX ( 2nd MATRIX on a TI-84). • Use the ➤ button to highlight “MATH”. • Use the button to highlight option E “*row(”. • Press ENTER . Your calculator will respond by performing the row operation. See Figure 12.40. FIGURE 12.40 Dividing row 2 by 200 on a TI-83/84. On a Casio: • Press F1 , which is now labeled “R-OP”. • Press F2 , which is now labeled “xRw”. • Press 1 200 EXE . This is the multiplier. • Press 2 EXE . This selects the row that will be multiplied. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-23 Technology and the Simplex Method 12-23 STORING A MATRIX Currently, we have the first simplex matrix stored as matrix [A]. This allows us to avoid reentering the matrix if we make a mistake later and have to start over. We will store the matrix in Figure 12.40 as matrix [B]. TI-8384 • • • • • Press STO➤ . Press MATRX ( 2ND MATRX on a TI-84). Highlight “NAMES”. Highlight option 1“[B]”. Press ENTER . Casio The Casio automatically stores the result of any matrix calculation as matrix A. Adding a Multiple of One Row to Another Row Our second pivot is to multiply row 2 by –6 and add the result to row 1. To do this, make the screen read “*row+(–6,[B],2,1)”: TI-8384 Type () 6 , . • Press MATRX ( 2nd MATRX on a TI-84). • Highlight “NAMES”. • Highlight “[B]”. • Press ENTER . Type , 2 , 1 ) ENTER . This makes “*row(” or “multR(“ appear on the screen. This makes “6,” appear on the screen. This makes “[B]” or “B” appear on the screen. This makes “,2, 1)” appear on the screen. ➤ • Press MATRX ( 2nd MATRX on a TI-84). • Use the ➤ button to highlight “MATH”. • Use the button to highlight option F “*row(”. • Press ENTER . Your calculator will respond by performing the row operation. See Figure 12.41. Store the matrix in Figure 12.41 as [C]. Store the result of the next row operation as [B], and then alternate between [C] and [B] in storing later results. This keeps the previous matrix available, in case you made any errors. FIGURE 12.41 Adding 6 # row 2 to row 1 on a TI-83/84. On a Casio: • Press F3 , which is now labeled “xRw”. • Press () 6 EXE . This is the multiplier. • Press 2 EXE . This selects the row that will be multiplied. • Press 1. This selects the row that will be added. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-24 12-24 CHAPTER 12 Linear Programming ADDING TWO ROWS In the rest of the pivoting on the above matrix, we don’t need to add two rows. In general, though, to add rows 1 and 2 of matrix [A] and place the result in row 2: TI-8384 Make the screen read row+([A],1, 2). Casio Press F4 1 EXE 2 EXE . Maintaining Accuracy Sometimes, after a few pivots, the resulting simplex matrix contains nothing but twelve decimal place numbers. This can make the work more cumbersome. The work can be easier if you use fractions rather than decimals. After a calculation, type “NFrac,” and your matrix will be displayed with fractions rather than decimals. To find the “NFrac” command, do the following: TI-8384 • Press MATH. • Highlight option 1. The decimal difficulty does not arise with the matrices discussed above. With a different matrix, the decimal difficulty does come up. See Figure 12.42. Using decimals, without the “NFrac” command. FIGURE 12.42 Using fractions, with the “NFrac” command. Fractions make the simplex method easier. Using decimals, you would multiply row 1 by 1>1.984824623. Using fractions, you multiply row 1 by 199>395. A few pivots later, you get one of the results shown in Figure 12.43. Notice the “–8.1518E–10” in the decimal version in Figure 12.43. This is the way a TI calculator displays scientific notation. It means 8.1518 # 10 10 0.0000000008158 0 In the fraction version, you get 0. Using decimals, without the “NFrac” command. FIGURE 12.43 Using fractions, with the “NFrac” command. Fractions make the simplex method more accurate. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-25 Technology and the Simplex Method 12-25 Summary of TI-83/84 Row Operations *row(1/200, [A], 2) Multiply a row by a number The multiplier The row that is being multiplied The matrix whose row is being multiplied *row(6, [B], 2, 1) Add a multiple of a row to another row The matrix whose row is being multiplied The multiplier The row that is being added The row that is being multiplied row([A], 1, 2) The matrix whose rows are being added Add two rows The row that is being added and replaced The row that is being added The Row Operations and Amortrix Amortrix is one of the features of the text web site www.cengage.com/math/ johnson. This software will enable you to quickly and easily perform the row operations on a matrix. We will illustrate this process with the craftsman problem from earlier in this section. The first simplex matrix is 6 £ 200 240 5 100 160 1 0 0 0 1 0 0 0 1 40 1,000 § 0 We will discuss how to enter this matrix into the calculator and how to perform the first three row operations on it. ENTERING THE MATRIX When you start Amortrix, a main menu appears. Click on the “Matrix Row Operations” option, and you will be asked for the dimensions of the matrix you want to work on. The above matrix has three rows and six columns, so after “Number of Rows” enter “3,” and after “Number of columns” enter “6.” Click on “Create New Matrix,” and the program will display a 3 6 matrix containing nothing but zeros. Use your mouse and the computer’s tab button to enter the above numbers. PIVOTING To pivot on 200, first divide row two by 200. To do this, click on the “Two” label to the left of the matrix. This selects row two and causes the number 2 to appear in a box below the matrix labeled “1st Row.” The cursor automatically moves to a box labeled “Enter a constant.” Type 200 in that box, and press the “Divide” button. Next, we need to multiply row 2 by –6 and add the result to row 1. To multiply row 2 by –6, click on the “Two” label to the left of the matrix and type –6 in the box labeled “Enter a constant.” When adding a multiple of one row to another row, always click first on the row to be multiplied. To add the result to row 1, click on the “One” label. To place the result in row 3, type 3 in the box labeled “Enter a row number.” Press the “Multiply & Add” button. 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-26 12-26 CHAPTER 12 Linear Programming In a similar manner, multiply row 2 by 240 and add the result to row 3. This completes the first pivot. The results are shown in Figure 12.44. FIGURE 12.44 The craftsman problem after the first three row operations, using Amortrix. EXERCISES Use a graphing calculator or Amortrix to solve the following linear programming problems. 25. Objective function: Maximize z 25x1 53x2 18x3 7x4 Constraints: 3x1 2x2 5x3 12x4 28 4x1 5x2 x3 7x4 32 x1 7x2 9x3 10x4 25 26. Objective function: Maximize z 275x1 856x2 268x3 85x4 Constraints: 5.2x1 9.8x2 7.2x3 3.7x4 33.6 3.9x1 5.3x2 1.4x3 2.5x4 88.3 5.2x1 7.7x2 4.6x3 4.6x4 24.7 27. Objective function: Maximize z 37x1 19x2 53x3 49x4 Constraints: 6.32x1 7.44x2 8.32x3 1.46x4 9.35x5 63 8.36x1 5.03x2 x3 5.25x5 32 1.14x1 9.42x2 9.39x3 10.42x4 9.32x5 14.7 28. Objective function: Maximize z 17x1 26x2 85x3 63x4 43x5 Constraints: 72x1 46x2 73x3 26x4 54x5 185 37x1 84x2 45x3 83x4 85x5 237 29. Our friend the craftsman now owns his own shop. He still makes coffee tables and end tables, but he makes each in three different styles: antique, art deco, and modern. The amount of labor and the cost of the materials required by each product, along with the profit they generate, are shown in Figure 12.45. The craftsman now has two employees, each of whom can work up to 40 hours a week. The craftsman himself frequently has to work more than 40 hours a week, but he will not allow himself to exceed 50 hours a week. His new bank loan allows him to spend up to $4000 a week on materials. How many coffee tables and end tables of each style should he make each week to maximize his profit? Style Hours of labor Cost of materials Profit Coffee table antique 6.00 $230 $495 Coffee table art deco 6.25 $220 $500 Coffee table modern 5.00 $190 $430 End table antique 5.25 $125 $245 End table art deco 5.75 $120 $250 End table modern 4.25 $105 $220 Item FIGURE 12.45 The craftsman’s production data. 30. The five friends have been so successful with their baking business that they have opened their own shop, the Five Friends Bakery. The bakery sells two types of breads: nine-grain and sourdough; two types of cakes: chocolate and poppyseed; and two types of muffins: blueberry and apple-cinnamon. Production data are given in Figure 12.46. The five partners have hired four workers. No one works more than 40 hours a week. Their business success (together with their new bank loan) allows them to spend up to $2000 per week on ingredients. What weekly production schedule should they follow to maximize their profit? 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-27 Exercises Labor Cost of ingredients Profit Nine grain bread 50 min. per loaf $1.05 per loaf $0.60 per loaf Sour dough bread 50 min. per loaf $0.95 per loaf $0.70 per loaf Chocolate cake 35 min. per cake $2.00 per cake $2.50 per cake Poppy seed cake 30 min. per cake $1.55 per cake $2.00 per cake Blueberry muffins 15 min. per dozen $1.60 per dozen $16.10 per dozen Apple cinnamon muffins 15 min. per dozen $1.30 per dozen $14.40 per dozen FIGURE 12.46 The Five Friends Bakery production data. 31. Fiat Lux, Inc., manufactures floor lamps, table lamps, and desk lamps. Production data are given in Figure 12.47. There are seven employees in the wood shop, five in the metal shop, three in the electrical shop, and one in testing; each works no more than 40 hours per week. If Fiat Lux, Inc., can sell all the lamps it produces, how many should it produce each week? Wood shop Metal shop Electrical shop Testing Profit Floor lamps 20 mins. 30 mins. 15 mins. 5 mins. $55 Table lamps 25 mins. 15 mins. 12 mins. 5 mins. $45 Desk lamps 30 mins. 10 mins. 11 mins. 4 mins. $40 FIGURE 12.47 Fiat Lux’s production data. 32. A furniture-manufacturing firm makes sofas, loveseats, easy chairs, and recliners. Each piece of furniture is constructed in the carpentry shop, then upholstered, and finally coated with a protective coating. Production data are given in Figure 12.48. Fifteen people work in the upholstery shop, nine work in the carpentry shop, and one person applies the protective coating, and each person can work no more than 40 hours per week. How many pieces of furniture should the firm manufacture each week to maximize its profit? Carpentry Upholstery Coating Profit Sofas 4 hours 8 hours 20 mins. $450 Love seats 4 hours 7.5 hours 20 mins. $350 Easy chairs 3 hours 6 hours 15 mins. $300 Recliners 6 hours 6.5 hours 15 mins. $475 FIGURE 12.48 12-27 Furniture production data. 33. City Electronics Distributors handles two lines of televisions: the Packard and the Bell. The Packard comes in three sizes: 18-inch, 24-inch, and rear projection; the Bell comes in two sizes: 18-inch and 30-inch. City Electronics purchases up to $57,000 worth of television sets from manufacturers each month and stores them in its 9000-cubic-foot warehouse. Storage and financial data are given in Figure 12.49. How many sets should City Electronics order each month to maximize profit? Set Size Cost Profit Packard 18'' 30 cubic ft. $150 $175 Packard 24'' 36 cubic ft. $200 $200 Packard rear projection 65 cubic ft. $450 $720 Bell 18'' 28 cubic ft. $150 $170 Bell 30'' 38 cubic ft. $225 $230 FIGURE 12.49 City Electronics inventory data. 34. J & M Winery makes two jug wines, House White and Premium White, and two higher-quality wines, Sauvignon Blanc and Chardonnay, which it sells to restaurants, supermarkets, and liquor stores. House White is a blend of 40% French colombard grapes, 40% chenin blanc grapes, and 20% sauvignon blanc grapes, while Premium White is 75% sauvignon blanc grapes and 25% French colombard grapes. J & M’s Sauvignon Blanc is 100% sauvignon blanc grapes, and its Chardonnay is 90% chardonnay grapes and 10% chenin blanc grapes. Profit on the House White is $1.00 per liter, profit on the Premium White is $1.50 per liter, profit on the Sauvignon Blanc is $2.25 per liter, and profit on the Chardonnay is $3.00 per liter. This season, J & M can obtain 30,000 pounds of French colombard grapes, 25,000 pounds of chenin blanc grapes, and 20,000 pounds each of sauvignon blanc grapes and chardonnay grapes. It takes 2 pounds 95057_12_ch12_web_p001-028.qxd 9/29/10 12:11 PM Page 12-28 12-28 CHAPTER 12 Linear Programming of grapes to make 1 liter of wine. If the company can sell all it makes, how many liters of its various products should J & M prepare to maximize profit? 35. J & M Winery makes two jug wines, House Red and Premium Red, and two higher-quality wines, Cabernet Sauvignon and Zinfandel, which it sells to restaurants, supermarkets, and liquor stores. House Red is a blend of 20% pinot noir grapes, 30% zinfandel grapes, and 50% gamay grapes. Premium Red is 60% cabernet sauvignon grapes and 20% each pinot noir and gamay grapes. J & M’s Cabernet Sauvignon is 100% cabernet sauvignon grapes, and its Zinfandel is 85% zinfandel grapes and 15% gamay grapes. Profit on the House Red is $0.90 per liter, profit on the Premium Red is $1.60 per liter, profit on the Zinfandel is $2.25 per liter, and profit on the Cabernet Sauvignon is $3.00 per liter. This season, J & M can obtain 30,000 pounds each of pinot noir, zinfandel, and gamay grapes and 22,000 pounds of cabernet sauvignon grapes. It takes 2 pounds of grapes to make 1 liter of wine. If the company can sell all that it makes, how many liters of its various products should J & M prepare in order to maximize profit? • Project 36. How many sheets of half-inch-thick plate glass and three-eighths-inch thick plate glass should Glassco make at each of its two plants to maximize its profit? What is the maximum profit? Use the production data and the results of Exercise 37 of Section 12.1. REVIEW EXERCISES FOR SECTIONS 12.2 AND 12.3 Solve Exercises 1–4 with the simplex method of linear programming. 1. Maximize z 4x1 7x2 8x3 Constraints: x1 2x2 4x3 30 4x1 x2 3x3 20 x1, x2, x3 0 2. Maximize z 4.6x1 3.2x2 Constraints: 7x1 3x2 420 x1 x2 80 2x1 5x2 100 x1, x2 0 3. Maximize z 2x1 3x2 5x3 Constraints: 15x1 x2 2x3 45 x1 6x2 3x3 40 8x1 7x2 70 x1, x2, x3 0 4. Maximize z 8x1 6x2 Constraints: x1 2x2 100 52x1 44x2 2288 25x1 20x2 1100 x1, x2 0 5. The Mowson Audio Co. makes stereo speaker assemblies. They purchase speakers from a speaker manufacturing firm and install them in their own cabinets. Mowson’s model 110 speaker assembly, which sells for $200, has a tweeter and a midrange speaker. Their model 330 assembly, which sells for $350, has two tweeters, a midrange speaker, and a woofer. Mowson currently has in stock 90 tweeters, 60 midrange speakers, and 44 woofers. Use the simplex method to determine how many speaker assemblies Mowson should make in order to maximize their income. What is that maximum income? 6. The Mowson Audio Co. (see Exercise 5) has introduced a new speaker assembly. The new model 220 has a tweeter, a midrange speaker, and a woofer. It sells for $280. If Mowson Audio has 140 tweeters, 90 midrange speakers, and 66 woofers in stock, how many speaker assemblies should they make to maximize their income? Interpret the solution in addition to answering the question.
© Copyright 2025 Paperzz