1 Introduction to Linear Programming MA30SA Applied Math Unit D - Linear Programming Revd: 120051212 1. Linear programming is a very important skill. It is a brilliant method for establishing optimum solutions to common everyday problems. Whether it involves trying to find how to a maximum of profit, or consume the least amount of resources, Linear Programming is an important tool. Example of Linear Programming 2. A manufacturer makes two types of shirts, long sleeve and short sleeve. Each long sheet shirt requires 4 minutes on the cutting machine and 3 minutes on the stitching machine. Each short sleeve shirt requires 3 minutes on the cutting machine and 1 minute on the stitching machine. The cutting machine is only available 2 hours per day, and the stitching machine is only available 1 hour per day. If the profit on a short sleeve shirt is $0.60 and the profit on a long sleeve shirt is $1.10, how many of each shirt should be produced each day? 3. A quick summary table for all these numbers is provided: Type Cutting Stitching Profit Shirt 4 min 3 min $1.10 3 min 1 min $0.60 Maximum Machine Availability 2 hours per day 1 hour per day 4. So, how many of each shirt should be produced each day? You can try the trial and error, guess and check method, your first try might look like this: QUANTITY CUT 6 24 18 $6.60 8 24 8 $4.80 14 48 26 $11.40 5. But notice you haven t used all of the time you have available for the cutting machine. You only used 48 minutes on the cutting machine, you have it available to you for a total of 2 hours. And you still have lots of time available on the stitching machine also. So you could easily make more of each or either type of shirt. MA30SA_LinProg.doc
2 6. So in the blank tables that follow you try to find the optimum quantity of each type of product to manufacture. 7. Here is the summary table again: Type Cutting Stitching Profit Shirt 4 min 3 min $1.10 3 min 1 min $0.60 Maximum Machine Availability 2 hours per day 1 hour per day 8. Now you try to find the optimum answer, several blank tables are given below, use pencil. QUANTITY CUT QUANTITY CUT QUANTITY CUT
3 The optimum solution is: LINEAR INEQUALITIES LINEAR INEQUALITIES 9. Statements such as: I want a job that pays $20 per hour or I want to reduce my energy consumption by 25% are statements of equality. In mathematics we say Pay = 20, or Energy Reduction = 25%. But if someone offered you a job at $25 per hour, would you refuse it because you said you wanted a job at $20 per hour? 10. So what you really wanted was a job that paid $20 or more per hour! In mathematics we say: Pay $20, for pay is greater than or equal to $20. Or you could say pay is $20 or more. Review of Inequality Signs True Examples > Greater than 4>2 < Less than 3<5 Greater than or equal to 2 2 Less than or equal to -5-3 NUMBER LINE EXAMPLES LINEAR INEQUALITIES IN ONE VARIABLE 3x + 6 < 12. Solution x <2-5 0 5 2x + 2-10. Solution x -6-5 0 5-5x - 4 > 6 Solution: x < -2-5 0 5 -x+2 4 Solution: x -2-5 0 5 Remember?!! When we multiply or divide an inequality by a negative number, we have to change the direction of the inequality!
4 GRAPHING LINEAR INEQUALITIES IN TWO VARIABLES 11. Recall how to graph a line. A line can be in many forms, but it can only have two variables and they cannot be raised to any power. The form of the line you are most familiar with is y=mx+b. 12. Steps to solve a linear inequality: When we graph linear inequalities to solve them we: STEP 1. STEP 2 STEP 3 Solve for y Draw the line as if the inequality symbol was an equals sign Ensure the line we draw is broken or dashed if there is no equality involved (example y>5 would be a broken line along y=5, but y 5 would be a solid line. If > or shade the region above the line If < or shade the region below the line. Use a test point if you are uncertain what region to shade Example: Graph : 2x + y < 4. Solution. The boundary line is y = -2x + 4. Slope is 2 and y-intercept is 4. Plot the line using a broken or dashed line. Shade all the area below the line. Example: You try: Graph : 4x + y 2..
5 USING A TEST POINT TO GRAPH LINEAR INEQUALITIES 13. We already know how to find if a point is on a line! To see if a point is in the region that is the solution to an inequality we can use a test point. This is useful if the answer isn t obvious to you. 14. For example: Shade the region that represents 2y > 2x + 2 From the steps already learned: Solve for y: y>x+1 Draw the line: Don t forget it is broken Shade the solution region Can you see that it is all points above the line? If not try a test point. Using a Test Point. Select a convenient point that is obviously on one side of the line (not on the line!). Let s try (0,0). Test to see if the point satisfies the inequality by evaluating at the point. y>x+1, so is 0>0+1? The answer is False. So clearly the point 0,0 is not in the solution region. Since a line cuts the universe in half, by logic all points on the other side of the line must be in the region that satisfies the inequality. So the top half would be shaded! SOLVING SYSTEMS OF LINEAR INEQUALITIES 15. Sometimes there is a system of inequalities that mathematically represent a situation. To say that your cell phone bill is at least $5 per month plus $0.50 per minute and that you make more than 10 minutes of calls per month is an example. Cell phone bill: Let b = amount of monthly bill and m the minutes of calling. b 5+0.5*m AND m > 10 The solution is the darkest shaded area! 20 10 b 10 20 m
6 USING THE TI 83 GRAPHING CALCULATOR 16. The TI-83 Graphing Calculator will graph regions that are solutions to inequalities. But it cannot indicate whether the line is excluded from the solution (ie: with a broken line). We do not have time to play with the TI 83 in this mode. The TI 83 is still very useful to us to check to make sure we haven t made a gross error in plotting our regions and to find intersections of lines. FINDING OPTIMAL SOLUTIONS TO A LINEAR PROGRAMMING PROBLEM 17. We already saw the type of problem that we face with linear programming. Recall we wanted to maximize profit in making our shirts. We wanted to maximize the time we used the various machines. There will be other cases we will see where we might want to minimize something: costs, pollution, etc. Example: 18. A vegetable farmer has a 10 hectare plot of land available for the season. He has selected lettuce and beans to grow. He has budgeted $4,000 for his crop costs. The lettuce costs $300 per hectare ($300/ha) to grow and the beans $500/ha. The profit is $75/ha for lettuce and the profit is $150/ha on beans. a. Write the equation that describes the profit from the plot of land b. Write the inequalities that describe the situation This equation is called the: These equations are called: c. Graph the system d. Identify some solutions e. Determine the best solution f. What is the profit?
7 EXAMPLE 2 LINEAR PROGRAMMING 19. A small trucking company has a weekly requirement of at least 650L of diesel fuel, at least 48 L of oil, and at least 324 L of gasoline to keep its trucks on the road. It has two suppliers, ABC and RCJ, that provide different quantities of the three materials at different total prices. ABC can provide 130L of diesel fuel, 36 L of gasoline, and 4 L of oil at a cost of $50.00. RCJ has a plan that provides 65L of diesel fuel, 54 L of gasoline, and 12 L of oil at a cost of $62.50. How many orders should the trucking company place with each supplier to meet is minimum weekly needs at a minimum cost. 20. Let us follow some steps to solving this type of problem: 1. After reading the question, make a chart to see the information more clearly. 2. Assign variables to the unknowns. 3. Form expressions to represent the restrictions and constraints. 4. Graph the inequalities. 5. Find the coordinates of the corner points of the feasible region. 6. Find the objective equation: what we are trying to optimize. 7. Find the vertex point that maximizes or minimizes what we are optimizing by making a table. 8. State the solution in a sentence. STEP 1 AND 2 MAKE A CHART AND ASSIGN VARIABLES 21 The chart will lay out information about each of the two products or processes that you have to choose from in two separate rows. Note the most you will ever have (in Grade 11) is two different products or producers or processes to choose from. The chart just helps you organize your thoughts and information. OPTION Variable Diesel Gas Oil Plan Cost ABC x 130 36 4 $50.00 RCJ y 65 54 12 $62.50 Minimum Required 650 324 48 22. We have assigned variable x to be the number of orders we make from company ABC, and variable y to be the number of orders we make from company RCJ. (That is what the question asks for; how many orders from each company). STEP 3 FORM EXPRESSIONS TO REPRESENT THE RESTRICTIONS 23. This is actually an easy step if you just relax and think realistically. We are looking for equations that constrain our solution. These equations are called constraints, things that we must do. So work left to right in our table of information.
8 24. First constraint is that we need at least 650 litres of diesel to run our trucks. The amount of diesel we need is therefore greater than or equal to 650. The amount of diesel we get though is 130 litres for each order from ABC and 65 Litres for each order from RCJ. So mathematically we say: 130*x + 65*y 650 for Diesel Fuel. This our first constraint inequality. 25. The second and third constraint inequalities become: 36*x + 54*y 324. (2 nd constraint) 4*x + 12 * y 48 (3 rd constraint) STEP 4 GRAPH THE INEQUALITIES (CONSTRAINTS) Normally since this can be rather complex we rely on the graphing calculator! But we will show the idea here. Further, you will still need to sketch out the inequalities on paper because the TI 83 doesn t do a very good job of that, it only does lines really well. Constraint 1. 130*x + 65*y 650 Intercepts: (0, 10) and (5, 0) Constraint 2. 36*x + 54*y 324 Intercepts: (0, 6) and (9, 0) Feasible Region Constraint 3. 4*x + 12 * y 48 Intercepts: (0, 4) and (12, 0) 1 So the region that satisfies all three constraints is the shaded region. Any point 2 in this region is a feasible choice to our problem. This is called the Feasible Region. 3 STEP 5 FIND COORDINATES OF THE CORNER POINTS 26. This is the complete secret to linear programming! Despite that any point in the feasible region can satisfy all the constraints, only one of the corner points gives the best and optimum solution. 27. You will need your TI83 to find the corner points. To find them you use the CALCULATE and INTERSECT functions of the calculator. Enter the three inequalities into the graphing calculator as if they were equations.
9 We are looking for corner points A, B, C, and D. Corner A is just a Y intercept of line 1. So: A (0,10) Corner D is just an x-intercept of line 3. So: D(12,0) 1 A To find Corner B and C we need to find the intersection of the lines. 2 B is the Intersection of Line 1 and Line 2. The TI 83 shows it as: B(3,4) B C D C is the intersection of Lines 2 and 3. The TI 83 shows it as: C(6,2) 3 STEP 6 - FIND THE OBJECTIVE EQUATION 28. The think we are trying to optimize is our costs. We want to make them a minimum. So this is the last equation, it is our objective equation! 29. We are told we want to minimize our cost. So what is our cost? Our cost is $50.00 for every order we make from ABC and $62.50 for every order we make from RCJ. So Cost= 50*x + 62.50*y STEP 7 MAKE A TABLE AND EVALUATE FOR ALL CORNER POINTS Point (x,y) Evaluate Cost 50*x + 62.50*y A (0,10) 625 B (3,4) 400 C (6,2) 425 D (12,0) 600 STEP 8- STATE SOLUTION IN WORDS 30. The optimal solution is for the trucking company to make their weekly orders with 3 orders from ABC company and 4 orders from RCJ company. This will minimize their costs. Their weekly costs will only be $400.00
10 TEACHER NOTES Blank Table for OHP QUANTITY CUT QUANTITY CUT QUANTITY CUT
11 Solution is 12 long sleeve and 24 short sleeve. Gives a profit of $27.60 Extra Example: A vegetable farmer has a 10 hectare plot of land available for the season. He has selected lettuce and beans to grow. He has budgeted $4,000 for his crop costs. The lettuce costs $300 per hectare ($300/ha) to grow and the beans $500/ha. The profit is $75/ha for lettuce and the profit is $150/ha on beans. a. Write the equation that describes the profit from the plot of land P=75x+150y Also called the objective equation b. Write the inequalities that describe the situation x + y <=10 300x + 500y <= 4000 This is the same as 3x + 5y = 40! Called constraints c. Graph the system d. Identify some solutions e. Determine the best solution